How to pass arguments in pytest by command line
In your pytest test, don’t use @pytest.mark.parametrize: def test_print_name(name): print (“Displaying name: %s” % name) In conftest.py: def pytest_addoption(parser): parser.addoption(“–name”, action=”store”, default=”default name”) def pytest_generate_tests(metafunc): # This is called for every test. Only get/set command line arguments # if the argument is specified in the list of test “fixturenames”. option_value = metafunc.config.option.name if ‘name’ in … Read more