-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Latest 8.0.0 is breaking on 3.8+ #11868
Comments
This comment was marked as duplicate.
This comment was marked as duplicate.
Having the same issue on Python3.12 and pytest-asyncio |
When removing % pytest --version && python --version && pytest -vv test/test_placeholder.py::test_load_svg_placeholder_external
pytest 8.0.0
Python 3.10.13
Test session starts (platform: darwin, Python 3.10.13, pytest 8.0.0, pytest-sugar 0.9.7)
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase(PosixPath('/some/where/else/.hypothesis/examples'))
metadata: {'Python': '3.10.13', 'Platform': 'macOS-14.2.1-arm64-arm-64bit', 'Packages': {'pytest': '8.0.0', 'pluggy': '1.3.0'}, 'Plugins': {'pytest_check_links': '0.9.0', 'snapshot': '0.9.0', 'harvest': '1.10.4', 'timeout': '2.2.0', 'cases': '3.8.2', 'html': '4.1.1', 'checkdocs': '2.10.1', 'subtests': '0.11.0', 'unordered': '0.5.2', 'steps': '1.8.0', 'hypothesis': '6.97.1', 'todo': '0.2.1', 'cov': '4.1.0', 'shutil': '1.7.0', 'Faker': '22.5.1', 'subprocess': '1.5.0', 'tap': '3.4', 'metadata': '3.0.0', 'reporter': '0.5.2', 'flake8': '1.1.1', 'mock': '3.12.0', 'speed': '0.3.5', 'check': '2.3.1', 'shell': '0.3.2', 'profiling': '1.7.0', 'xdist': '3.5.0', 'sugar': '0.9.7', 'race': '0.2.0', 'anyio': '4.2.0', 'pytest_codeblocks': '0.17.0', 'pydocstyle': '2.3.2', 'threadleak': '0.5.0', 'sherlock': '0.3.4'}}
rootdir: /some/where/else
plugins: pytest_check_links-0.9.0, snapshot-0.9.0, harvest-1.10.4, timeout-2.2.0, cases-3.8.2, html-4.1.1, checkdocs-2.10.1, subtests-0.11.0, unordered-0.5.2, steps-1.8.0, hypothesis-6.97.1, todo-0.2.1, cov-4.1.0, shutil-1.7.0, Faker-22.5.1, subprocess-1.5.0, tap-3.4, metadata-3.0.0, reporter-0.5.2, flake8-1.1.1, mock-3.12.0, speed-0.3.5, check-2.3.1, shell-0.3.2, profiling-1.7.0, xdist-3.5.0, sugar-0.9.7, race-0.2.0, anyio-4.2.0, pytest_codeblocks-0.17.0, pydocstyle-2.3.2, threadleak-0.5.0, sherlock-0.3.4
collecting ...
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ERROR collecting test/test_placeholder.py ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
/some/where/.pyenv/versions/3.10.13/envs/liitos-3-10-13/lib/python3.10/site-packages/_pytest/nodes.py:152: in _create
return super().__call__(*k, **kw)
/some/where/.pyenv/versions/3.10.13/envs/liitos-3-10-13/lib/python3.10/site-packages/_pytest/python.py:1801: in __init__
fixtureinfo = fm.getfixtureinfo(self, self.obj, self.cls)
/some/where/.pyenv/versions/3.10.13/envs/liitos-3-10-13/lib/python3.10/site-packages/_pytest/fixtures.py:1490: in getfixtureinfo
names_closure, arg2fixturedefs = self.getfixtureclosure(
E TypeError: getfixtureclosure() got an unexpected keyword argument 'initialnames'
During handling of the above exception, another exception occurred:
/some/where/.pyenv/versions/3.10.13/envs/liitos-3-10-13/lib/python3.10/site-packages/pluggy/_hooks.py:493: in __call__
return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
/some/where/.pyenv/versions/3.10.13/envs/liitos-3-10-13/lib/python3.10/site-packages/pluggy/_manager.py:115: in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
/some/where/.pyenv/versions/3.10.13/envs/liitos-3-10-13/lib/python3.10/site-packages/_pytest/python.py:277: in pytest_pycollect_makeitem
return list(collector._genfunctions(name, obj))
/some/where/.pyenv/versions/3.10.13/envs/liitos-3-10-13/lib/python3.10/site-packages/_pytest/python.py:486: in _genfunctions
definition: FunctionDefinition = FunctionDefinition.from_parent(
/some/where/.pyenv/versions/3.10.13/envs/liitos-3-10-13/lib/python3.10/site-packages/_pytest/python.py:1809: in from_parent
return super().from_parent(parent=parent, **kw)
/some/where/.pyenv/versions/3.10.13/envs/liitos-3-10-13/lib/python3.10/site-packages/_pytest/nodes.py:275: in from_parent
return cls._create(parent=parent, **kw)
/some/where/.pyenv/versions/3.10.13/envs/liitos-3-10-13/lib/python3.10/site-packages/_pytest/nodes.py:167: in _create
return super().__call__(*k, **known_kw)
/some/where/.pyenv/versions/3.10.13/envs/liitos-3-10-13/lib/python3.10/site-packages/_pytest/python.py:1801: in __init__
fixtureinfo = fm.getfixtureinfo(self, self.obj, self.cls)
/some/where/.pyenv/versions/3.10.13/envs/liitos-3-10-13/lib/python3.10/site-packages/_pytest/fixtures.py:1490: in getfixtureinfo
names_closure, arg2fixturedefs = self.getfixtureclosure(
E TypeError: getfixtureclosure() got an unexpected keyword argument 'initialnames'
collected 0 items / 1 error
========================================================================================================================== warnings summary ==========================================================================================================================
../../../../../.pyenv/versions/3.10.13/envs/liitos-3-10-13/lib/python3.10/site-packages/_pytest/nodes.py:158
/some/where/.pyenv/versions/3.10.13/envs/liitos-3-10-13/lib/python3.10/site-packages/_pytest/nodes.py:158: PytestDeprecationWarning: <class '_pytest.python.FunctionDefinition'> is not using a cooperative constructor and only takes {'parent', 'name', 'callobj'}.
See https://docs.pytest.org/en/stable/deprecations.html#constructors-of-custom-pytest-node-subclasses-should-take-kwargs for more details.
warnings.warn(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
====================================================================================================================== short test summary info =======================================================================================================================
FAILED test/test_placeholder.py - TypeError: getfixtureclosure() got an unexpected keyword argument 'initialnames'
Results (0.28s):
ERROR: found no collectors for /some/where/else/test/test_placeholder.py::test_load_svg_placeholder_external |
Related pytest-asyncio issues: |
This comment was marked as duplicate.
This comment was marked as duplicate.
Seems like pytest-asyncio isn't compatible with pytest 8 yet, so until this is fixed, stick with pytest<8. Hopefully pytest-asyncio can do a release which requires pytest<8 soon (until pytest 8 support is added) so this happens automatically. @sthagen This error indicates that one of the plugins you use is overriding the internal |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
Thanks to all the support for changes by providing pytest in the first place to those that do. Having that out of the way, I often follow the dream of semantic versioning and packaging systems until I cannot. Then I take a break and at some point follow our dream again: PS: Neither grep nor ripgrep found anything like even only case-insensitive In case you need some feedback for fixed pre-releases, GitHub-commits, anything, please feel free to mention me in such a PR or issue and I will try to provide whatever the maintainers ask for. PPS: Why does GitHub-WebUI always silently replace my |
The |
Pytest-asyncio specifies an upper bound on the supported pytest version since v0.23.4a2. Unfortunately, the pre-release didn't make it in time for the pytest 8 release. I just released v0.23.4 which correctly specifies the compatible pytest versions. This should prevent pytest-asyncio from being installed together with pytest 8 by accident, until the compatibility issue is resolved on the pytest-asyncio side. Sorry for causing noise on the pytest bug tracker. Feel free to ping me directly in this kind of issues. |
Thanks folks, closing this then as there's nothing to be done on pytest's side. |
This also breaks Sybil: simplistix/sybil#107 @nicoddemus Maybe you could add this API change to the changelog so that people can find information about it and some hints on how to fix it in their code? |
The change with |
@nicoddemus - any thoughts on stabalising a fixture requesting API? It feels like many pytest releases break this stuff and it's pretty wearing :-( |
#2471 is probably the better place for this. |
@The-Compiler - yes, well, 5 years later and that issue has still seen no progress... |
That doesn't make an issue about an unrelated problem (the original post is something entirely different) a more suitable place. |
I completely understand the feeling, and it is frustrating to us as well... believe us, we don't make light to introduce breaking changes, even for internal APIs -- @bluetech goes to great pains grepping a large number of plugins to check if internal changes are breaking them, for example. Having said that, we have been doing some nice refactorings in the direction of cleaning up pytest internals (especially @bluetech and @sadra-barikbin, who have been doing fantastic work). Unfortunately much of the pytest internal design/implementation just grew organically over the years (pytest is really old, started in 2008 or so I believe), without an overall design driving the changes, so we are playing catch up -- and the moving is slow, because we have limited time as maintainers and also because we realize we should make baby steps in order to avoid breaking things; and even so, we end up breaking downstream projects using the internals all the time. |
… default argument As discussed in pytest-dev#11868.
…getfixtureclosure Fix pytest-dev#11868
…getfixtureclosure Fix pytest-dev#11868
…getfixtureclosure Fix pytest-dev#11868
…getfixtureclosure Fix pytest-dev#11868
… default argument As discussed in pytest-dev#11868.
Perhaps @bluetech could add Sybil to the plugins checked? I've lost count of the number of times I've had new release of pytest break Sybil because it has to use "non-public" APS... |
@cjw296 that sounds like a great idea! Feel free to open a PR in that regard to get the ball rolling if you want. |
@nicoddemus - I have no idea what you're repo you're looking for me to open a PR against or what you're expecting it to contain... |
* Pytest 8 breaks when using the asyncio library, see issue pytest-dev/pytest#11868 * We should use pytest-asyncio instead of the asyncio library directly once pytest-asyncio supports pytest >=8 Signed-off-by: Elliot Gunton <egunton@bloomberg.net>
Limits [pytest](https://github.com/pytest-dev/pytest) to <8.0.0. * Pytest 8 breaks when using the asyncio library, see issue pytest-dev/pytest#11868 * We should use pytest-asyncio instead of the asyncio library directly once pytest-asyncio supports pytest >=8 --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Elliot Gunton <egunton@bloomberg.net> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Elliot Gunton <egunton@bloomberg.net>
Comment by pytest maintainers: pytest-asyncio is not yet compatible with pytest 8; if you're using pytest-asyncio, stick with pytest<8 until the issue is resolved.
Description
Prior to 8.0.0 all tests on 3.7 -- 3.11 were passing. Then today when 8.0.0 was released 3.8+ started failing.
See screen shot, rerunning tests that passed on 27 Jan, failed today on 28 Jan.
Failure is happening on 3.8+
The only requirements for the project are
pytest
andpytest-asyncio
. For reference, the project is FairAsyncRLock. The git action workflow for the Ci/Cd is here.Traceback
This is the problem. It's the same for all 3.8+.
The text was updated successfully, but these errors were encountered: