From df6848565aef4371f9ac4749145a59f9a41a76f3 Mon Sep 17 00:00:00 2001 From: Josselin Poiret Date: Sat, 15 Apr 2023 16:08:18 +0200 Subject: gnu: python-pytest: Fix failing test_raising_repr. * gnu/packages/patches/pytest-fix-unstrable-exception-test.patch: Add new patch from upstream. * gnu/packages/check.scm (python-pytest): Use it. * gnu/local.mk (dist_patch_DATA): Register it. Signed-off-by: Andreas Enge --- gnu/local.mk | 1 + gnu/packages/check.scm | 3 +- .../pytest-fix-unstrable-exception-test.patch | 34 ++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/pytest-fix-unstrable-exception-test.patch (limited to 'gnu') diff --git a/gnu/local.mk b/gnu/local.mk index e29e09b688..73756a8c49 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1730,6 +1730,7 @@ dist_patch_DATA = \ %D%/packages/patches/pybugz-stty.patch \ %D%/packages/patches/pygpgme-disable-problematic-tests.patch \ %D%/packages/patches/pyqt-configure.patch \ + %D%/packages/patches/pytest-fix-unstrable-exception-test.patch \ %D%/packages/patches/python-2-deterministic-build-info.patch \ %D%/packages/patches/python-2.7-adjust-tests.patch \ %D%/packages/patches/python-2.7-expat-compat.patch \ diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index 14e8607154..cb38ea8538 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -1268,7 +1268,8 @@ standard library.") (uri (pypi-uri "pytest" version)) (sha256 (base32 - "0f8c31v5r2kgjixvy267n0nhc4xsy65g3n9lz1i1377z5pn5ydjg")))) + "0f8c31v5r2kgjixvy267n0nhc4xsy65g3n9lz1i1377z5pn5ydjg")) + (patches (search-patches "pytest-fix-unstrable-exception-test.patch")))) (build-system python-build-system) (arguments (list diff --git a/gnu/packages/patches/pytest-fix-unstrable-exception-test.patch b/gnu/packages/patches/pytest-fix-unstrable-exception-test.patch new file mode 100644 index 0000000000..4d77786b77 --- /dev/null +++ b/gnu/packages/patches/pytest-fix-unstrable-exception-test.patch @@ -0,0 +1,34 @@ +From b55e264a675f7621b8351e227b93742f19e01c7d Mon Sep 17 00:00:00 2001 +From: Daniel Valenzuela +Date: Wed, 9 Nov 2022 19:43:10 -0300 +Subject: [PATCH] Fix test_raising_repr test + +Closes #10473 + +Python <3.11 versions depend on `exceptiongroup>=1.0.0rc8`, and they released version `1.0.1` +6 days ago (2022/11/03) that as a side-effect changed the output of exceptions. +--- + testing/test_assertion.py | 10 +--------- + 1 file changed, 1 insertion(+), 9 deletions(-) + +diff --git a/testing/test_assertion.py b/testing/test_assertion.py +index d8844f2e41..7574592210 100644 +--- a/testing/test_assertion.py ++++ b/testing/test_assertion.py +@@ -1664,15 +1664,7 @@ def test_raising_repr(): + """ + ) + result = pytester.runpytest() +- if sys.version_info >= (3, 11): +- # python 3.11 has native support for un-str-able exceptions +- result.stdout.fnmatch_lines( +- ["E AssertionError: "] +- ) +- else: +- result.stdout.fnmatch_lines( +- ["E AssertionError: "] +- ) ++ result.stdout.fnmatch_lines(["E AssertionError: "]) + + + def test_issue_1944(pytester: Pytester) -> None: -- cgit v1.2.3