How can I pass same parameters to setup and teardown functions as which I pass to test function?
import pytest
test_data = [("3+5", 8), ("2+4", 6), ("6*9", 42)]
@pytest.mark.parametrize("test_input,expected", test_data)
def test_eval(test_input, expected):
assert eval(test_input) == expected
def setup():
print("setup")
def teardown():
print("teardown")
In my real usecase I would initialize and clean database according to parameters passed to test function.
I have read examples, but none of those seem to cover case where all setup, test and teardown are parameterized.