Skip to content

Commit 409e17c

Browse files
authored
Merge pull request #210 from iddm/fix-ci-pipelines-not-failing-on-script-failure
Re-raise the error when failing loading a python script.
2 parents f1a2652 + 62834d2 commit 409e17c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

RLTest/loader.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,12 @@ def load_files(self, module_dir, module_name, toplevel_filter=None, subfilter=No
132132
self.tests.append(TestClass(filename, symbol, module_name, methnames))
133133
elif inspect.isfunction(obj):
134134
self.tests.append(TestFunction(filename, symbol, module_name))
135-
except FileNotFoundError:
136-
print(Colors.Red("File %s not found: skipping" % filename))
137-
except Exception as x:
138-
print(Colors.Red("Problems in file %s: %s" % (filename, x)))
135+
except OSError as e:
136+
print(Colors.Red("Can't access file %s." % filename))
137+
raise e
138+
except Exception as e:
139+
print(Colors.Red("Problems in file %s: %s" % (filename, e)))
140+
raise e
139141

140142
def scan_dir(self, testdir):
141143
for filename in os.listdir(testdir):

0 commit comments

Comments
 (0)