guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 199ef8d1780fe6a553dd98a942cbb61c36ba37ae
Author: Sharlatan Hellseher <[email protected]>
AuthorDate: Sun Oct 12 23:00:44 2025 +0100

    gnu: zulip-term: Fix tests.
    
    * gnu/packages/messaging.scm (zulip-term)[arguments] <test-flags>:
    Rework the list of skipped tests enabling more to run.
    <phases>: Remove 'relax-requirements; add 'fix-pytest-config.
    [inputs]: Remove python-urwid; add python-urwid-for-zulip-term.
    [native-inputs]: Remove python-pytest-cov.
    
    * gnu/packages/python-xyz.scm (python-urwid-for-zulip-term): New
    variable.
    
    Change-Id: Iaea56d41c7f09cad546bed421841bfa40d3190d9
---
 gnu/packages/messaging.scm  | 32 +++++++++++++++++++++-----------
 gnu/packages/python-xyz.scm | 16 ++++++++++++++++
 2 files changed, 37 insertions(+), 11 deletions(-)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 63e3b170b7..e3de2c4b10 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -3269,7 +3269,6 @@ designed for experienced users.")
     (version "0.7.0")
     (source
      (origin
-       ;; Pypi package doesn't ship tests.
        (method git-fetch)
        (uri (git-reference
               (url "https://github.com/zulip/zulip-terminal";)
@@ -3280,18 +3279,30 @@ designed for experienced users.")
     (build-system pyproject-build-system)
     (arguments
      (list
-      ;; tests: 2357 passed, 3 skipped, 1 deselected, 19 xfailed, 2162
+      ;; tests: 2411 passed, 3 skipped, 7 deselected, 19 xfailed, 77 warnings
       #:test-flags
-      ;; All CLI tests fail
-      #~(list "--ignore=tests/cli/test_run.py"
-              ;; IndexError: list index out of range
-              "-k" "not 
test_keypress_CYCLE_COMPOSE_FOCUS[tab-edit_box-message_to_stream_name_box]")
+      #~(list "-k" (string-join
+                    ;; 3 tests fail with pytest passing option in decorator
+                    (list "not test_main_multiple_autohide_options[options0]"
+                          "test_main_multiple_autohide_options[options1]"
+                          "test_main_multiple_notify_options[options0]"
+                          "test_main_multiple_notify_options[options1]"
+                          ;; Some differences in TUI which cause assertion to
+                          ;; fail.
+                          "test_soup2markup[link_api]"
+                          "test_soup2markup[link_userupload]"
+                          "test_soup2markup[preview-twitter]")
+                    " and not "))
       #:phases
       #~(modify-phases %standard-phases
-          (add-after 'unpack 'relax-requirements
+          (add-after 'unpack 'fix-pytest-config
             (lambda _
-              (substitute* "setup.py"
-                (("urwid~=2.1.2") "urwid")))))))
+              (substitute* "setup.cfg"
+                ((".*-cov.*") "")
+                ((".rxXs") ""))
+              (substitute* "tests/cli/test_run.py"
+                (("lines = lines.split\\(\"pytest: \", 1\\)\\[1\\]")
+                 "lines = lines.split('__main__.py: ', 1)[1]")))))))
     (inputs
      (list python-beautifulsoup4
            python-lxml
@@ -3301,12 +3312,11 @@ designed for experienced users.")
            python-pytz
            python-typing-extensions
            python-tzlocal
-           python-urwid
+           python-urwid-for-zulip-term
            python-urwid-readline
            python-zulip))
     (native-inputs
      (list python-pytest
-           python-pytest-cov
            python-pytest-mock
            python-setuptools))
     (home-page "https://github.com/zulip/zulip-terminal";)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index ec1ab5cede..9d17420482 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -15247,6 +15247,22 @@ adherence to RFC 6570, but adds a few extensions.")
 features useful for text console applications.")
     (license license:lgpl2.1+)))
 
+(define-public python-urwid-for-zulip-term
+  ;; [email protected] requires exact 2.1.2 version otherewise some tests fail
+  ;; to pass, remove when no longer required.
+  (hidden-package
+   (package
+     (inherit python-urwid)
+     (version "2.1.2")
+     (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "urwid" version))
+        (sha256
+         (base32 "1bky2bra6673xx8jy0826znw6cmxs89wcwwzda8d025j3jffx2sq"))))
+     (arguments
+      (list #:tests? #f)))))
+
 (define-public python-urwid-3
   (package
     (inherit python-urwid)

Reply via email to