summaryrefslogtreecommitdiff
path: root/tests/test_api.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2018-08-14 20:39:57 -0400
committerNed Batchelder <ned@nedbatchelder.com>2018-08-24 06:54:17 -0400
commit19ec83bde56b6dfecef4ddae275376fdb4262e3a (patch)
treebf586bb0d3517386ede0430b6003ae24e4a2ce08 /tests/test_api.py
parent9b13a1a7d44d991c4c5dd51d5624f5abe84b77f8 (diff)
downloadpython-coveragepy-git-19ec83bde56b6dfecef4ddae275376fdb4262e3a.tar.gz
Be flexible, and accept either json-sourced or sql-source error messages in some tests
Diffstat (limited to 'tests/test_api.py')
-rw-r--r--tests/test_api.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test_api.py b/tests/test_api.py
index 3e7e2f06..854f9cc2 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -371,8 +371,12 @@ class ApiTest(CoverageTest):
self.make_bad_data_file()
cov = coverage.Coverage()
warning_regex = (
+ r"(" # JSON message:
r"Couldn't read data from '.*\.coverage\.foo': "
r"CoverageException: Doesn't seem to be a coverage\.py data file"
+ r"|" # SQL message:
+ r"Couldn't use data file '.*\.coverage\.foo': file is encrypted or is not a database"
+ r")"
)
with self.assert_warnings(cov, [warning_regex]):
cov.combine()