jllorencetti / pytest-deadfixtures

Plugin to list unused fixtures in your tests
MIT License
153 stars 16 forks source link

Option to disable check for certain fixtures #27

Open goodspark opened 5 years ago

goodspark commented 5 years ago

Because of issues similar to #21, it would be nice to have a comment we can use to disable/suppress errors for certain fixtures. Here's a minimal example:

@pytest.fixture
def blah():
  return 1

@pytest.fixture
def bloo():
  return 2

@pytest.fixture(params=["blah", "bloo"])
def both(request):
  return request.getfixturevalue(request.param)

def test_thing(both):
  print(both)
anukul commented 1 year ago

@jllorencetti We are using a fork with a rudimentary implementation of this feature - https://github.com/rotki/pytest-deadfixtures/commit/87d2be8

If you're open to it, I'm happy to make a PR and work on adding this here! :)