diff options
Diffstat (limited to 'gnu/packages/check.scm')
-rw-r--r-- | gnu/packages/check.scm | 128 |
1 files changed, 127 insertions, 1 deletions
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index a7d90a2d7d..9855b1796f 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -39,7 +39,7 @@ ;;; Copyright © 2021 Hugo Lecomte <hugo.lecomte@inria.fr> ;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be> ;;; Copyright © 2022, 2023 David Elsing <david.elsing@posteo.net> -;;; Copyright © 2022, 2023 Sharlatan Hellseher <sharlatanus@gmail.com> +;;; Copyright © 2022-2024 Sharlatan Hellseher <sharlatanus@gmail.com> ;;; Copyright © 2022 jgart <jgart@dismail.de> ;;; Copyright © 2023 Luis Felipe López Acevedo <luis.felipe.la@protonmail.com> ;;; Copyright © 2023 Timo Wilken <guix@twilken.net> @@ -50,6 +50,7 @@ ;;; Copyright © 2023 Troy Figiel <troy@troyfigiel.com> ;;; Copyright © 2024 Giacomo Leidi <goodoldpaul@autistici.org> ;;; Copyright © 2024 Zheng Junjie <873216071@qq.com> +;;; Copyright © 2024 Navid Afkhami <navid.afkhami@mdc-berlin.de> ;;; ;;; This file is part of GNU Guix. ;;; @@ -82,6 +83,7 @@ #:use-module (gnu packages gnome) #:use-module (gnu packages golang) #:use-module (gnu packages golang-build) + #:use-module (gnu packages golang-xyz) #:use-module (gnu packages gtk) #:use-module (gnu packages guile) #:use-module (gnu packages guile-xyz) @@ -1461,6 +1463,27 @@ distributed testing in both @code{load} and @code{each} modes. It also supports coverage of subprocesses.") (license license:expat))) +(define-public python-pytest-relaxed + (package + (name "python-pytest-relaxed") + (version "2.0.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/bitprophet/pytest-relaxed") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1lnnkadfr390i30209gpl80nymc20pmamvxjhd11gvf4d6f54n7x")))) + (build-system pyproject-build-system) + (propagated-inputs (list python-decorator)) + (native-inputs (list python-pytest)) + (home-page "https://github.com/bitprophet/pytest-relaxed") + (synopsis "Relaxed test discovery for pytest") + (description "This package provides relaxed test discovery for pytest.") + (license license:bsd-2))) + (define-public python-pytest-dotenv (package (name "python-pytest-dotenv") @@ -1485,6 +1508,78 @@ supports coverage of subprocesses.") from a .env file before running tests.") (license license:expat))) +(define-public python-pytest-examples + (package + (name "python-pytest-examples") + (version "0.0.10") + (source + (origin + ;; No tests in the PyPI tarball. + (method git-fetch) + (uri (git-reference + (url "https://github.com/pydantic/pytest-examples") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0lwxgyfj6lnkhmrvb6kzfskpwfz70kxnhnjvyl3l65k568c4wb4c")))) + (build-system pyproject-build-system) + (arguments + (list + #:test-flags + #~(list "-k" + (string-append + ;; Disable tests requiring pthon-ruff. + "not test_ruff" + " and not test_ruff_config" + " and not test_ruff_offset" + " and not test_ruff_ok" + " and not test_ruff_error" + " and not test_update_files" + " and not test_cases_update[simple.md]" + " and not test_cases_update[dataclass_indent.md]" + " and not test_cases_update[long_python_lines.py]" + " and not test_cases_update[simple.py]" + " and not test_cases_update[python_class.py]" + " and not test_cases_update[call_twice.md]" + " and not test_insert_print[example/README.md:3-33]" + " and not test_insert_print[example/README.md:37-40]" + " and not test_insert_print[example/README.md:44-47]" + " and not test_insert_print[example/README.md:49-66]" + " and not test_python_self[example/test_example.py:28-31]" + " and not test_python_self[example/test_example.py:40-43]" + " and not test_python_self_change_docstyle[example/test_example.py:28-31]" + " and not test_python_self_change_docstyle[example/test_example.py:40-43]")) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'relax-requirements + (lambda _ + (substitute* "pyproject.toml" + ;; XXX: Removing ruff from required packages to pass Sanity + ;; check, add it back when it's available. + (("'ruff>=0.0.258',") "") + ;; black>=23 + ((">=23") ">22"))))))) + (propagated-inputs + ;; TODO: Add python-ruff once it has been packaged. + (list python-black python-pytest)) + (native-inputs + (list python-hatchling)) + (home-page "https://pypi.org/project/pytest-examples/") + (synopsis "Pytest plugin for testing examples in docstrings and markdown files") + (description + "Pytest-examples provides functionality for testing Python code examples +in docstrings and markdown files, with its main features being: + +@itemize +@item lint code examples using ruff and black +@item run code examples +@item run code examples and check print statements are inlined correctly in +the code +@item It can also update code examples in place to format them and insert or +update print statements +@end itemize") + (license license:expat))) + (define-public python-pytest-httpserver (package (name "python-pytest-httpserver") @@ -3049,6 +3144,37 @@ JSON APIs with Behave.") @command{nosetests} command of the Python Nose unit test framework.") (license license:bsd-3))) +(define-public python-nose-exclude + (package + (name "python-nose-exclude") + (version "0.5.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "nose-exclude" version)) + (sha256 + (base32 "0123x1lyv5b2p9civcfg8vilj2ga3q7p2ks1hq25z0gb3ssai3zp")))) + (build-system pyproject-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-before 'check 'disable-test + (lambda _ + ;; Disable failing test: AssertionError. + (substitute* '("test_dirs/build/test.py" + "test_dirs/test_not_me/test.py") + (("def test_i_should_never_run") + "def off_i_should_never_run"))))))) + (propagated-inputs + (list python-nose)) + (home-page "https://github.com/kgrandis/nose-exclude") + (synopsis "Exclude specific directories from nosetests runs") + (description + "@code{nose-exclude} is a Nose plugin that allows you to easily specify +directories to be excluded from testing.") + (license license:lgpl2.1+))) + (define-public python-nose-random (package (name "python-nose-random") |