summaryrefslogtreecommitdiff
path: root/tests/test_api.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2019-04-21 18:17:27 -0400
committerNed Batchelder <ned@nedbatchelder.com>2019-04-21 18:17:27 -0400
commit822953106a01aaf1f88bc5e5a63fe693d42c0c00 (patch)
treeb5a93ae8239dd6ee18748ef98ca1f46a90245f0d /tests/test_api.py
parent4c86353020bea6dfd3f13780501f2083a0bcaeb7 (diff)
downloadpython-coveragepy-git-822953106a01aaf1f88bc5e5a63fe693d42c0c00.tar.gz
Prefer assertRaisesRegex to assertRaises
Diffstat (limited to 'tests/test_api.py')
-rw-r--r--tests/test_api.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/test_api.py b/tests/test_api.py
index 22020cb4..e838e6b7 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -263,7 +263,8 @@ class ApiTest(CoverageTest):
# empty summary reports raise exception, just like the xml report
cov = coverage.Coverage()
cov.erase()
- self.assertRaises(CoverageException, cov.report)
+ with self.assertRaisesRegex(CoverageException, "No data to report."):
+ cov.report()
def make_code1_code2(self):
"""Create the code1.py and code2.py files."""