From 592a6e1cebf2213c4e24919245edc28497d0f107 Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Sun, 11 Feb 2024 11:50:43 +0000 Subject: [PATCH] gnu: python-pytest-socket: Simplify package, enable tests. * gnu/packages/python-check.scm (python-pytest-socket) [build-system]: Swap to pyproject-build-system. [arguments] <#:test-flags>: Disable tests requiring network access. <#:phases>: Use standard phases. Change-Id: Ib7fe0b3dab4e269c00856a10b8ca23acc8c8e180 --- gnu/packages/python-check.scm | 37 ++++++++++++----------------------- 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 315ea74459..51a38bbcbe 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -426,31 +426,20 @@ interactions, which will update them to correspond to the new API.") (sha256 (base32 "1dkr86nxkxc0ka3rdnpmk335m8gl1zh1sy8i7w4w1jsidbf82jvw")))) - (build-system python-build-system) + (build-system pyproject-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"))))))) + (list + #:test-flags + #~(list "-k" (string-append + ;; Disable test requiring network access. + "not test_disable_socket_urllib" + " and not test_parametrize_with_socket_enabled_and_allow_hosts" + " and not test_global_disable_and_allow_host" + " and not test_asynctest" + " and not test_httpx_fails" + " and not test_disabled_urllib_fails" + " and not test_urllib_succeeds_by_default" + " and not test_enabled_urllib_succeeds")))) (native-inputs (list python-httpx python-poetry-core python-pypa-build