Make compatible with pytest-asyncio by geigerzaehler · Pull Request #278 · scientific-python/pytest-doctestplus
Navigation Menu
{{ message }}
scientific-python / pytest-doctestplus Public
- Notifications You must be signed in to change notification settings
- Fork 44
Merged
bsipocz merged 2 commits intoscientific-python:mainfrom
Jan 21, 2025Merged
Make compatible with pytest-asyncio#278
bsipocz merged 2 commits intoscientific-python:mainfrom
Make compatible with pytest-asyncio#278
bsipocz merged 2 commits intoscientific-python:mainfrom
Conversation
`pytest-asyncio` reads [1] `collector.obj` during test collection which raises an `ImportError` for `DocTestTextfilePlus`. We fix this by aligning that class with pytest’s `DoctestTextfile` [2] and setting `obj` to `None`. Fixes scientific-python#256 [1]: https://github.com/pytest-dev/pytest-asyncio/blob/eb63d5ad0ca21041726ada3d5c00211d36418a9b/pytest_asyncio/plugin.py#L640 [2]: https://github.com/pytest-dev/pytest/blob/fc56ae365fcdea800f91683186136a8191e22399/src/_pytest/doctest.py#L421
pllim
requested a review
from bsipocz
pllim
added this to the
v1.4.0 milestone
Copy link Copy Markdown
Contributor
pllim
commented
Jan 21, 2025
pllim commented
Jan 21, 2025Needs a change log: https://github.com/scientific-python/pytest-doctestplus/blob/main/CHANGES.rst
Thanks! LGTM but I'll let Brigitta have a look too.
bsipocz approved these changes Jan 21, 2025
Copy link Copy Markdown
Member
bsipocz
left a comment
bsipocz
left a comment
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good and works as expected. I love when a long-standing issue is boiled down into a one-liner fix. Thank you @geigerzaehler!
bsipocz
merged commit
81fe4fd
into
scientific-python:main
Copy link Copy Markdown
Member
bsipocz
commented
Jan 21, 2025
bsipocz commented
Jan 21, 2025I'll tag a release this week, first see if any more fixes can be added to it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment