-
Notifications
You must be signed in to change notification settings - Fork 15
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
PT019 and pytest-describe #74
Comments
Hi @ROpdebee, |
As far as I know, with pytest-describe, everything that matches the following conditions is a test case:
describe-prefixes are customisable via the pytest configuration, by default the prefix is describe blocks themselves currently cannot use fixtures (pytest-dev/pytest-describe#9 (comment)) so it's not necessary to check those for the violations, I think. Examples: def describe_something(): # Describe block, no need to check
def a_test_case(): # Test case, need to check
...
def _not_a_test_case(): # Not a test case, no need to check
...
def describe_something_else(): # Another describe block, no need to check
def it_works(): # Test case, need to check
... I've been looking through the code a bit, |
I looked at pytest-describe, and it's more complicated than that. |
Bug report
What's wrong
When using pytest-describe, PT019 (fixture without value as parameter) violations aren't reported. It's likely because these test cases don't necessarily follow the conventional naming rules (no
test_
prefix) and are thus not picked up as test cases.How it should work
Local functions inside
describe_
blocks should be treated as test cases and their parameters need to be checked for violations of PT019.System information
Example
Output:
Expected output:
The text was updated successfully, but these errors were encountered: