~ruther/guix-local

cf5bd827cf74a313a8d56c38b125e25a60632b4f — Sharlatan Hellseher 1 year, 6 months ago c36cc98
gnu: python-pytest: Update to 8.3.3.

* gnu/packages/check.scm (python-pytest): Update to 8.3.3.
[build-system]: Swap to pyproject-build-system.
[arguments]<phases>: Use default 'check phase and remove
'prepend-version phase.
<test-flags>: Disable some tests requiring python-pygments adding which
introduces cycle.
[propagated-inputs]: Remove python-pluggy; add python-exceptiongroup and
python-pluggy-next.
[native-inputs]: Add python-setuptools and python-wheel.

* gnu/packages/check.scm (python-pytest-bootstrap) [native-inputs]: Add
python-setuptools and python-wheel.

* gnu/packages/patches/pytest-fix-unstrable-exception-test.patch: Remove file.
* gnu/local.mk: Deregister patch.

Change-Id: Ie8825ea1f788bbae40aefa467b6a94b8c4210cbc
3 files changed, 34 insertions(+), 72 deletions(-)

M gnu/local.mk
M gnu/packages/check.scm
D gnu/packages/patches/pytest-fix-unstrable-exception-test.patch
M gnu/local.mk => gnu/local.mk +0 -1
@@ 2026,7 2026,6 @@ dist_patch_DATA =						\
  %D%/packages/patches/pybugz-encode-error.patch		\
  %D%/packages/patches/pybugz-stty.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		\

M gnu/packages/check.scm => gnu/packages/check.scm +34 -37
@@ 1539,55 1539,48 @@ standard library.")
(define-public python-pytest
  (package
    (name "python-pytest")
    (version "7.1.3")
    (version "8.3.3")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "pytest" version))
       (sha256
        (base32
         "0f8c31v5r2kgjixvy267n0nhc4xsy65g3n9lz1i1377z5pn5ydjg"))
       (patches (search-patches "pytest-fix-unstrable-exception-test.patch"))))
    (build-system python-build-system)
        (base32 "1081l7yr9z61ghjkrm8qw85ndg2hkb5fc1ibjnkhi0v4pl3q3fbh"))))
    (build-system pyproject-build-system)
    (arguments
     (list
      #:phases
      #~(modify-phases %standard-phases
          (add-before 'build 'pretend-version
            ;; The version string is usually derived via setuptools-scm, but
            ;; without the git metadata available, the version string is set to
            ;; '0.0.0'.
            (lambda _
              (setenv "SETUPTOOLS_SCM_PRETEND_VERSION"
                      #$(package-version this-package))))
          (replace 'check
            (lambda* (#:key tests? #:allow-other-keys)
              (setenv "TERM" "dumb")    ;attempt disabling markup tests
              (if tests?
                  (invoke "pytest" "-vv" "-k"
                          (string-append
                           ;; This test involves the /usr directory, and fails.
                           " not test_argcomplete"
                           ;; These test do not honor the isatty detection and
                           ;; fail.
                           " and not test_code_highlight"
                           " and not test_color_yes"))
                  (format #t "test suite not run~%")))))))
    (propagated-inputs
     (list python-attrs-bootstrap
           python-iniconfig
           python-packaging-bootstrap
           python-pluggy
           python-py
           python-tomli))
      #:test-flags
      ;; Tests requiring Pygment, introduces cycle.
      #~(list "-k" (string-append
                    "not test_code_highlight"
                    " and not test_code_highlight_continuation"
                    " and not test_code_highlight_custom_theme"
                    " and not test_code_highlight_invalid_theme"
                    " and not test_code_highlight_invalid_theme_mode"
                    " and not test_code_highlight_simple"
                    " and not test_color_yes"
                    " and not test_comparisons_handle_colors"
                    " and not test_empty_NO_COLOR_and_FORCE_COLOR_ignored"
                    " and not test_remove_dir_prefix"))))
    (native-inputs
     ;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
     (list bash
           python-hypothesis
           python-nose
           ;; python-pygments ; introduces cycle
           python-pytest-bootstrap
           python-setuptools
           python-setuptools-scm
           python-xmlschema))
           python-xmlschema
           python-wheel))
    (propagated-inputs
     (list python-attrs-bootstrap
           python-iniconfig
           python-packaging-bootstrap
           python-exceptiongroup
           python-pluggy
           python-py
           python-tomli))
    (home-page "https://docs.pytest.org/en/latest/")
    (synopsis "Python testing library")
    (description


@@ 1650,8 1643,12 @@ and many external plugins.")
  (package
    (inherit python-pytest)
    (name "python-pytest-bootstrap")
    (native-inputs (list python-iniconfig python-setuptools-scm
                         python-tomli))
    (native-inputs
     (list python-iniconfig
           python-setuptools
           python-setuptools-scm
           python-tomli
           python-wheel))
    (arguments `(#:tests? #f))))

(define-public python-pytest-assume

D gnu/packages/patches/pytest-fix-unstrable-exception-test.patch => gnu/packages/patches/pytest-fix-unstrable-exception-test.patch +0 -34
@@ 1,34 0,0 @@
From b55e264a675f7621b8351e227b93742f19e01c7d Mon Sep 17 00:00:00 2001
From: Daniel Valenzuela <dsvalenzuela@uc.cl>
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: <exception str() failed>"]
-        )
-    else:
-        result.stdout.fnmatch_lines(
-            ["E       AssertionError: <unprintable AssertionError object>"]
-        )
+    result.stdout.fnmatch_lines(["E       AssertionError: <exception str() failed>"])
 
 
 def test_issue_1944(pytester: Pytester) -> None: