-
-
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
pytest.mark not evaluated with pytest_generate_tests #2401
Comments
That's expected behavior, the mark must wrap around all parameters in the parameter set In pytest 3.1 we will ship a better mechanism for marking parametersets |
I build up a workaround:
|
but I can't differentiate a condition from a value :-/ it's both stored in "args". |
@spaceone one you need to use actual tuples as arguments to encode the args that get extracted the method used in pytest < 3.1 is pretty fragile which is why we introduce https://github.com/pytest-dev/pytest/blob/features/_pytest/mark.py#L14 to support declaring it as the linked code also contains the extraction logic which should give you some hints on how to write the workaround for current py.test |
but bascially, the extraction mechanism presumes that when given a mark, the last element of the args tuple is the parameter list for the parameterize call and it will recurse on that |
As you are working on it in further releases, this issue can be closed. I'll find my workaround. |
cat > test_foo.py
results in:
Expected result:
test is marked as XFAILED.
The text was updated successfully, but these errors were encountered: