diff options
author | Cole Robinson <crobinso@redhat.com> | 2020-01-27 06:16:32 -0500 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2020-01-27 06:57:37 -0500 |
commit | 49d16912c3d0beae622c133d4a929dd415b0014b (patch) | |
tree | 8bd4039287670e3def80f949a549081d574d697f /setup.py | |
parent | e784376699b1c7c5477f033b16323bca42d7158f (diff) | |
download | virt-manager-49d16912c3d0beae622c133d4a929dd415b0014b.tar.gz |
setup: Skip coverage report when tests are aborted or skipped
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -503,8 +503,15 @@ class TestBaseCommand(distutils.core.Command): err = int(bool(len(result.failures) > 0 or len(result.errors) > 0)) + if getattr(result, "shouldStop", False): + # Test was aborted with ctrl-c + err = True + if cov and not err: - cov.report(show_missing=False, skip_covered=True) + if len(result.skipped): + print("Skipping coverage report because tests were skipped.") + else: + cov.report(show_missing=False, skip_covered=True) sys.exit(err) |