Skip to content
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

pytest 8.1 compatibility #14390

Open
jelly opened this issue Apr 7, 2024 · 1 comment · May be fixed by #14441
Open

pytest 8.1 compatibility #14390

jelly opened this issue Apr 7, 2024 · 1 comment · May be fixed by #14441

Comments

@jelly
Copy link

jelly commented Apr 7, 2024

With pytest 8.1 tests fail with import_path issue, see also ros2/launch#765 and a possible solution https://github.com/ros2/launch/pull/766/files

IPython/testing/plugin/pytest_ipdoctest.py:652: in collect
    module = import_path(self.path, root=self.config.rootpath)
E   TypeError: import_path() missing 1 required keyword-only argument: 'consider_namespace_packages'
_____________ ERROR collecting IPython/utils/tests/test_capture.py _____________
IPython/testing/plugin/pytest_ipdoctest.py:652: in collect
    module = import_path(self.path, root=self.config.rootpath)
E   TypeError: import_path() missing 1 required keyword-only argument: 'consider_namespace_packages'

And:

_____________________ ERROR collecting IPython/conftest.py _____________________
IPython/testing/plugin/pytest_ipdoctest.py:645: in collect
    module = self.config.pluginmanager._importconftest(
E   TypeError: PytestPluginManager._importconftest() missing 1 required keyword-only argument: 'consider_namespace_packages'
=============================== warnings summary ===============================

I've locally tried the following patch https://sprunge.us/OnIkZ1 which is probably wrong.

@lethal233
Copy link

lethal233 commented Apr 16, 2024

Also met the same issue. If downgraded to pytest==8.0.0, it works...

mgorny referenced this issue Apr 26, 2024
setup/teardown nose methods are no longer supported by pytest 8.
https://docs.pytest.org/en/latest/deprecations.html#setup-teardown
s-t-e-v-e-n-k added a commit to s-t-e-v-e-n-k/ipython that referenced this issue May 23, 2024
Pytest 8.1 has also changed the plugin API, as well as required new
keyword arguments. I've shifted the pytest version calculation to the
module level so we can use it everywhere, and continue supporting all
versions of pytest that we can.

Fixes ipython#14390
@s-t-e-v-e-n-k s-t-e-v-e-n-k linked a pull request May 23, 2024 that will close this issue
s-t-e-v-e-n-k added a commit to s-t-e-v-e-n-k/ipython that referenced this issue May 23, 2024
Pytest 8.1 has also changed the plugin API, as well as required new
keyword arguments. I've shifted the pytest version calculation to the
module level so we can use it everywhere, and continue supporting all
versions of pytest that we can.

Fixes ipython#14390
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants