I don't know if we can do it using python, selenium and pytest. I want call test file to execute test files on condition based for example- I have main test file named test_main.py inside it call other test cases from the other test files like -
if heading == 'Questionnaire':
## execute test_questionnaire.py
if heading == 'Basic Info':
## execute test_basic.py