Skip to content
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

FBT001 and PLR0917 - false positive on pytest functions #7286

Open
DetachHead opened this issue Sep 12, 2023 · 1 comment · May be fixed by #15158
Open

FBT001 and PLR0917 - false positive on pytest functions #7286

DetachHead opened this issue Sep 12, 2023 · 1 comment · May be fixed by #15158
Labels
bug Something isn't working

Comments

@DetachHead
Copy link

# test_foo.py
@fixture
def a():
    return True

def test_foo(a: bool): # error: FBT001
    assert a

also happens on hook functions

# conftest.py
def pytest_foo(a: bool): # error: FBT001
    ...

arguments to functions called by pytest are always positional, as they are called by pytest itself so this rule is not an issue.

@charliermarsh charliermarsh added the bug Something isn't working label Jan 5, 2024
@DetachHead DetachHead changed the title boolean-type-hint-positional-argument (FBT001) false positive on pytest functions boolean-type-hint-positional-argument (FBT001) - false positive on pytest functions Feb 2, 2024
@DetachHead DetachHead changed the title boolean-type-hint-positional-argument (FBT001) - false positive on pytest functions FBT001 and PLR0917 - false positive on pytest functions Feb 16, 2024
@DetachHead
Copy link
Author

also too-many-positional (PLR0917)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants