aklajnert / pytest-subprocess

Pytest plugin to fake subprocess.
MIT License
107 stars 14 forks source link

1.5.0 + master 4187ef2c): pytest fails in more than half units #149

Closed kloczek closed 1 month ago

kloczek commented 7 months ago

I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

Python 3.9.18 and pytest 8.1.1.

Detailed list of installed modules in build env: ```console Package Version ----------------------------- ----------- alabaster 0.7.16 anyio 4.3.0 Babel 2.14.0 build 1.1.1 changelogd 0.1.7 charset-normalizer 3.3.2 click 8.1.7 docutils 0.20.1 exceptiongroup 1.1.3 idna 3.6 imagesize 1.4.1 importlib_metadata 7.1.0 iniconfig 2.0.0 installer 0.7.0 Jinja2 3.1.3 MarkupSafe 2.1.3 packaging 24.0 pluggy 1.4.0 Pygments 2.17.2 pyproject_hooks 1.0.0 pytest 8.1.1 pytest-asyncio 0.23.6 pytest-rerunfailures 12.0 python-dateutil 2.9.0.post0 requests 2.31.0 ruamel.yaml 0.18.5 ruamel.yaml.clib 0.2.8 setuptools 69.1.1 sniffio 1.3.0 snowballstemmer 2.2.0 Sphinx 7.2.6 sphinx-autodoc-typehints 2.0.0 sphinxcontrib-applehelp 1.0.8 sphinxcontrib-devhelp 1.0.5 sphinxcontrib-htmlhelp 2.0.5 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.7 sphinxcontrib-serializinghtml 1.1.10 tokenize_rt 5.2.0 toml 0.10.2 tomli 2.0.1 typing_extensions 4.10.0 urllib3 1.26.18 wheel 0.43.0 zipp 3.17.0 ```

Please let me know if you need more details or want me to perform some diagnostics.

kloczek commented 7 months ago
Here is summary pytest output: ```console ================================================================================== short test summary info ================================================================================== SKIPPED [4] tests/test_asyncio.py:114: condition: sys.platform!="win32" ERROR tests/test_asyncio.py::test_basic_usage[shell] - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_basic_usage[shell] - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_basic_usage[exec] - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_basic_usage[exec] - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_with_arguments_shell[True] - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_with_arguments_shell[True] - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_with_arguments_shell[False] - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_with_arguments_shell[False] - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_with_arguments_exec[True] - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_with_arguments_exec[True] - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_with_arguments_exec[False] - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_with_arguments_exec[False] - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_incorrect_call[shell-True] - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_incorrect_call[shell-True] - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_incorrect_call[shell-False] - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_incorrect_call[shell-False] - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_incorrect_call[exec-True] - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_incorrect_call[exec-True] - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_incorrect_call[exec-False] - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_incorrect_call[exec-False] - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_wait[shell-False] - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_wait[shell-False] - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_wait[shell-True] - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_wait[shell-True] - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_wait[exec-False] - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_wait[exec-False] - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_wait[exec-True] - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_wait[exec-True] - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_devnull_stdout - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_devnull_stdout - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_anyio - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_anyio - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_stdout_and_stderr[False] - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_stdout_and_stderr[False] - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_stdout_and_stderr[True] - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_stdout_and_stderr[True] - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_combined_stdout_and_stderr[False] - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_combined_stdout_and_stderr[False] - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_combined_stdout_and_stderr[True] - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_combined_stdout_and_stderr[True] - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_input[False] - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_input[False] - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_input[True] - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_input[True] - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_popen_recorder - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_popen_recorder - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_asyncio_subprocess_using_callback[no-callback] - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_asyncio_subprocess_using_callback[no-callback] - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop ERROR tests/test_asyncio.py::test_asyncio_subprocess_using_callback[noop-callback-causes-infinite-loop] - pluggy.PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown. ERROR tests/test_asyncio.py::test_asyncio_subprocess_using_callback[noop-callback-causes-infinite-loop] - DeprecationWarning: pytest-asyncio detected an unclosed event loop when tearing down the event_loop FAILED tests/test_subprocess.py::test_basic_process[str-False] - AttributeError: 'tuple' object has no attribute 'communicate' FAILED tests/test_subprocess.py::test_basic_process[path,str-False] - AttributeError: 'tuple' object has no attribute 'communicate' FAILED tests/test_subprocess.py::test_basic_process[str,path-False] - AttributeError: 'tuple' object has no attribute 'communicate' FAILED tests/test_subprocess.py::test_basic_process[path-False] - AttributeError: 'tuple' object has no attribute 'communicate' FAILED tests/test_subprocess.py::test_basic_process_merge_streams[False] - AttributeError: 'tuple' object has no attribute 'communicate' FAILED tests/test_subprocess.py::test_wait[False] - AttributeError: 'tuple' object has no attribute 'returncode' FAILED tests/test_subprocess.py::test_check_output[False] - AttributeError: __enter__ FAILED tests/test_subprocess.py::test_check_call[False] - AttributeError: __enter__ FAILED tests/test_subprocess.py::test_call[False] - AttributeError: __enter__ FAILED tests/test_subprocess.py::test_run[False] - AttributeError: __enter__ FAILED tests/test_subprocess.py::test_universal_newlines[False] - AttributeError: 'tuple' object has no attribute 'wait' FAILED tests/test_subprocess.py::test_text[False] - AttributeError: 'tuple' object has no attribute 'wait' FAILED tests/test_subprocess.py::test_input[False] - AttributeError: 'tuple' object has no attribute 'communicate' FAILED tests/test_subprocess.py::test_ambiguous_input[False] - AttributeError: __enter__ FAILED tests/test_subprocess.py::test_multiple_wait[False] - AttributeError: 'tuple' object has no attribute 'wait' FAILED tests/test_subprocess.py::test_use_real - AttributeError: __enter__ FAILED tests/test_subprocess.py::test_real_process - AttributeError: __enter__ FAILED tests/test_subprocess.py::test_encoding[False-encoding] - AttributeError: __enter__ FAILED tests/test_subprocess.py::test_encoding[False-errors] - AttributeError: __enter__ FAILED tests/test_subprocess.py::test_allow_unregistered_cleaning - AttributeError: __enter__ FAILED tests/test_subprocess.py::test_non_piped_streams[True-False] - AttributeError: 'tuple' object has no attribute 'communicate' FAILED tests/test_subprocess.py::test_non_piped_streams[False-False] - AttributeError: 'tuple' object has no attribute 'communicate' FAILED tests/test_subprocess.py::test_non_piped_same_file[True-False] - AttributeError: 'tuple' object has no attribute 'communicate' FAILED tests/test_subprocess.py::test_non_piped_same_file[False-False] - AttributeError: 'tuple' object has no attribute 'communicate' =================================================================== 24 failed, 85 passed, 4 skipped, 50 errors in 12.48s ==================================================================== ```

And full pytest output in attachment python-pytest-subprocess.FAIL.txt

aklajnert commented 7 months ago

@kloczek - thanks for reporting, can you try running it again against master? It should be fixed.