You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we try to "filter" on a single tag "c" then we get one test ran. Easy to understand.
Running: pytest test_Tags.py -m "c" -s test_c ran .
If we try to filter on tag "a" which is on two tests, then tests with that mark run. Okay.
Running: pytest test_Tags.py -m "a" -s test_a ran test_a_and_b ran
If we try to filter on tag "not a" which is on two tests, then tests without mark a are run. Got it
Running: pytest test_Tags.py -m "not a" -s test_b ran test_c ran
So as far as marks are concerned, you can filter only on one and cant create a composite filter. Which would be nice possibly.
I can see why that'd be difficult because what if i say pytest test_Tags.py -m "a not b" -s
Does test_a_and_b() get ran or not?
If there are some cool things i'm missing, that'd be great to know :)
The text was updated successfully, but these errors were encountered:
Well its a good thing i checked. The documentation on marks using examples doesnt explictly go over that you can use and or or. There seems to be inly one example at the very bottom of the page.
This is somewhat related to #3446, I know you are all working on editing the way markers work
Im starting to use markers in my project and want to go over the functionality to make sure I am using them fully.
Heres the test code
test_Tags.py
If we try to "filter" on a single tag "c" then we get one test ran. Easy to understand.
Running: pytest test_Tags.py -m "c" -s
test_c ran .
If we try to filter on tag "a" which is on two tests, then tests with that mark run. Okay.
Running: pytest test_Tags.py -m "a" -s
test_a ran test_a_and_b ran
If we try to filter on tag "not a" which is on two tests, then tests without mark a are run. Got it
Running: pytest test_Tags.py -m "not a" -s
test_b ran test_c ran
So as far as marks are concerned, you can filter only on one and cant create a composite filter. Which would be nice possibly.
I can see why that'd be difficult because what if i say
pytest test_Tags.py -m "a not b" -s
Does test_a_and_b() get ran or not?
If there are some cool things i'm missing, that'd be great to know :)
The text was updated successfully, but these errors were encountered: