I have test files with different nesting level.For example:
/project/tests/flows/test_flow_1.py
/project/tests/orders/reports/test_reports.py
My setting for log path in pytest.ini
is log_file = logs/tests.log
But pytest creates the directory 'logs' in each test directory.
Also I tried to set it in conftest.py
file but then the log file just is not created:
def logs_path(request): path = request.config.rootdir logging.basicConfig(filename=os.path.join(path, 'tests.log'))
How can I set this creating only one time in the root project directory?