-
-
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
staticmethod tests fail when declared in a superclass #3466
Comments
It would be really nice to see what you are trying to accomplish in your TestBar class. I was able to implement working code this way. conftest.pyAll fixtures go here.
test_static.py
Results
It seems to be an inheritance issue. A possible fixChange it from a static method to a class method.
TestFoo wont be able to run test_me as a test itself, but classes that inherit from TestFoo will run properly. Results
Some ResourcesA little light reading on class method and static methods among a few other things. |
After all the recent trouble we got from wrapping test functions to issue warnings when they get called directly (#3661, #3781), I wonder if it is wise for us to support this at all. What do you think @RonnyPfannschmidt? |
staticmethod
test fails if you declare it in a superclass:TestBar.test_me
fails due to theTypeError: test_me() missing 1 required positional argument: 'fixture'
.TestFoo.test_me
passes correctly.The text was updated successfully, but these errors were encountered: