summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2011-05-17 10:06:40 -0400
committerNed Batchelder <ned@nedbatchelder.com>2011-05-17 10:06:40 -0400
commit34413aab8a61579789faa342331ac9c8a55ee5a4 (patch)
tree47850ea0d7622978a1ea2484f1d5955364896076 /test
parent6754971e7ef16e5cee60ae5532de8f6069768ce8 (diff)
downloadpython-coveragepy-git-34413aab8a61579789faa342331ac9c8a55ee5a4.tar.gz
WIP for partial branch exclusion. #113
Diffstat (limited to 'test')
-rw-r--r--test/test_arcs.py10
-rw-r--r--test/test_config.py12
2 files changed, 17 insertions, 5 deletions
diff --git a/test/test_arcs.py b/test/test_arcs.py
index dafe0fbb..a406b3a9 100644
--- a/test/test_arcs.py
+++ b/test/test_arcs.py
@@ -213,15 +213,15 @@ class LoopArcTest(CoverageTest):
i += 1
assert a == 4 and i == 3
""",
- arcz=".1 12 23 34 45 36 63 57 27 7.",
- arcz_missing="27" # while loop never exits naturally.
+ arcz=".1 12 34 45 36 63 57 7.",
+ #arcz_missing="27" # while loop never exits naturally.
)
# With "while True", 2.x thinks it's computation, 3.x thinks it's
# constant.
if sys.version_info >= (3, 0):
- arcz = ".1 12 23 34 45 36 63 57 27 7."
+ arcz = ".1 12 34 45 36 63 57 7."
else:
- arcz = ".1 12 23 34 45 36 62 57 27 7."
+ arcz = ".1 12 34 45 36 62 57 7."
self.check_coverage("""\
a, i = 1, 0
while True:
@@ -232,7 +232,7 @@ class LoopArcTest(CoverageTest):
assert a == 4 and i == 3
""",
arcz=arcz,
- arcz_missing="27" # while loop never exits naturally.
+ #arcz_missing="27" # while loop never exits naturally.
)
def test_for_if_else_for(self):
diff --git a/test/test_config.py b/test/test_config.py
index d5290584..3c4be9b7 100644
--- a/test/test_config.py
+++ b/test/test_config.py
@@ -127,6 +127,12 @@ class ConfigFileTest(CoverageTest):
yet_more
precision = 3
+ partial_branches =
+ pragma:?\\s+no branch
+ partial_branches_always =
+ if 0:
+ while True:
+
[html]
directory = c:\\tricky\\dir.somewhere
@@ -153,6 +159,12 @@ class ConfigFileTest(CoverageTest):
)
self.assertEqual(cov.config.precision, 3)
+ self.assertEqual(cov.config.partial_list,
+ ["pragma:?\s+no branch"]
+ )
+ self.assertEqual(cov.config.partial_always_list,
+ ["if 0:", "while True:"]
+ )
self.assertEqual(cov.config.html_dir, r"c:\tricky\dir.somewhere")
self.assertEqual(cov.config.xml_output, "mycov.xml")