-
Notifications
You must be signed in to change notification settings - Fork 39
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
Fixture breaks when defined in class method #182
Comments
Thanks @mcstarioni for reporting this issue, sorry for not having seen the notification :( |
Indeed. The reason seems to be that I was adding a TestMethod.pytest_fxt
Out[2]: <function pytest_cases.tests.pytest_extension.issues.test_issue_182.TestMethod.pytest_fxt(self)>
TestMethod.cases_fxt
Out[3]: <function pytest_cases.tests.pytest_extension.issues.test_issue_182.TestMethod.cases_fxt(request, self)> This additional argument is used when this fixture is used in a union: pytest will always try to call it even if it is not used in this branch of the union, so I create a wrapper inspection the I'll fix this in a minute by appending the argument instead of prepending it. |
Fixed in version 3.2.1 that should be available in a few minutes when travis has completed. Let me know ! |
Using pytest_cases's fixture in a test which is a class method leads to the following error:
fixture 'self' not found
,. While using pytest.fixture doesn't result in error.Minimal code to reproduce:
Versions: pytest: '6.2.1', pytest_cases: '3.2.0'
The text was updated successfully, but these errors were encountered: