summaryrefslogtreecommitdiff
path: root/test/test_arcs.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-10-28 09:43:53 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-10-28 09:43:53 -0400
commite02951be61af55a33e1630b1c955ee89b942ed99 (patch)
tree7998f14d35c8524cca2177ac59cf7bfb128825f9 /test/test_arcs.py
parent208b9cac60c9d272386e732da9d953b94faec456 (diff)
downloadpython-coveragepy-e02951be61af55a33e1630b1c955ee89b942ed99.tar.gz
Shift some tests around.
Diffstat (limited to 'test/test_arcs.py')
-rw-r--r--test/test_arcs.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/test/test_arcs.py b/test/test_arcs.py
index aafbb1d..0aa9a16 100644
--- a/test/test_arcs.py
+++ b/test/test_arcs.py
@@ -100,6 +100,19 @@ class SimpleArcTest(CoverageTest):
""",
arcz=".1 15 5.", arcz_missing="")
+ def test_if_return(self):
+ self.check_coverage("""\
+ def if_ret(a):
+ if a:
+ return 3
+ b = 4
+ return 5
+ x = if_ret(0) + if_ret(1)
+ assert x == 8
+ """,
+ arcz=".1 16 67 7. .2 23 24 3. 45 5.", arcz_missing=""
+ )
+
class LoopArcTest(CoverageTest):
"""Arc-measuring tests involving loops."""
@@ -299,6 +312,7 @@ class ExceptionArcTest(CoverageTest):
arcz_missing="3D AB BC CD", arcz_unpredicted="")
if sys.hexversion >= 0x02050000:
+ # Try-except-finally was new in 2.5
def test_except_finally(self):
self.check_coverage("""\
a, b, c = 1, 1, 1
@@ -327,17 +341,3 @@ class ExceptionArcTest(CoverageTest):
""",
arcz=".1 12 .3 3. 24 45 56 67 7B 89 9B BC C.",
arcz_missing="67 7B", arcz_unpredicted="68")
-
- def test_if_return(self):
- self.check_coverage("""\
- def if_ret(a):
- if a:
- return 3
- b = 4
- return 5
- x = if_ret(0) + if_ret(1)
- assert x == 8
- """,
- arcz=".1 16 67 7. .2 23 24 3. 45 5.",
- arcz_missing=""
- ) \ No newline at end of file