mirror of
https://github.com/rust-vmm/rust-vmm-ci.git
synced 2026-08-05 03:08:31 +00:00
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 <sgarzare@redhat.com>
This commit is contained in:
committed by
Jonathan Woollett-Light
parent
7e9af57588
commit
9dfe5b267c
@@ -147,7 +147,7 @@ def test_coverage(profile, no_cleanup, test_scope):
|
||||
if previous_coverage < current_coverage:
|
||||
if profile == pytest.profile_ci:
|
||||
# In the CI Profile we expect the coverage to be manually updated.
|
||||
raise msg
|
||||
raise ValueError(msg)
|
||||
elif profile == pytest.profile_devel:
|
||||
coverage_config["coverage_score"] = current_coverage
|
||||
_write_coverage_config(coverage_config)
|
||||
@@ -155,6 +155,6 @@ def test_coverage(profile, no_cleanup, test_scope):
|
||||
# This should never happen because pytest should only accept
|
||||
# the valid test profiles specified with `choices` in
|
||||
# `pytest_addoption`.
|
||||
raise "Invalid test profile."
|
||||
raise RuntimeError("Invalid test profile.")
|
||||
elif previous_coverage > current_coverage:
|
||||
raise msg
|
||||
raise ValueError(msg)
|
||||
|
||||
Reference in New Issue
Block a user