-
-
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
Test is skipped without a skip mark added to the test #13079
Comments
this is expected - and a user error direct modification of a function object will assure the net time its collected from a different class |
okay, thanks for such a quick response! |
more context is needed the minimal example you posted is best served by using the mark as decorator in the target class |
What about the case when I need to add marks from the |
show the code - generae tests is supposed to use |
It's hard to do, because the code from the project i'm working with is pretty complicated and I don't know how to simplify it for an example here without violating an nda. Anyway you showed me that this is the misuse of |
This issue is stale because it has the |
pip list
from the virtual environment you are usingTree of the project:
I have 2 test classes that are based on the same class (they use
Template Method
pattern).When I add a skip mark to only one test function from the
pytest_generate_test
hook, both tests are skipped.test.py
contentsconftest.py
contents:Output of the run:
If you take a look at the output, despite
metafunc
object is different for each test class, the underlyingfunction
object is the same object in both cases (id =0x7fb9d4e404a0
).If we take a look at plain classes in python, in similar structure they have different ids:
Environment:
System:
Ubuntu 24.04 in wsl2 under Windows 11
Also reproduces in original Ubuntu 24.04
Python & packages:
The text was updated successfully, but these errors were encountered: