ci: make pytest build script compatible with pytest 7.x

This commit is contained in:
Ivan Grokhotkov 2022-02-04 15:44:29 +01:00
parent 93106c9348
commit 21834f8362
No known key found for this signature in database
GPG Key ID: 1E050E141B280628

View File

@ -105,6 +105,11 @@ def get_pytest_dirs(folder: str) -> List[str]:
raise RuntimeError('pytest collection failed')
sys.stdout.flush() # print instantly
try:
test_file_paths = set(node.path for node in collector.nodes)
except AttributeError:
# pytest 6.x
test_file_paths = set(node.fspath for node in collector.nodes)
return [os.path.dirname(file) for file in test_file_paths]