Skip to content

Commit 8be538e

Browse files
committed
small tweaks to make test runs better observable and startup faster by omitting the site
1 parent c693a1e commit 8be538e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,19 @@ def working_tests():
6868
return working_tests
6969

7070

71-
for working_test in working_tests():
71+
WORKING_TESTS = working_tests()
72+
for idx, working_test in enumerate(WORKING_TESTS):
7273
def make_test_func(working_test):
7374
def fun():
74-
cmd = [sys.executable, "-m", "unittest"]
75+
cmd = [sys.executable, "-S", "-m", "unittest"]
7576
for testpattern in working_test[1]:
7677
cmd.extend(["-k", testpattern])
7778
testmod = working_test[0].rpartition(".")[2]
7879
print()
7980
cmd.append(os.path.join(os.path.dirname(test.__file__), "%s.py" % testmod))
8081
subprocess.check_call(cmd)
8182

82-
fun.__name__ = working_test[0]
83+
fun.__name__ = "%s[%d/%d]" % (working_test[0], idx + 1, len(WORKING_TESTS))
8384
return fun
8485

8586
test_f = make_test_func(working_test)
@@ -113,7 +114,7 @@ def fun():
113114
for idx, testfile in enumerate(testfiles):
114115
testfile_stem = os.path.splitext(os.path.basename(testfile))[0]
115116
testmod = "test." + testfile_stem
116-
cmd = [timeout, "-s", "9", "60"] + executable + ["-m"]
117+
cmd = [timeout, "-s", "9", "60"] + executable + ["-S", "-m"]
117118
tagfile = os.path.join(TAGS_DIR, testfile_stem + ".txt")
118119
test_selectors = working_selectors(tagfile)
119120

@@ -122,7 +123,7 @@ def fun():
122123
# not been tried)
123124
continue
124125

125-
print("[%d/%d] Testing %s" %(idx, len(testfiles), testmod))
126+
print("[%d/%d] Testing %s" %(idx + 1, len(testfiles), testmod))
126127
cmd += ["unittest", "-v"]
127128
for selector in test_selectors:
128129
cmd += ["-k", selector]

0 commit comments

Comments
 (0)