Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 354 Bytes

PT019.md

File metadata and controls

25 lines (17 loc) · 354 Bytes

PT019

fixture {name} without value is injected as parameter, use @pytest.mark.usefixtures instead

Examples

Bad code:

def test_foo(_patch_something):
    ...

Good code:

import pytest

@pytest.mark.usefixtures('_patch_something')
def test_foo():
    ...

Rationale

  • to avoid unused parameters in test functions