Closed EdwardBetts closed 3 months ago
This is lacking useful information. Is test_fixtures.py your code? If so, provide the code. What is pytest-tornasync? It looks like this is causing the error, rather than anything to do with aiohttp.
test_fixtures.py is https://github.com/aio-libs/pytest-aiohttp/blob/master/tests/test_fixtures.py
I tried uninstalling pytest-tornasync. Same error.
Are you able to reproduce the problem, or are the tests passing for you?
$ python3 -mpytest -x --asyncio-mode=auto
=============================================================================== test session starts ================================================================================
platform linux -- Python 3.12.5, pytest-8.3.2, pluggy-1.5.0
rootdir: /home/edward/src/2024/vendor/pytest-aiohttp
configfile: setup.cfg
testpaths: tests
plugins: remotedata-0.4.1, astropy-header-0.2.2, cov-5.0.0, console-scripts-1.4.1, time-machine-2.13.0, requests_mock-1.12.1, anyio-4.4.0, openfiles-0.6.0, forked-1.6.0, typeguard-4.3.0, mock-3.14.0, astropy-0.11.0, hypothesis-6.105.1, kgb-7.1.1, asyncio-0.20.3, arraydiff-0.6.1, twisted-1.14.1, django-4.5.2, syrupy-4.6.1, flaky-3.8.1, timeout-2.3.1, xdist-3.6.1, trio-0.8.0, aiohttp-1.0.5, doctestplus-1.2.1, Faker-26.0.0, filter-subpackage-0.2.0, pylama-8.4.1, repeat-0.9.3, httpx-0.30.0
asyncio: mode=Mode.AUTO
collected 10 items
tests/test_fixtures.py F
===================================================================================== FAILURES =====================================================================================
_______________________________________________________________________________ test_aiohttp_plugin ________________________________________________________________________________
/home/edward/src/2024/vendor/pytest-aiohttp/tests/test_fixtures.py:107: in test_aiohttp_plugin
result.assert_outcomes(passed=8)
/usr/lib/python3/dist-packages/_pytest/pytester.py:564: in parseoutcomes
return self.parse_summary_nouns(self.outlines)
/usr/lib/python3/dist-packages/_pytest/pytester.py:582: in parse_summary_nouns
raise ValueError("Pytest terminal summary report not found")
E ValueError: Pytest terminal summary report not found
------------------------------------------------------------------------------- Captured stderr call -------------------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/_pytest/pytester.py", line 1156, in runpytest_inprocess
reprec = self.inline_run(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/_pytest/pytester.py", line 1121, in inline_run
ret = main([str(x) for x in args], plugins=plugins)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 156, in main
config = _prepareconfig(args, plugins)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 341, in _prepareconfig
config = pluginmanager.hook.pytest_cmdline_parse(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 513, in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 120, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 139, in _multicall
raise exception.with_traceback(exception.__traceback__)
File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 122, in _multicall
teardown.throw(exception) # type: ignore[union-attr]
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/_pytest/helpconfig.py", line 105, in pytest_cmdline_parse
config = yield
^^^^^
File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 103, in _multicall
res = hook_impl.function(*args)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 1140, in pytest_cmdline_parse
self.parse(args)
File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 1490, in parse
self._preparse(args, addopts=addopts)
File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 1377, in _preparse
self.pluginmanager.load_setuptools_entrypoints("pytest11")
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 422, in load_setuptools_entrypoints
self.register(plugin, name=ep.name)
File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 501, in register
plugin_name = super().register(plugin, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 168, in register
self._verify_hook(hook, hookimpl)
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 360, in _verify_hook
_warn_for_function(argname_warning, hookimpl.function)
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 41, in _warn_for_function
warnings.warn_explicit(
pytest.PytestRemovedIn9Warning: The (path: py.path.local) argument is deprecated, please use (file_path: pathlib.Path)
see https://docs.pytest.org/en/latest/deprecations.html#py-path-local-arguments-for-hooks-replaced-with-pathlib-path
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
================================================================================ 1 failed in 0.17s =================================================================================
$
That's a completely different error?
Again, your test seems to be working when I run it. I think you should create a new env and only install the pytest plugins needed for the test.
When running, I just get normal assertion errors from the tests:
============================================================================================== short test summary info ==============================================================================================
FAILED test_server.py::test_aiohttp_plugin - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...}
FAILED test_server.py::test_aiohttp_raw_server - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...}
FAILED test_server.py::test_aiohttp_client_cls_fixture_custom_client_used - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...}
FAILED test_server.py::test_aiohttp_client_cls_fixture_factory - AssertionError: assert {'errors': 0,...pped': 0, ...} == {'errors': 0,...pped': 0, ...}
Results (4.11s):
4 failed
- test_server.py:6 test_aiohttp_plugin
- test_server.py:110 test_aiohttp_raw_server
- test_server.py:145 test_aiohttp_client_cls_fixture_custom_client_used
- test_server.py:172 test_aiohttp_client_cls_fixture_factory
Sorry. I tried removing pytest plugins and I eventually found it is pylama that causes the problem.