diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-02-07 10:53:13 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-02-07 10:53:13 -0500 |
commit | 7d95e303613cfbbc9067f4813c641c61aa251dc8 (patch) | |
tree | 7e2154fb47a6f0529f8edbe1a63d0ecee157778e /tests/test_arcs.py | |
parent | 488981cbf86c58ec4aadcfe6b151eb50b7bf7fdf (diff) | |
download | python-coveragepy-git-7d95e303613cfbbc9067f4813c641c61aa251dc8.tar.gz |
Fully embrace SkipTest with our own method.
Also, no test is conditionally defined. They call self.skip if they
should be skippped.
Diffstat (limited to 'tests/test_arcs.py')
-rw-r--r-- | tests/test_arcs.py | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/tests/test_arcs.py b/tests/test_arcs.py index 92dac5de..d3717a88 100644 --- a/tests/test_arcs.py +++ b/tests/test_arcs.py @@ -503,29 +503,30 @@ class ExceptionArcTest(CoverageTest): arcz=".1 12 23 35 56 61 17 7.", arcz_missing="", arcz_unpredicted="") - # Run this test only on Py2 for now. I hope to fix it on Py3 - # eventually... - if env.PY2: - # "except Exception as e" is crucial here. - def test_bug_212(self): - self.check_coverage("""\ - def b(exc): - try: - while 1: - raise Exception(exc) # 4 - except Exception as e: - if exc != 'expected': - raise - q = 8 - - b('expected') + # "except Exception as e" is crucial here. + def test_bug_212(self): + # Run this test only on Py2 for now. I hope to fix it on Py3 + # eventually... + if env.PY3: + self.skip("This doesn't work on Python 3") + self.check_coverage("""\ + def b(exc): try: - b('unexpected') # C - except: - pass - """, - arcz=".1 .2 1A 23 34 56 67 68 8. AB BC C. DE E.", - arcz_missing="C.", arcz_unpredicted="45 7. CD") + while 1: + raise Exception(exc) # 4 + except Exception as e: + if exc != 'expected': + raise + q = 8 + + b('expected') + try: + b('unexpected') # C + except: + pass + """, + arcz=".1 .2 1A 23 34 56 67 68 8. AB BC C. DE E.", + arcz_missing="C.", arcz_unpredicted="45 7. CD") def test_except_finally(self): self.check_coverage("""\ |