From 60a770964656bd45493417ee72bcdb280a7c0e07 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 31 Dec 2019 16:43:47 -0500 Subject: bpo-39114 will be fixed soon. --- coverage/env.py | 9 +++++---- tests/test_arcs.py | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/coverage/env.py b/coverage/env.py index 175b3092..ab9dbe92 100644 --- a/coverage/env.py +++ b/coverage/env.py @@ -11,8 +11,9 @@ import sys WINDOWS = sys.platform == "win32" LINUX = sys.platform.startswith("linux") -# Python versions. -PYVERSION = sys.version_info +# Python versions. We amend version_info with one more value, a zero if an +# official version, or 1 if built from source beyond an official version. +PYVERSION = sys.version_info + (int(platform.python_version()[-1] == "+"),) PY2 = PYVERSION < (3, 0) PY3 = PYVERSION >= (3, 0) @@ -84,9 +85,9 @@ class PYBEHAVIOR(object): # Python 3.9a1 made sys.argv[0] and other reported files absolute paths. report_absolute_files = (PYVERSION >= (3, 9)) - # Python 3.9a2 changed how return/finally was traced, but it could be + # Python 3.9a2 changed how return/finally was traced, but it was # temporary. - bug39114 = (PYVERSION >= (3, 9, 0, 'alpha', 2)) + bug39114 = (PYVERSION == (3, 9, 0, 'alpha', 2, 0)) # Coverage.py specifics. diff --git a/tests/test_arcs.py b/tests/test_arcs.py index 5ba2908f..19aaeb2c 100644 --- a/tests/test_arcs.py +++ b/tests/test_arcs.py @@ -1523,8 +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") + if env.PYVERSION >= (3, 9, 0, 'alpha', 2): + self.xfail("https://bugs.python.org/issue39166") self.check_coverage("""\ import asyncio -- cgit v1.2.1