guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: gnu: python-sphinx-prompt: Fix tests.


From: guix-commits
Subject: branch master updated: gnu: python-sphinx-prompt: Fix tests.
Date: Sat, 02 Dec 2023 02:09:36 -0500

This is an automated email from the git hooks/post-receive script.

lbraun pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 877086a864 gnu: python-sphinx-prompt: Fix tests.
877086a864 is described below

commit 877086a8649a86f1556bddd430e9478b2562f365
Author: Lars-Dominik Braun <lars@6xq.net>
AuthorDate: Sat Dec 2 07:57:18 2023 +0100

    gnu: python-sphinx-prompt: Fix tests.
    
    docutils>=0.19 broke the tests, which upstream fixed in a newer
    commit. Cherry-pick it.
    
    * gnu/packages/patches/python-sphinx-prompt-docutils-0.19.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Register it.
    * gnu/packages/sphinx.scm (python-sphinx-prompt)[origin]: Use it.
    
    Change-Id: I597387a35e6a1da01063b4812e0f919788a13b54
---
 gnu/local.mk                                       |  1 +
 .../python-sphinx-prompt-docutils-0.19.patch       | 35 ++++++++++++++++++++++
 gnu/packages/sphinx.scm                            |  4 ++-
 3 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index a82372527e..6ace1fc323 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1770,6 +1770,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/python-pypdf-annotate-tests-appropriately.patch \
   %D%/packages/patches/python-sip-include-dirs.patch   \
   %D%/packages/patches/python-sgmllib3k-assertions.patch       \
+  %D%/packages/patches/python-sphinx-prompt-docutils-0.19.patch        \
   %D%/packages/patches/python-telingo-fix-comparison.patch     \
   %D%/packages/patches/python-typeguard-python3.10.patch       \
   %D%/packages/patches/python-wxwidgets-type-errors.patch      \
diff --git a/gnu/packages/patches/python-sphinx-prompt-docutils-0.19.patch 
b/gnu/packages/patches/python-sphinx-prompt-docutils-0.19.patch
new file mode 100644
index 0000000000..01c1879f1c
--- /dev/null
+++ b/gnu/packages/patches/python-sphinx-prompt-docutils-0.19.patch
@@ -0,0 +1,35 @@
+From a885c54d54e71a089b916502f1c222ef14a07a93 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?St=C3=A9phane=20Brunner?= <stephane.brunner@camptocamp.com>
+Date: Mon, 15 Aug 2022 10:41:40 +0200
+Subject: [PATCH] Fix the tests
+
+---
+ tests/test_sphinx_prompt.py | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/tests/test_sphinx_prompt.py b/tests/test_sphinx_prompt.py
+index 47d16c5..6a31798 100644
+--- a/tests/test_sphinx_prompt.py
++++ b/tests/test_sphinx_prompt.py
+@@ -1,3 +1,7 @@
++from io import StringIO
++
++import docutils.statemachine
++import docutils.utils
+ import pytest
+ 
+ sphinx_prompt = __import__("sphinx_prompt")
+@@ -150,6 +154,12 @@
+ def test(arguments, options, content, expected):
+     sphinx_prompt._cache.next_index = 1
+     sphinx_prompt._cache.prompts.clear()
+-    directive = sphinx_prompt.PromptDirective("prompt", arguments, options, 
content, 0, 0, "", None, None)
++    stream = StringIO()
++    reporter = docutils.utils.Reporter("test data", 2, 4, stream, 1)
++    statemachine = docutils.statemachine.StateMachine([], None)
++    setattr(statemachine, "reporter", reporter)
++    directive = sphinx_prompt.PromptDirective(
++        "prompt", arguments, options, content, 0, 0, "", None, statemachine
++    )
+     result = directive.run()
+     assert result[0].astext() == expected
diff --git a/gnu/packages/sphinx.scm b/gnu/packages/sphinx.scm
index eee1f1c4a8..7e5a929241 100644
--- a/gnu/packages/sphinx.scm
+++ b/gnu/packages/sphinx.scm
@@ -634,7 +634,9 @@ introspection of @code{zope.interface} instances in code.")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0x9wmgf04rzivbzp7jv1b7fkhkpi02lpk5w1qf4i7bcgih00ym8a"))))
+        (base32 "0x9wmgf04rzivbzp7jv1b7fkhkpi02lpk5w1qf4i7bcgih00ym8a"))
+       (patches
+         (search-patches "python-sphinx-prompt-docutils-0.19.patch"))))
     (build-system python-build-system)
     (arguments
      `(#:phases



reply via email to

[Prev in Thread] Current Thread [Next in Thread]