[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/11: gnu: Add pytest-socket.
From: |
guix-commits |
Subject: |
04/11: gnu: Add pytest-socket. |
Date: |
Mon, 7 Nov 2022 14:52:10 -0500 (EST) |
cbaines pushed a commit to branch master
in repository guix.
commit c697ff964192f64dfc22927c09458852ace7dd9a
Author: Sharlatan Hellseher <sharlatanus@gmail.com>
AuthorDate: Fri Oct 14 21:42:06 2022 +0100
gnu: Add pytest-socket.
* gnu/packages/python-check.scm (python-pytest-socket): New variable.
Signed-off-by: Christopher Baines <mail@cbaines.net>
---
gnu/packages/python-check.scm | 49 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 8c46ac7357..749902271b 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -395,6 +395,55 @@ detect the absence of a cassette file and once again
record all HTTP
interactions, which will update them to correspond to the new API.")
(license license:expat)))
+(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"))))
+ (build-system python-build-system)
+ (arguments
+ ;; FIXME: Tests fail a lot, probably requiring Internet access.
+ (list #:tests? #f
+ #:phases #~(modify-phases %standard-phases
+ (replace 'build
+ (lambda _
+ (setenv "SETUPTOOLS_SCM_PRETEND_VERSION"
+ #$version)
+ (setenv "SOURCE_DATE_EPOCH" "315532800")
+ (invoke "python"
+ "-m"
+ "build"
+ "--wheel"
+ "--no-isolation"
+ ".")))
+ (add-before 'check 'disable-unsupported-test
+ (lambda _
+ (substitute* "tests/test_async.py"
+ (("def test_asynctest")
+ "def __off_test_asynctest"))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "python" "-m" "pytest" "-vvv")))))))
+ (native-inputs (list python-httpx
+ python-poetry-core
+ python-pypa-build
+ python-pytest
+ python-pytest-httpbin
+ python-pytest-randomly
+ python-starlette))
+ (home-page "https://pypi.org/project/pytest-socket/")
+ (synopsis "Pytest plugin to disable socket calls during tests")
+ (description
+ "This package provides Pytest extension which disables all network calls
flowing
+through Python's socket interface")
+ (license license:expat)))
+
(define-public python-pytest-ordering
(package
(name "python-pytest-ordering")
- branch master updated (b670dc6c8a -> 2c1fc058c5), guix-commits, 2022/11/07
- 02/11: gnu: Add siosocks., guix-commits, 2022/11/07
- 01/11: services: gitolite: Add local-code configuration option., guix-commits, 2022/11/07
- 07/11: gnu: Add avr-gdb., guix-commits, 2022/11/07
- 03/11: gnu: Add aioftp., guix-commits, 2022/11/07
- 04/11: gnu: Add pytest-socket.,
guix-commits <=
- 09/11: gnu: rlwrap: Update to 0.46.1., guix-commits, 2022/11/07
- 05/11: gnu: Add parfive., guix-commits, 2022/11/07
- 11/11: gnu: teximpatient: Update to 2.4-0.e3666ab., guix-commits, 2022/11/07
- 10/11: services: qemu-binfmt: Add x86_64 QEMU target., guix-commits, 2022/11/07
- 08/11: build-system/linux-module: Add #:source-directory to linux-module-build-cross., guix-commits, 2022/11/07
- 06/11: gnu: Add kconfig-hardened-check., guix-commits, 2022/11/07