Skip to content

Commit 855532e

Browse files
committed
More CI fixes
1 parent 7a51a8c commit 855532e

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

tests/python/conftest.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,6 @@ def skip(rel_id):
114114
"test_base_events.py::BaseEventLoopWithSelectorTests::"
115115
"test_log_slow_callbacks"
116116
)
117-
118-
if sys.version_info < (3, 12):
119-
xfail(
120-
"test_tasks.py::RunCoroutineThreadsafeTests::"
121-
"test_run_coroutine_threadsafe_task_factory_exception"
122-
)
123117
if sys.version_info >= (3, 8):
124118
xfail(
125119
"test_tasks.py::RunCoroutineThreadsafeTests::"
@@ -192,3 +186,6 @@ def skip(rel_id):
192186
xfail("test_futures2.py::PyFutureTests::test_task_exc_handler_correct_context")
193187
xfail("test_futures2.py::CFutureTests::test_task_exc_handler_correct_context")
194188

189+
# This test assumes that get_event_loop_policy().get_event_loop() doesn't
190+
# automatically return the running loop
191+
skip("test_subprocess.py::GenericWatcherTests::test_create_subprocess_with_pidfd")

trio_asyncio/_loop.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,16 @@ def set_event_loop(self, loop):
189189
__name__ = "asyncio.fake.trio_asyncio._loop"
190190

191191
# Make sure we don't try to continue using the Trio loop after a fork()
192-
def _clear_state_after_fork():
193-
if _in_trio_context():
194-
from trio._core._run import GLOBAL_RUN_CONTEXT
192+
if hasattr(os, "register_at_fork"):
193+
def _clear_state_after_fork():
194+
if _in_trio_context():
195+
from trio._core._run import GLOBAL_RUN_CONTEXT
195196

196-
del GLOBAL_RUN_CONTEXT.task
197-
del GLOBAL_RUN_CONTEXT.runner
198-
current_loop.set(None)
197+
del GLOBAL_RUN_CONTEXT.task
198+
del GLOBAL_RUN_CONTEXT.runner
199+
current_loop.set(None)
199200

200-
os.register_at_fork(after_in_child=_clear_state_after_fork)
201+
os.register_at_fork(after_in_child=_clear_state_after_fork)
201202

202203
from asyncio import events as _aio_event
203204

0 commit comments

Comments
 (0)