Skip to content

test_create_subprocess_with_pidfd in test_asyncio.test_subprocess is not independent #109862

@serhiy-storchaka

Description

@serhiy-storchaka

Bug report

Bug description:

$ ./python -m test -v test_asyncio.test_subprocess -m test_create_subprocess_with_pidfd
...
test_create_subprocess_with_pidfd (test.test_asyncio.test_subprocess.GenericWatcherTests.test_create_subprocess_with_pidfd) ... /home/serhiy/py/cpython/Lib/test/test_asyncio/test_subprocess.py:980: DeprecationWarning: There is no current event loop
  asyncio.get_event_loop_policy().get_event_loop()
FAIL

======================================================================
FAIL: test_create_subprocess_with_pidfd (test.test_asyncio.test_subprocess.GenericWatcherTests.test_create_subprocess_with_pidfd)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/test_asyncio/test_subprocess.py", line 986, in test_create_subprocess_with_pidfd
    returncode, stdout = runner.run(main())
                         ^^^^^^^^^^^^^^^^^^
  File "/home/serhiy/py/cpython/Lib/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/serhiy/py/cpython/Lib/asyncio/base_events.py", line 664, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/serhiy/py/cpython/Lib/test/test_asyncio/test_subprocess.py", line 979, in main
    with self.assertRaises(RuntimeError):
AssertionError: RuntimeError not raised

Note also a deprecation warning (you need to scroll horizontally to see it):

.../Lib/test/test_asyncio/test_subprocess.py:980: DeprecationWarning: There is no current event loop

CPython versions tested on:

3.12, CPython main branch

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixes3.13bugs and security fixestestsTests in the Lib/test dirtopic-asynciotype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions