diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2011-08-11 08:31:29 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2011-08-11 08:31:29 -0400 |
commit | f8c5d6f541eac387184c7d3ec830792551fb505f (patch) | |
tree | c85a0ecda4d9bd728498a76b191f8a000ba80cb9 | |
parent | 6cf3031f594788bb0a2f3d07f8ea01519132be75 (diff) | |
download | python-coveragepy-f8c5d6f541eac387184c7d3ec830792551fb505f.tar.gz |
Oh, can't test 'with' in Pythons that don't have it.
-rw-r--r-- | test/test_arcs.py | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/test/test_arcs.py b/test/test_arcs.py index 050961f..937c2e7 100644 --- a/test/test_arcs.py +++ b/test/test_arcs.py @@ -143,20 +143,21 @@ class SimpleArcTest(CoverageTest): ) -class WithTest(CoverageTest): - """Arc-measuring tests involving context managers.""" +if sys.version_info >= (2, 6): + class WithTest(CoverageTest): + """Arc-measuring tests involving context managers.""" - def test_with(self): - self.check_coverage("""\ - def example(): - with open("test", "w") as f: # exit - f.write("") - return 1 - - example() - """, - arcz=".1 .2 23 34 4. 16 6." - ) + def test_with(self): + self.check_coverage("""\ + def example(): + with open("test", "w") as f: # exit + f.write("") + return 1 + + example() + """, + arcz=".1 .2 23 34 4. 16 6." + ) class LoopArcTest(CoverageTest): |