summaryrefslogtreecommitdiff
path: root/tests/test_data.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2022-08-06 15:02:51 -0400
committerNed Batchelder <ned@nedbatchelder.com>2022-08-06 15:02:51 -0400
commiteaf55921248211a81be231d7d20d73460cb369fb (patch)
tree812a91977e3f0341245a49b4b2dbbfb6d6a3b513 /tests/test_data.py
parent36f508f98f74b44a1f7aed23f2beecb4189025ca (diff)
downloadpython-coveragepy-git-eaf55921248211a81be231d7d20d73460cb369fb.tar.gz
test: add a test for #1405
Diffstat (limited to 'tests/test_data.py')
-rw-r--r--tests/test_data.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test_data.py b/tests/test_data.py
index 3cb519ca..8f05ada0 100644
--- a/tests/test_data.py
+++ b/tests/test_data.py
@@ -878,6 +878,33 @@ class CoverageDataFilesTest(CoverageTest):
# "no such table: meta"
covdata2.add_lines(LINES_1)
+ @pytest.mark.parametrize(
+ "dpart, fpart",
+ [
+ ("", "[b-a]"),
+ ("[3-1]", ""),
+ ("[3-1]", "[b-a]"),
+ ],
+ )
+ def test_combining_with_crazy_filename(self, dpart, fpart):
+ dirname = f"py{dpart}"
+ basename = f"{dirname}/.coverage{fpart}"
+ os.makedirs(dirname)
+
+ covdata1 = CoverageData(basename=basename, suffix="1")
+ covdata1.add_lines(LINES_1)
+ covdata1.write()
+
+ covdata2 = CoverageData(basename=basename, suffix="2")
+ covdata2.add_lines(LINES_2)
+ covdata2.write()
+
+ covdata3 = CoverageData(basename=basename)
+ combine_parallel_data(covdata3)
+ assert_line_counts(covdata3, SUMMARY_1_2)
+ assert_measured_files(covdata3, MEASURED_FILES_1_2)
+ self.assert_file_count(glob.escape(basename) + ".*", 0)
+
class DumpsLoadsTest(CoverageTest):
"""Tests of CoverageData.dumps and loads."""