My testing framework has below structure
- Master_test_Class.py ---> Holds generic test cases to be run for smoke and regression test suite
- Test_Smoke1.py and Test_Reg1.py --> Child classes inherit Master_test_class.py
I have logging enabled in pytest.ini for INFO
[pytest]
log_cli = 1
log_cli_level = INFO
Below is my code in conftest.py
def pytest_generate_tests(metafunc):
.....
logging.info("This is generated during the test collection !!!")
When i run the test either of the test files, logs are printed 2 times once in the formatting specified in pytest.ini and another in red color
pytest -s Test_Reg1.py
I am so lost why is the logging info getting printed twice.