Skip to content

Conversation

bluetech
Copy link
Member

Fixes #7486.

If a test runtest phase (not setup) dynamically adds a pytest.mark.xfail mark to the item, it should be respected, but it wasn't. This regressed in 3e6fe92 (not released).

Fix it by just always refreshing the mark if needed. This is mostly what was done before but in a more roundabout way.

I also sneaked in a trivial style commit I noticed.

bluetech added 2 commits July 14, 2020 00:45
If a test runtest phase (not setup) dynamically adds a pytest.mark.xfail
mark to the item, it should be respected, but it wasn't. This regressed
in 3e6fe92 (not released).

Fix it by just always refreshing the mark if needed. This is mostly what
was done before but in a more roundabout way.
@bluetech bluetech merged commit fe1fcfd into pytest-dev:master Jul 15, 2020
@bluetech bluetech deleted the fix-dynamic-runtest-xfail branch July 23, 2020 10:58
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 6: Dynamically adding xfail marker in test no longer ignores failure
2 participants