diff --git a/32d8c0665ea044f9682a89633d75442d1a4d2dc4.patch b/32d8c0665ea044f9682a89633d75442d1a4d2dc4.patch new file mode 100644 index 0000000..b9c9647 --- /dev/null +++ b/32d8c0665ea044f9682a89633d75442d1a4d2dc4.patch @@ -0,0 +1,39 @@ +From 32d8c0665ea044f9682a89633d75442d1a4d2dc4 Mon Sep 17 00:00:00 2001 +From: Ned Batchelder +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) + + diff --git a/python-pytest-cov.spec b/python-pytest-cov.spec index 81ded1a..8232235 100644 --- a/python-pytest-cov.spec +++ b/python-pytest-cov.spec @@ -16,6 +16,9 @@ License: MIT URL: https://pypi.python.org/pypi/%{srcname} 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 %description @@ -65,7 +68,7 @@ distributed testing, including subprocesses and multiprocessing for Python 3. %prep -%setup -q -n %{srcname}-%{version} +%autosetup -p1 -n %{srcname}-%{version} rm -rf *.egg-info