Update tests/integration/helpers/cluster.py

This commit is contained in:
Alexander Tokmakov 2022-07-18 18:19:02 +03:00 committed by GitHub
parent e67a447fc3
commit 225a5c3c7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -242,9 +242,10 @@ def extract_test_name(base_path):
Must be unique in each test directory (because it's used to make instances dir and to stop docker containers from previous run)
"""
name = p.basename(base_path)
name = p.splitext(name)[0]
name = name.removeprefix("test")
name = name.strip("-_")
if name == "test.py":
name = ""
elif name.startswith("test_") and name.endswith(".py"):
name = name[len("test_"):(len(name)-len(".py"))]
return name