-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 collection fails when using pytest.mark.usefixtures and a test function is a classmethod #3537
Comments
GitMate.io thinks possibly related issues are #2114 (Could pytest --last-failed skip test collection?), #3308 (Question: Can someone explain the below uses of @pytest.mark.usefixtures), #378 (@pytest.mark.usefixtures take no effects on fixtures), #1045 (pytest-warnings fails tests since 2.8), and #342 (pytest is identifying a function as a test case that shouldn't be). |
this is a bug its quite unexpected that someone uses actual class-methods for tests |
Maybe there are things someone wouldn't want to expose to some instance attributes. I could imagine this 2 celery applications with one assigned to a class attribute and the other to an instance attribute. So does it warrant a PR ? Do you think it could be a good first contribution ? |
it warrants a pr after all its a bug ^^ |
Yeah alright ^^. I'll submit a PR soon. Thanks. |
Encountered this as well with pytest-3.6.1 , any update on this issue? |
Fix will be available in pytest 4.1. |
This minimal example using django TestCase class causes an error on collection:
The output of running
pytest
is as such:OS: Fedora 27
(See log output for everything else)
If no test function is a
classmethod
it works alright. I don't know if this is a feature. Nothing seems to imply that.Thank you!
The text was updated successfully, but these errors were encountered: