We have pytest framework structure given below
In this framework, we have set up command line argument in conftest file
Problem:
We need to access '--ENV' value in config.py file But we have already imported config.py already in conftest.py file. Please suggest the solution for it. and in the config.py we have only variable and assigned values.
I have tried setup and a variable with default value and try to update that variable value with command line argument. config.py:
ENVIRONMENT = "qa"
if hasattr(pytest, 'config') and pytest.config.getoption('--ENV'):
ENVIRONMENT = pytest.config.getoption('--ENV')
logging.info(ENVIRONMENT)
But in this code value of ENVIRONMENT is not updating during run time and according to command line argument --ENV (command to run program : pytest --ENV QA)

