use @pytest.mark.foo over @pytest.mark.foo()
pytest-mark-no-parentheses
Boolean flag specifying whether@pytest.mark.foo()
without parameters should have parentheses.
If the option is set to true (the default),@pytest.mark.foo
is valid and@pytest.mark.foo()
is an error.
If set to false,@pytest.mark.foo()
is valid and@pytest.mark.foo
is an error.
Bad code (assuming pytest-mark-no-parentheses
set to true):
import pytest
@pytest.mark.foo()
def test_something():
...
Good code:
import pytest
@pytest.mark.foo
def test_something():
...
- to enforce consistency between all tests in a codebase