Make compatible with pytest-asyncio#278
Merged
bsipocz merged 2 commits intoscientific-python:mainfrom Jan 21, 2025
Merged
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
Contributor
|
Needs 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
Member
bsipocz
left a comment
There was a problem hiding this comment.
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!
Member
|
I'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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pytest-asyncioreads 1collector.objduring test collection which raises anImportErrorforDocTestTextfilePlus. We fix this by aligning that class with pytest’sDoctestTextfile2 and settingobjtoNone.Fixes #256