-
-
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
Inverse markers #3700
Comments
pytest -m 'playstation'? |
pytest -m "playstation" does not run common tests for all platforms. |
That's what you need, right? You need:
Smarter way for the same result:
This command will run "complete playstation test", but not others. |
No Your solution does not run test_common_login
|
as far as i understood you are trying to use markers for environment selection - mark expressions are simply not designed for that, and shouldn't be |
You can apply mark 'common' for common tests and run it like this: |
@RonnyPfannschmidt is there any way to do environment selection then? |
@kjeldflarup i do have something about it in a work project, unfortunately it's not going to be extracted soon, but basically this needs to be experimented with in a plug-in since its easy to get the actual semantics wrong as long as there isn't more than one consumer |
I found a solution by making pytest_collection_modifyitems remove the tests.
|
See https://pytest.readthedocs.io/en/reorganize-docs/example/markers.html#marking-platform-specific-tests-with-pytest |
Closing this as a combination of inactive, has workarounds, and markers seeming like the wrong solution 😕 |
There is a posibility to use markers
@pytest.mark.playstation
And then run pytest -m "not playstation"
That would run all my tests except the playstation tests. Now if I want a complete playstation test, I just type pytest.
That however gives me errors on xbox, Wii, gamebody, nintendods etc.
Thus a test must be executed in this cumbersome way
pytest -m "not xbox and not Wii and not gamebody and not nintendods"
Is there a smarter way to do this? The markers operates quite inverse of what I need.
I could of course use skip, but then I would get a zillion skip messages, where I only wanted to know the skip messages for the playstation.
A decorator like @pytest.ignoreif(... ) would be nice.
The text was updated successfully, but these errors were encountered: