diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2019-04-21 18:17:27 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2019-04-21 18:17:27 -0400 |
commit | 822953106a01aaf1f88bc5e5a63fe693d42c0c00 (patch) | |
tree | b5a93ae8239dd6ee18748ef98ca1f46a90245f0d /tests/test_api.py | |
parent | 4c86353020bea6dfd3f13780501f2083a0bcaeb7 (diff) | |
download | python-coveragepy-git-822953106a01aaf1f88bc5e5a63fe693d42c0c00.tar.gz |
Prefer assertRaisesRegex to assertRaises
Diffstat (limited to 'tests/test_api.py')
-rw-r--r-- | tests/test_api.py | 3 |
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.""" |