Python 3.9 support (#1788811)

epel9
Miro Hrončok 5 years ago
parent f2cc251b1c
commit 74f5adb515

@ -0,0 +1,39 @@
From 32d8c0665ea044f9682a89633d75442d1a4d2dc4 Mon Sep 17 00:00:00 2001
From: Ned Batchelder <ned@nedbatchelder.com>
Date: Thu, 5 Dec 2019 16:37:48 -0500
Subject: [PATCH] Fix the context tests
CoverageData.lines() returns a list, but in no guaranteed order.
Set-ify everything to get the correct comparison.
---
tests/test_pytest_cov.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/test_pytest_cov.py b/tests/test_pytest_cov.py
index e79e9aa..3be8278 100644
--- a/tests/test_pytest_cov.py
+++ b/tests/test_pytest_cov.py
@@ -1934,12 +1934,12 @@ def test_cov_and_no_cov(testdir):
def find_labels(text, pattern):
- all_labels = collections.defaultdict(list)
+ all_labels = collections.defaultdict(set)
lines = text.splitlines()
for lineno, line in enumerate(lines, start=1):
labels = re.findall(pattern, line)
for label in labels:
- all_labels[label].append(lineno)
+ all_labels[label].add(lineno)
return all_labels
@@ -2007,7 +2007,7 @@ def test_contexts(testdir, opts):
if context == '':
continue
data.set_query_context(context)
- actual = data.lines(test_context_path)
+ actual = set(data.lines(test_context_path))
assert line_data[label] == actual, "Wrong lines for context {!r}".format(context)

@ -16,6 +16,9 @@ License: MIT
URL: https://pypi.python.org/pypi/%{srcname} URL: https://pypi.python.org/pypi/%{srcname}
Source0: https://github.com/pytest-dev/%{srcname}/archive/v%{version}/%{srcname}-%{version}.tar.gz Source0: https://github.com/pytest-dev/%{srcname}/archive/v%{version}/%{srcname}-%{version}.tar.gz
# Python 3.9 support
Patch1: https://github.com/pytest-dev/%{srcname}/commit/32d8c0665ea044f9682a89633d75442d1a4d2dc4.patch
BuildArch: noarch BuildArch: noarch
%description %description
@ -65,7 +68,7 @@ distributed testing, including subprocesses and multiprocessing for Python 3.
%prep %prep
%setup -q -n %{srcname}-%{version} %autosetup -p1 -n %{srcname}-%{version}
rm -rf *.egg-info rm -rf *.egg-info

Loading…
Cancel
Save