Skip to content

Commit 70f506d

Browse files
committed
make it easy to run single unittests with tagfile
1 parent 8be538e commit 70f506d

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

graalpython/com.oracle.graal.python.test/src/tests/test_tagged_unittests.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,13 @@ def working_selectors(tagfile):
6262

6363
def working_tests():
6464
working_tests = []
65-
for tagfile in glob.glob(os.path.join(TAGS_DIR, "*.txt")):
65+
glob_pattern = os.path.join(TAGS_DIR, "*.txt")
66+
for arg in sys.argv:
67+
if arg.startswith("--tagfile="):
68+
glob_pattern = os.path.join(TAGS_DIR, arg.partition("=")[2])
69+
sys.argv.remove(arg)
70+
break
71+
for tagfile in glob.glob(glob_pattern):
6672
test = os.path.splitext(os.path.basename(tagfile))[0]
6773
working_tests.append((test, working_selectors(tagfile)))
6874
return working_tests
@@ -102,7 +108,7 @@ def fun():
102108
if arg == "--retag":
103109
retag = True
104110
else:
105-
glob_pattern = sys.argv[1]
111+
glob_pattern = os.path.join(os.path.dirname(test.__file__), sys.argv[1])
106112

107113
p = subprocess.run(["/usr/bin/which", "timeout"], **kwargs)
108114
if p.returncode != 0:

graalpython/com.oracle.graal.python.test/src/tests/unittest_tags/test_range.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)