<div dir="ltr">I&#39;d like to define a fixture that returns an object that depends on a parameter. The following can&#39;t work because the &quot;a&quot; parameter is expected to be another fixture: <div><br></div><div>@pytest.fixture<div>def some_fixture(a: int):</div><div>      return something that depends on value of a</div><div><br></div><div>class TestCase: </div><div>    def test_1(self, some_fixture(a=123)): </div><div>        use fixture return value for a=123<br></div><div><div>    def test_2(self, some_fixture(a=456)): </div><div>        use fixture return value for a=456</div><div> <br></div></div><div>Is my only option the good&#39;ol function call, ie remove the fixture decorator and just call the some_fixture function from my tests? </div><div>Oliver</div><div><br></div></div></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr">Oliver</div></div>