diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/coveragetest.py | 5 | ||||
-rw-r--r-- | tests/test_arcs.py | 14 |
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/coveragetest.py b/tests/coveragetest.py index 1a2983e6..17b3f15d 100644 --- a/tests/coveragetest.py +++ b/tests/coveragetest.py @@ -15,6 +15,7 @@ import shlex import sys import types +import pytest from unittest_mixins import ( EnvironmentAwareMixin, StdStreamCapturingMixin, TempDirMixin, DelayedAssertionMixin, @@ -99,6 +100,10 @@ class CoverageTest( self.last_command_output = None self.last_module_name = None + def xfail(self, msg): + """Mark this test as an expected failure.""" + pytest.xfail(msg) + def clean_local_file_imports(self): """Clean up the results of calls to `import_local_file`. diff --git a/tests/test_arcs.py b/tests/test_arcs.py index bf17f712..5ba2908f 100644 --- a/tests/test_arcs.py +++ b/tests/test_arcs.py @@ -630,6 +630,8 @@ class ExceptionArcTest(CoverageTest): def test_break_through_finally(self): + if env.PYBEHAVIOR.bug39114: + self.xfail("https://bugs.python.org/issue39114") if env.PYBEHAVIOR.finally_jumps_back: arcz = ".1 12 23 34 3D 45 56 67 68 7A 7D 8A A3 A7 BC CD D." else: @@ -654,6 +656,8 @@ class ExceptionArcTest(CoverageTest): ) def test_continue_through_finally(self): + if env.PYBEHAVIOR.bug39114: + self.xfail("https://bugs.python.org/issue39114") if env.PYBEHAVIOR.finally_jumps_back: arcz = ".1 12 23 34 3D 45 56 67 68 73 7A 8A A3 A7 BC CD D." else: @@ -691,6 +695,8 @@ class ExceptionArcTest(CoverageTest): ) def test_bug_212(self): + if env.PYBEHAVIOR.bug39114: + self.xfail("https://bugs.python.org/issue39114") # "except Exception as e" is crucial here. # Bug 212 said that the "if exc" line was incorrectly marked as only # partially covered. @@ -813,6 +819,8 @@ class ExceptionArcTest(CoverageTest): ) def test_return_finally(self): + if env.PYBEHAVIOR.bug39114: + self.xfail("https://bugs.python.org/issue39114") if env.PYBEHAVIOR.finally_jumps_back: arcz = ".1 12 29 9A AB BC C-1 -23 34 45 5-2 57 75 38 8-2" else: @@ -835,6 +843,8 @@ class ExceptionArcTest(CoverageTest): ) def test_except_jump_finally(self): + if env.PYBEHAVIOR.bug39114: + self.xfail("https://bugs.python.org/issue39114") if env.PYBEHAVIOR.finally_jumps_back: arcz = ( ".1 1Q QR RS ST TU U. " @@ -889,6 +899,8 @@ class ExceptionArcTest(CoverageTest): ) def test_else_jump_finally(self): + if env.PYBEHAVIOR.bug39114: + self.xfail("https://bugs.python.org/issue39114") if env.PYBEHAVIOR.finally_jumps_back: arcz = ( ".1 1S ST TU UV VW W. " @@ -1511,6 +1523,8 @@ class AsyncTest(CoverageTest): self.assertEqual(self.stdout(), "Compute 1 + 2 ...\n1 + 2 = 3\n") def test_async_for(self): + if env.PYBEHAVIOR.bug39114: + self.xfail("https://bugs.python.org/issue39114") self.check_coverage("""\ import asyncio |