File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99if __name__ == "__main__" :
1010 pytest_args = ["--ignore=external" ]
1111
12- # pytest runs tests twice if __init__.py is passed explicitly as an argument. Remove any __init__.py file to avoid that.
12+ args = sys .argv [1 :]
13+ # pytest < 8.0 runs tests twice if __init__.py is passed explicitly as an argument.
14+ # Remove any __init__.py file to avoid that.
15+ # pytest.version_tuple is available since pytest 7.0
1316 # https://github.com/pytest-dev/pytest/issues/9313
14- args = [arg for arg in sys .argv [1 :] if arg .startswith ("-" ) or os .path .basename (arg ) != "__init__.py" ]
17+ if not hasattr (pytest , "version_tuple" ) or pytest .version_tuple < (8 , 0 ):
18+ args = [arg for arg in args if arg .startswith ("-" ) or os .path .basename (arg ) != "__init__.py" ]
1519
1620 if os .environ .get ("XML_OUTPUT_FILE" ):
1721 pytest_args .append ("--junitxml={xml_output_file}" .format (xml_output_file = os .environ .get ("XML_OUTPUT_FILE" )))
You can’t perform that action at this time.
0 commit comments