diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2021-10-10 12:52:10 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-10-10 12:52:10 -0400 |
commit | 982eca893a895db262ae56650bd05d9f7ab6a076 (patch) | |
tree | dd1fd4de239dc3c55c18d18328ce53da483fe7ee /tests/test_data.py | |
parent | 4144f9595595f0aff458c3da5c70ff6fe8de570e (diff) | |
download | python-coveragepy-git-nedbat/sqldata-edge-tests.tar.gz |
fix: raise CoverageException for SQLite connection errorsnedbat/sqldata-edge-tests
Diffstat (limited to 'tests/test_data.py')
-rw-r--r-- | tests/test_data.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_data.py b/tests/test_data.py index 0660591f..735a12b3 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -598,6 +598,14 @@ class CoverageDataInTempDirTest(CoverageTest): covdata.read() assert not covdata + def test_hard_read_error(self): + self.make_file("noperms.dat", "go away") + os.chmod("noperms.dat", 0) + msg = r"Couldn't .* '.*[/\\]{}': \S+" + with pytest.raises(CoverageException, match=msg.format("noperms.dat")): + covdata = DebugCoverageData("noperms.dat") + covdata.read() + def test_read_sql_errors(self): with sqlite3.connect("wrong_schema.db") as con: con.execute("create table coverage_schema (version integer)") |