0

I'd like to have a pytest marker which would make specific fixtures autoused in any marked tests.

For example, in this instance the marker baz would make the fixture foo available in test_one without any additional syntax.

import pytest

@pytest.fixture
def foo():
    return 'bar'


@pytest.mark.baz
def test_one():
    s = foo
    assert s == 'bar'
harryjulian
  • 29
  • 1
  • 3
  • refer [@pytest.mark.usefixtures](https://stackoverflow.com/questions/54886692/pytest-fixture-get-value-and-avoid-error-fixture-x-called-directly), and there are ways defined there to achieve this. – simpleApp Jul 14 '23 at 15:24

0 Answers0