From df88565005f1b27489d797a16183c28b6ba89d05 Mon Sep 17 00:00:00 2001 From: rdobuilder Date: Jan 15 2025 15:15:40 +0000 Subject: Update to 5.0.0 Related-to: https://review.rdoproject.org/r/q/Ic962ae976561cbf628e435bd8862c7a84310b3e3 --- diff --git a/SOURCES/0001-fix-for-failing-tests-with-coverage-5.4.patch b/SOURCES/0001-fix-for-failing-tests-with-coverage-5.4.patch new file mode 100644 index 0000000..239ba15 --- /dev/null +++ b/SOURCES/0001-fix-for-failing-tests-with-coverage-5.4.patch @@ -0,0 +1,43 @@ +From 92ad6f411167dc05bf54beeb5d9ebc916cc0f6f3 Mon Sep 17 00:00:00 2001 +From: chedi +Date: Fri, 29 Jan 2021 18:48:58 +0100 +Subject: [PATCH] fix for failing tests with coverage 5.4 + +--- + 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 3c73050..ff22fef 100644 +--- a/tests/test_pytest_cov.py ++++ b/tests/test_pytest_cov.py +@@ -500,7 +500,7 @@ def test_central_coveragerc(testdir, prop): + ]) + + # single-module coverage report +- assert all(not line.startswith('TOTAL ') for line in result.stdout.lines[-4:]) ++ assert all(not line.startswith('TOTAL ') for line in result.stdout.lines[-3:]) + + assert result.ret == 0 + +@@ -538,7 +538,7 @@ parallel = true + ]) + + # single-module coverage report +- assert all(not line.startswith('TOTAL ') for line in result.stdout.lines[-4:]) ++ assert all(not line.startswith('TOTAL ') for line in result.stdout.lines[-3:]) + + assert result.ret == 0 + +@@ -643,7 +643,7 @@ show_missing = true + ]) + + # single-module coverage report +- assert all(not line.startswith('TOTAL ') for line in result.stdout.lines[-4:]) ++ assert all(not line.startswith('TOTAL ') for line in result.stdout.lines[-3:]) + + assert result.ret == 0 + +-- +2.29.2 + diff --git a/SOURCES/0001_disabling_boxed_xdist_test.patch b/SOURCES/0001_disabling_boxed_xdist_test.patch new file mode 100644 index 0000000..e8903d3 --- /dev/null +++ b/SOURCES/0001_disabling_boxed_xdist_test.patch @@ -0,0 +1,14 @@ +--- a/tests/test_pytest_cov.py 2022-11-11 21:00:59.063033789 +0100 ++++ b/tests/test_pytest_cov.py 2022-11-11 21:22:22.097947660 +0100 +@@ -1554,8 +1554,9 @@ + ''' + + SCRIPT_SIMPLE_RESULT = '4 * 100%' +- +- ++ ++@pytest.mark.skipif('tuple(map(int, xdist.__version__.split("."))) >= (2, 5, 0)', ++ reason="--boxed option was removed in version 2.5.0") + @pytest.mark.skipif('sys.platform == "win32"') + def test_dist_boxed(testdir): + script = testdir.makepyfile(SCRIPT_SIMPLE) diff --git a/SOURCES/32d8c0665ea044f9682a89633d75442d1a4d2dc4.patch b/SOURCES/32d8c0665ea044f9682a89633d75442d1a4d2dc4.patch new file mode 100644 index 0000000..b9c9647 --- /dev/null +++ b/SOURCES/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) + +