summaryrefslogtreecommitdiff
path: root/tests/test_data.py
diff options
context:
space:
mode:
authorStephan Richter <stephan.richter@gmail.com>2019-01-27 16:34:59 -0500
committerNed Batchelder <ned@nedbatchelder.com>2019-02-17 18:07:24 -0500
commit3e4188695fc0f5934933889b1707c17299936ac8 (patch)
tree001f9454c06b21b8b9d7801603c2d9a7561142d7 /tests/test_data.py
parentf12db7fd4b3ab288f7f770f7138062951feaa6c9 (diff)
downloadpython-coveragepy-git-3e4188695fc0f5934933889b1707c17299936ac8.tar.gz
Make sure that arcs() and lines() only returns distinct line combination values and not one entry for each context.
Diffstat (limited to 'tests/test_data.py')
-rw-r--r--tests/test_data.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_data.py b/tests/test_data.py
index bda73810..3f96288f 100644
--- a/tests/test_data.py
+++ b/tests/test_data.py
@@ -199,6 +199,22 @@ class CoverageDataTest(DataTestHelpers, CoverageTest):
covdata.add_run_info(count=17)
self.assertEqual(covdata.run_infos(), [{"hello": "there", "count": 17}])
+ def test_no_duplicate_lines(self):
+ covdata = CoverageData()
+ covdata.set_context("context1")
+ covdata.add_lines(LINES_1)
+ covdata.set_context("context2")
+ covdata.add_lines(LINES_1)
+ self.assertEqual(covdata.lines('a.py'), A_PY_LINES_1)
+
+ def test_no_duplicate_arcs(self):
+ covdata = CoverageData()
+ covdata.set_context("context1")
+ covdata.add_arcs(ARCS_3)
+ covdata.set_context("context2")
+ covdata.add_arcs(ARCS_3)
+ self.assertEqual(covdata.arcs('x.py'), X_PY_ARCS_3)
+
def test_no_arcs_vs_unmeasured_file(self):
covdata = CoverageData()
covdata.add_arcs(ARCS_3)