summaryrefslogtreecommitdiff
path: root/tests/test_data.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2023-02-12 09:27:25 -0500
committerNed Batchelder <ned@nedbatchelder.com>2023-02-12 11:52:05 -0500
commitf77be1770a9d93ed69d6b5a26dcbe5dbfe14e380 (patch)
tree57ee04342aef1966e9a73563306f5dceb415b6a5 /tests/test_data.py
parent6bc043981f6548852844ea6b16d5ef7d37c0417d (diff)
downloadpython-coveragepy-git-f77be1770a9d93ed69d6b5a26dcbe5dbfe14e380.tar.gz
fix: Path objects are ok for data_file and config_file. #1552
Diffstat (limited to 'tests/test_data.py')
-rw-r--r--tests/test_data.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/test_data.py b/tests/test_data.py
index 1cc64572..ab3f5f5b 100644
--- a/tests/test_data.py
+++ b/tests/test_data.py
@@ -24,7 +24,7 @@ from coverage.data import add_data_to_hash, line_counts
from coverage.debug import DebugControlString
from coverage.exceptions import DataError, NoDataError
from coverage.files import PathAliases, canonical_filename
-from coverage.types import TArc, TLineNo
+from coverage.types import FilePathClasses, FilePathType, TArc, TLineNo
from tests.coveragetest import CoverageTest
from tests.helpers import assert_count_equal
@@ -621,10 +621,13 @@ class CoverageDataTest(CoverageTest):
class CoverageDataInTempDirTest(CoverageTest):
"""Tests of CoverageData that need a temporary directory to make files."""
- def test_read_write_lines(self) -> None:
- covdata1 = DebugCoverageData("lines.dat")
+ @pytest.mark.parametrize("file_class", FilePathClasses)
+ def test_read_write_lines(self, file_class: FilePathType) -> None:
+ self.assert_doesnt_exist("lines.dat")
+ covdata1 = DebugCoverageData(file_class("lines.dat"))
covdata1.add_lines(LINES_1)
covdata1.write()
+ self.assert_exists("lines.dat")
covdata2 = DebugCoverageData("lines.dat")
covdata2.read()