summaryrefslogtreecommitdiff
path: root/tests/test_arcs.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-12-24 15:21:25 -0500
committerNed Batchelder <ned@nedbatchelder.com>2016-12-24 15:21:25 -0500
commitfd9b1e460826789468e4a8b0986aad074615587b (patch)
tree457f94a92e093c6c6d1f37f5fc5c371c109a1d81 /tests/test_arcs.py
parent5d4f399607fd711a1fb11d7c011f4466c6f50603 (diff)
downloadpython-coveragepy-git-fd9b1e460826789468e4a8b0986aad074615587b.tar.gz
Move the test program into the test
Diffstat (limited to 'tests/test_arcs.py')
-rw-r--r--tests/test_arcs.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/test_arcs.py b/tests/test_arcs.py
index 50751826..22323bcd 100644
--- a/tests/test_arcs.py
+++ b/tests/test_arcs.py
@@ -252,7 +252,7 @@ class LoopArcTest(CoverageTest):
""",
arcz=".1 12 23 34 45 36 63 57 7.",
)
- # With "while True", 2.x thinks it's computation,
+ # With "while True", 2.x thinks it's computation,
# 2.7+ and 3.x thinks it's constant.
if env.PY3:
arcz = ".1 12 23 34 45 36 63 57 7."
@@ -273,17 +273,20 @@ class LoopArcTest(CoverageTest):
)
def test_zero_coverage_and_regexps(self):
- # https://bitbucket.org/ned/coveragepy/issue/502
+ # https://bitbucket.org/ned/coveragepy/issue/502
if env.PYVERSION < (2, 7):
self.skipTest("No node.id before 2.7")
- self.clean_local_file_imports()
- zerocoverage_path = self.nice_file(self.here(), 'tests/modules/zerocoverage')
- out = self.run_command(
- "coverage run --branch --source {0} -m zerocoverage".format(zerocoverage_path))
+ self.make_file("main.py", "print('done')")
+ self.make_file("zero.py", """\
+ def method(self):
+ while True:
+ return 1
+ """)
+ out = self.run_command("coverage run --branch --source=. main.py")
self.assertEqual(out, 'done\n')
report = self.report_from_command("coverage report -m")
squeezed = self.squeezed_lines(report)
- self.assertIn("zero.py 3 3 0 0 0% 1-3", squeezed[4])
+ self.assertIn("zero.py 3 3 0 0 0% 1-3", squeezed[3])
def test_bug_496_continue_in_constant_while(self):
# https://bitbucket.org/ned/coveragepy/issue/496