-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
xfail condition should include platform
module in namespace
#3236
Comments
Definitely, thanks for the suggestion. |
This is a great first contribution, cc @feuillemorte. |
For what it's worth: I do not see the NameError when trying that (pytest
I wanted to try if |
Now that I think about it, perhaps it uses the global namespace of the module of the test? |
If I'm understanding correctly the problem isn't outcomes.xfail but the xfail mark which is talked about in the docs here. If that's the case then the relevant code for what's available during evaluation of conditions is here: Lines 110 to 114 in bedceaa
So it's the global namespace of the module of the test plus os, sys, and item.config. |
@svuki thanks for clarifying that! I believe we can just add |
#3236 Use platform module in pytest.mark
One can currently write:
But not
If one tries that, an error is raised:
It seems reasonable to me the
platform
module should be exposed in the namespace for these conditional methods for the same reasonsys
is.I searched but could not find an existing issue or even a definition of what these conditional expressions are guaranteed to support, so I hope this is not a duplicate report.
The text was updated successfully, but these errors were encountered: