···11-from asyncio import gather, get_event_loop
11+from asyncio import gather, run
22from collections import namedtuple
33from itertools import zip_longest
44from os import getenv
···157157 auth.assure_configured()
158158159159 text = text or editor()
160160- loop = get_event_loop()
161160 try:
162162- loop.run_until_complete(main(auth, text, images, alt_texts, lang, yes_to_all))
161161+ run(main(auth, text, images, alt_texts, lang, yes_to_all))
163162 except PostTooLongError as err:
164163 error(err)
+24
tests/test_cli_post.py
···11+from unittest.mock import patch
22+33+from not_my_ex.cli.post import post
44+55+66+def test_post_command_event_loop():
77+ """There was a relevant change in Async I/O API in Python 3.14, when getting the
88+ event loop. This test assures the CLI works on the supported Python versions."""
99+ with (
1010+ patch("not_my_ex.cli.post.cache") as cache,
1111+ patch("not_my_ex.cli.post.authenticate") as auth,
1212+ ):
1313+ cache.return_value.exists.return_value = False
1414+ auth.return_value.assure_configured.return_value = None
1515+ with patch("not_my_ex.cli.post.main", return_value=None):
1616+ post(
1717+ text="test",
1818+ images=[],
1919+ alt_texts=[],
2020+ lang="en",
2121+ yes_to_all=True,
2222+ skip_bluesky=False,
2323+ skip_mastodon=False,
2424+ )