I'd like to see the fixture decorator ignore any leading underscore of the wrapped function. Then usage would be:
@pytest.fixture
def _my_fixture():
...
def test_foo(my_fixture):
...
I'm against adding a implicit name mangling system
I can appreciate the aversion to implicitness-- however the fixture scheme is already rather implicit itself. I mean, define a function and then functions with an argument of the same name invoke it as a (stateful) factory...?
Prefixing local functions with underbar is the right thing to do anyway. The small renaming doesn't seem like a stretch.
@belm0
What linter is this about?
Maybe it should be made aware of pytest fixtures then maybe?
Prefixing local functions with underbar is the right thing to do anyway.
..if "unused" only I assume?
Most helpful comment
I'm against adding a implicit name mangling system