I am new to pytest and I have written a test function with fixture but I am receiving an error that fixture variable is not found. Here is the code:
@pytest.fixture(scope="module")
def func1(arg1,arg2):
return arg1 + arg2
def test_func1(func1):
assert func1== 4
When I run this file, I get the error E fixture arg1 not found. If I define arg1 and arg2 globally and not pass them through function, this will work fine, but how can I pass an argument to fixture function.