I have a list of integers. I want to supply each integer to the test method.
Here is how my test method looks like:
my_test.py
:
import pytest
def test_mt(some_number):
assert(some_number == 4)
conftest.py
:
@pytest.fixture(scope="session", autouse=True)
def do_something(request):
#Will be read from a file in real tests.
#Path to the file is supplied via command line when running pytest
list_int = [1, 2, 3, 4]
#How to run test_mt test case for each element of the list_int
In case I prepared some arguments to be tested how can I supply them to a test case defined by the test_mt
function in my case?