Skip to content

Fix internal error with module level skips #656

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

Conversation

seifertm
Copy link
Contributor

This PR wraps the call to _pytest.mark.structures.get_unpacked_marks in a try except that handles exceptions raised by pytest related to test outcomes, i.e. pytest.skip(..., allow_module_level=True), or collection errors, e.g. bare pytest.skip(...).

This is a bit of a bandaid. The best solution would be to not used get_unpacked_marks at all, or at least call it as part of the test collection phase.

Fixes #655

This prevents unrelated tests from aggregating in test_simple.py.

Signed-off-by: Michael Seifert <[email protected]>
@martindurant
Copy link

Would appreciate a ping when this makes it to a release.

@seifertm
Copy link
Contributor Author

The code triggering the internal error no longer exists on main. There are no plans for a patch release for v0.22, so I'm closing this PR as obsolete.

@seifertm seifertm closed this Nov 13, 2023
@seifertm seifertm deleted the fix-internal-error-with-module-level-skips branch November 15, 2023 14:43
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 this pull request may close these issues.

pytest-asyncio 0.22.0 will cause pytest INTERNALERROR when encounter module level pytest.skip
2 participants