diff mbox series

[bug#70489,05/47] gnu: python-pytest-socket: Update to 0.7.0.

Message ID a7c7c263cf654d51b5053643dd1d8f4dc5b9cf7f.1713654571.git.sharlatanus@gmail.com
State New
Headers show
Series Astronomy 2024/02 updates. | expand

Commit Message

Sharlatan Hellseher April 20, 2024, 11:21 p.m. UTC
* gnu/packages/python-check.scm (python-pytest-socket): Update to 0.7.0.

Change-Id: I879064eba2f4d93d2e2b519ebdf613685d5b5df9
---
 gnu/packages/python-check.scm | 31 +++++++++++++++++++++++--------
 1 file changed, 23 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index b39709d960..777791cb6c 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -420,13 +420,17 @@  (define-public python-vcrpy
 (define-public python-pytest-socket
   (package
     (name "python-pytest-socket")
-    (version "0.5.1")
-    (source (origin
-              (method url-fetch)
-              (uri (pypi-uri "pytest-socket" version))
-              (sha256
-               (base32
-                "1dkr86nxkxc0ka3rdnpmk335m8gl1zh1sy8i7w4w1jsidbf82jvw"))))
+    (version "0.7.0")
+    (source
+     (origin
+       ;; There are no tests in the PyPI tarball.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/miketheman/pytest-socket")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1m6s07gvljq82hiajzy1v123kpkciziiqdjqfnas169rmzg0bmnp"))))
     (build-system pyproject-build-system)
     (arguments
      (list
@@ -440,7 +444,18 @@  (define-public python-pytest-socket
                     " and not test_httpx_fails"
                     " and not test_disabled_urllib_fails"
                     " and not test_urllib_succeeds_by_default"
-                    " and not test_enabled_urllib_succeeds"))))
+                    " and not test_enabled_urllib_succeeds"
+                    " and not test_single_cli_arg_connect_disabled_hostname_resolved"))
+     #:phases
+       #~(modify-phases %standard-phases
+           ;; See <https://github.com/miketheman/pytest-socket/issues/308>
+         (add-after 'unpack 'fix-tests
+           (lambda _
+             (substitute* (list "tests/test_async.py"
+                                "tests/test_socket.py"
+                                "tests/test_precedence.py")
+               (("from tests.common import assert_socket_blocked")
+                "from common import assert_socket_blocked")))))))
     (native-inputs (list python-httpx
                          python-poetry-core
                          python-pypa-build