Skip to content

Commit 1690349

Browse files
committed
Catch Java exceptions in the first iteration of the retagger
1 parent 0b7a20a commit 1690349

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,13 @@ def parse_unittest_output(output):
163163
# entirely
164164
testfile_stem = os.path.splitext(os.path.basename(testfile))[0]
165165
testmod = "test." + testfile_stem
166-
cmd = [timeout, "-s", "9", "120"] + executable + ["-S", "-m"]
166+
cmd = [timeout, "-s", "9", "120"] + executable
167+
if repeat == 0:
168+
# Allow catching Java exceptions in the first iteration only, so that subsequent iterations
169+
# (there will be one even if everything succeeds) filter out possible false-passes caused by
170+
# the tests catching all exceptions somewhere
171+
cmd += ['--experimental-options', '--python.CatchAllExceptions']
172+
cmd += ["-S", "-m", "unittest", "-v"]
167173
tagfile = os.path.join(TAGS_DIR, testfile_stem + ".txt")
168174
if retag and repeat == 0:
169175
test_selectors = []
@@ -176,7 +182,6 @@ def parse_unittest_output(output):
176182
continue
177183

178184
print("[%d/%d, Try %d] Testing %s" %(idx + 1, len(testfiles), repeat + 1, testmod))
179-
cmd += ["unittest", "-v"]
180185
for selector in test_selectors:
181186
cmd += ["-k", selector]
182187
cmd.append(testfile)

0 commit comments

Comments
 (0)