Skip to content

Commit 28c29a7

Browse files
committed
bpo 39114 broke 3.9, but maybe it's their bug
1 parent 31f7280 commit 28c29a7

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

appveyor.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ environment:
9090
- JOB: "3.9 32-bit"
9191
TOXENV: "py39"
9292
PYTHON: "C:\\Python39"
93-
PYTHON_VERSION: "3.9.0a1"
93+
PYTHON_VERSION: "3.9.0a2"
9494
PYTHON_ARCH: "32"
9595
COVERAGE_NO_PYTRACER: "1"
9696

9797
- JOB: "3.9 64-bit"
9898
TOXENV: "py39"
9999
PYTHON: "C:\\Python39-x64"
100-
PYTHON_VERSION: "3.9.0a1"
100+
PYTHON_VERSION: "3.9.0a2"
101101
PYTHON_ARCH: "64"
102102

103103
# Meta coverage

coverage/env.py

+4
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ class PYBEHAVIOR(object):
8181
# Python 3.9a1 made sys.argv[0] and other reported files absolute paths.
8282
report_absolute_files = (PYVERSION >= (3, 9))
8383

84+
# Python 3.9a2 changed how return/finally was traced, but it could be
85+
# temporary.
86+
bug39114 = (PYVERSION >= (3, 9, 0, 'alpha', 2))
87+
8488
# Coverage.py specifics.
8589

8690
# Are we using the C-implemented trace function?

tests/coveragetest.py

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import sys
1616
import types
1717

18+
import pytest
1819
from unittest_mixins import (
1920
EnvironmentAwareMixin, StdStreamCapturingMixin, TempDirMixin,
2021
DelayedAssertionMixin,
@@ -99,6 +100,10 @@ def setUp(self):
99100
self.last_command_output = None
100101
self.last_module_name = None
101102

103+
def xfail(self, msg):
104+
"""Mark this test as an expected failure."""
105+
pytest.xfail(msg)
106+
102107
def clean_local_file_imports(self):
103108
"""Clean up the results of calls to `import_local_file`.
104109

tests/test_arcs.py

+14
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,8 @@ def test_finally_in_loop(self):
630630

631631

632632
def test_break_through_finally(self):
633+
if env.PYBEHAVIOR.bug39114:
634+
self.xfail("https://bugs.python.org/issue39114")
633635
if env.PYBEHAVIOR.finally_jumps_back:
634636
arcz = ".1 12 23 34 3D 45 56 67 68 7A 7D 8A A3 A7 BC CD D."
635637
else:
@@ -654,6 +656,8 @@ def test_break_through_finally(self):
654656
)
655657

656658
def test_continue_through_finally(self):
659+
if env.PYBEHAVIOR.bug39114:
660+
self.xfail("https://bugs.python.org/issue39114")
657661
if env.PYBEHAVIOR.finally_jumps_back:
658662
arcz = ".1 12 23 34 3D 45 56 67 68 73 7A 8A A3 A7 BC CD D."
659663
else:
@@ -691,6 +695,8 @@ def test_finally_in_loop_bug_92(self):
691695
)
692696

693697
def test_bug_212(self):
698+
if env.PYBEHAVIOR.bug39114:
699+
self.xfail("https://bugs.python.org/issue39114")
694700
# "except Exception as e" is crucial here.
695701
# Bug 212 said that the "if exc" line was incorrectly marked as only
696702
# partially covered.
@@ -813,6 +819,8 @@ def test_multiple_except_clauses(self):
813819
)
814820

815821
def test_return_finally(self):
822+
if env.PYBEHAVIOR.bug39114:
823+
self.xfail("https://bugs.python.org/issue39114")
816824
if env.PYBEHAVIOR.finally_jumps_back:
817825
arcz = ".1 12 29 9A AB BC C-1 -23 34 45 5-2 57 75 38 8-2"
818826
else:
@@ -835,6 +843,8 @@ def check_token(data):
835843
)
836844

837845
def test_except_jump_finally(self):
846+
if env.PYBEHAVIOR.bug39114:
847+
self.xfail("https://bugs.python.org/issue39114")
838848
if env.PYBEHAVIOR.finally_jumps_back:
839849
arcz = (
840850
".1 1Q QR RS ST TU U. "
@@ -889,6 +899,8 @@ def func(x):
889899
)
890900

891901
def test_else_jump_finally(self):
902+
if env.PYBEHAVIOR.bug39114:
903+
self.xfail("https://bugs.python.org/issue39114")
892904
if env.PYBEHAVIOR.finally_jumps_back:
893905
arcz = (
894906
".1 1S ST TU UV VW W. "
@@ -1511,6 +1523,8 @@ async def print_sum(x, y): # 8
15111523
self.assertEqual(self.stdout(), "Compute 1 + 2 ...\n1 + 2 = 3\n")
15121524

15131525
def test_async_for(self):
1526+
if env.PYBEHAVIOR.bug39114:
1527+
self.xfail("https://bugs.python.org/issue39114")
15141528
self.check_coverage("""\
15151529
import asyncio
15161530

0 commit comments

Comments
 (0)