Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit eaf5592

Browse files
committedAug 6, 2022
test: add a test for #1405
1 parent 36f508f commit eaf5592

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed
 

‎CHANGES.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ development at the same time, such as 4.5.x and 5.0.
2020
Unreleased
2121
----------
2222

23+
- Fix a failure when combining data files due to file names containing
24+
glob-like patterns (`pull 1405`_). Thanks, Michael Krebs and Benjamin
25+
Schubert.
26+
2327
- Fix a messaging failure when combining Windows data files on a different
2428
drive than the current directory. (`pull 1430`_, fixing `issue 1428`_).
2529
Thanks, Lorenzo Micò.
@@ -32,6 +36,7 @@ Unreleased
3236

3337
.. _issue 972: https://github.com/nedbat/coveragepy/issues/972
3438
.. _pull 1347: https://github.com/nedbat/coveragepy/pull/1347
39+
.. _pull 1405: https://github.com/nedbat/coveragepy/issues/1405
3540
.. _pull 1413: https://github.com/nedbat/coveragepy/issues/1413
3641
.. _pull 1428: https://github.com/nedbat/coveragepy/issues/1428
3742
.. _pull 1430: https://github.com/nedbat/coveragepy/pull/1430

‎CONTRIBUTORS.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Artem Dayneko
2323
Arthur Deygin
2424
Ben Carlsson
2525
Ben Finney
26+
Benjamin Schubert
2627
Bernát Gábor
2728
Bill Hart
2829
Bradley Burns
@@ -111,6 +112,7 @@ Matthew Boehm
111112
Matthew Desmarais
112113
Matus Valo
113114
Max Linke
115+
Michael Krebs
114116
Michał Bultrowicz
115117
Mickie Betz
116118
Mike Fiedler

‎tests/test_data.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,33 @@ def test_interleaved_erasing_bug716(self):
878878
# "no such table: meta"
879879
covdata2.add_lines(LINES_1)
880880

881+
@pytest.mark.parametrize(
882+
"dpart, fpart",
883+
[
884+
("", "[b-a]"),
885+
("[3-1]", ""),
886+
("[3-1]", "[b-a]"),
887+
],
888+
)
889+
def test_combining_with_crazy_filename(self, dpart, fpart):
890+
dirname = f"py{dpart}"
891+
basename = f"{dirname}/.coverage{fpart}"
892+
os.makedirs(dirname)
893+
894+
covdata1 = CoverageData(basename=basename, suffix="1")
895+
covdata1.add_lines(LINES_1)
896+
covdata1.write()
897+
898+
covdata2 = CoverageData(basename=basename, suffix="2")
899+
covdata2.add_lines(LINES_2)
900+
covdata2.write()
901+
902+
covdata3 = CoverageData(basename=basename)
903+
combine_parallel_data(covdata3)
904+
assert_line_counts(covdata3, SUMMARY_1_2)
905+
assert_measured_files(covdata3, MEASURED_FILES_1_2)
906+
self.assert_file_count(glob.escape(basename) + ".*", 0)
907+
881908

882909
class DumpsLoadsTest(CoverageTest):
883910
"""Tests of CoverageData.dumps and loads."""

0 commit comments

Comments
 (0)
Please sign in to comment.