Skip to content

Commit 9dfe5b2

Browse files
Use derivatives of BaseException for exceptions
When the coverage changes, we raise exceptions with simple strings, this causes the following error: TypeError: exceptions must derive from BaseException Let's use derivatives of BaseException to fix this issue. Signed-off-by: Stefano Garzarella <[email protected]>
1 parent 7e9af57 commit 9dfe5b2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

integration_tests/test_coverage.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,14 @@ def test_coverage(profile, no_cleanup, test_scope):
147147
if previous_coverage < current_coverage:
148148
if profile == pytest.profile_ci:
149149
# In the CI Profile we expect the coverage to be manually updated.
150-
raise msg
150+
raise ValueError(msg)
151151
elif profile == pytest.profile_devel:
152152
coverage_config["coverage_score"] = current_coverage
153153
_write_coverage_config(coverage_config)
154154
else:
155155
# This should never happen because pytest should only accept
156156
# the valid test profiles specified with `choices` in
157157
# `pytest_addoption`.
158-
raise "Invalid test profile."
158+
raise RuntimeError("Invalid test profile.")
159159
elif previous_coverage > current_coverage:
160-
raise msg
160+
raise ValueError(msg)

0 commit comments

Comments
 (0)