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.0.0 breaks cython doctesting using this module #58

Closed
radhermit opened this issue Jan 28, 2024 · 1 comment · Fixed by #64
Closed

pytest-8.0.0 breaks cython doctesting using this module #58

radhermit opened this issue Jan 28, 2024 · 1 comment · Fixed by #64
Labels

Comments

@radhermit
Copy link

Describe the bug
Running cython-based doctests using this module with the latest pytest release (8.0.0) fails.

See the following for the relevant error messages that are output when running a project's test suite under tox:

.tox/coverage/lib/python3.12/site-packages/pytest_cython/plugin.py:159: in collect
    optionflags = get_optionflags(self)
.tox/coverage/lib/python3.12/site-packages/_pytest/doctest.py:404: in get_optionflags
    optionflags_str = config.getini("doctest_optionflags")
E   AttributeError: 'DoctestModule' object has no attribute 'getini'

Installed Packages
The following Python and installed packages versions being used:

  • Python: 3.11.7
  • Cython: 3.0.8
  • Pytest: 8.0.0
  • Pytest-cython: 0.2.1

Expected behavior
The tests should run as expected.

@radhermit radhermit added the bug label Jan 28, 2024
nsoranzo added a commit to nsoranzo/bx-python that referenced this issue Jan 30, 2024
lpsinger added a commit to lpsinger/healpy that referenced this issue Mar 4, 2024
pytest-cython does not work with pytest 8.x.
See lgpage/pytest-cython#58.

Fixes healpy#912.
@lpsinger
Copy link

lpsinger commented Mar 4, 2024

Another thing that broke with pytest 8.x: the path argument was removed from the pytest_collect_file hook (see pytest-dev/pytest#11757). This causes the following error message:

pluggy._manager.PluginValidationError: Plugin 'pytest_cython' for hook 'pytest_collect_file'
hookimpl definition: pytest_collect_file(path, parent)
Argument(s) {'path'} are declared in the hookimpl but can not be found in the hookspec

See also healpy/healpy#912.

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

Successfully merging a pull request may close this issue.

2 participants