I am taking value of setup from command line argument while running the test with py.test framework.
group.addoption("--setup", "--sC=", action="store", dest="setup", help="setup.")
def pytest_configure(config):
print "config.option.setup: ", config.option.setup
Here, I am able to get the setup file name with config.option.setup, but the same file name which I pass here, I want to fetch it from my test script.
If I put the same line in my test script, I get below error:
> print "config.option.setup_config: ", config.option.setup_config
E NameError: global name 'config' is not defined
Can someone please let me know how can I access config.option.setup in my test script?