-
Notifications
You must be signed in to change notification settings - Fork 6
Support test functions that are located inside classes #16
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
Comments
It would be non-trivial to fix this: indeed the way we currently generate the wrappers around test functions is done with a hacked version of When a function is located inside a class, its first argument is 'self' or 'cls', and should remain the first argument, even after our wrapping. We could however inspect the test functions and detect that it is an instance, class or static method, so that we handle the case specifically. Let's wait for users actually requiring it :) |
uhm...here i am :D |
Thanks for caring! As of today as I wrote above, this would require a major non-trivial modification. A workaround is to use the "new" pytest style (i.e. no classes, just plain old functions in separate modules). But I understand that in large projects this might not be satisfying. I would gladly accept contributions on the topic if anyone feels ready to dig into dynamic code compilation. |
Looks like a MUSTHAVE feature |
It seems that this is doable quite easily with current status of the code (now that I rely on |
Fixed in |
Uh oh!
There was an error while loading. Please reload this page.
ValueError: <function TestClass.test_xxx> uses no argument '________step_name_'
It seems that test functions located inside classes are not supported yet.
The text was updated successfully, but these errors were encountered: