Do not remove test folder on GH
import pytest
import shutil
+import os
from pathlib import Path
+ON_GITHUB = bool(os.getenv('GITHUB_ACTIONS'))
+
+
# define marks
mark_names = ["core", "extractors", "preprocessing", "postprocessing",
"sorters", "si_sorters", "qualitymetrics", "comparison", "curation",
@@ -40,5 +44,5 @@ def pytest_collection_modifyitems(config, items):
def pytest_sessionfinish(session, exitstatus):
# teardown_stuff only if tests passed
if exitstatus == 0:
- if pytest.global_test_folder.is_dir():
+ if pytest.global_test_folder.is_dir() and not ON_GITHUB:
shutil.rmtree(pytest.global_test_folder)
