1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2019, 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
6 ;;; Copyright © 2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
7 ;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu>
8 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
9 ;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
10 ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
11 ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
12 ;;; Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
13 ;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
14 ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
15 ;;; Copyright © 2021 Bonface Munyoki Kilyungi <me@bonfacemunyoki.com>
17 ;;; This file is part of GNU Guix.
19 ;;; GNU Guix is free software; you can redistribute it and/or modify it
20 ;;; under the terms of the GNU General Public License as published by
21 ;;; the Free Software Foundation; either version 3 of the License, or (at
22 ;;; your option) any later version.
24 ;;; GNU Guix is distributed in the hope that it will be useful, but
25 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ;;; GNU General Public License for more details.
29 ;;; You should have received a copy of the GNU General Public License
30 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32 (define-module (gnu packages python-check)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages check)
35 #:use-module (gnu packages django)
36 #:use-module (gnu packages openstack)
37 #:use-module (gnu packages python-build)
38 #:use-module (gnu packages python-web)
39 #:use-module (gnu packages python-xyz)
40 #:use-module (gnu packages web)
41 #:use-module (gnu packages xml)
42 #:use-module (guix utils)
43 #:use-module ((guix licenses) #:prefix license:)
44 #:use-module (guix packages)
45 #:use-module (guix git-download)
46 #:use-module (guix download)
47 #:use-module (guix build-system python))
49 (define-public python-testfixtures
51 (name "python-testfixtures")
56 (uri (pypi-uri "testfixtures" version))
58 (base32 "1nlv2hz20czjp4a811ichl5kwg99rh84l0mw9wq4rk3idzfs1hsy"))))
59 (build-system python-build-system)
61 `(#:tests? #f)) ; PyTest-Django fails to build in master
63 `(("python-pytest" ,python-pytest)
64 ("python-pytest-cov" ,python-pytest-cov)
65 ;;("python-pytest-django" ,python-pytest-django)
66 ("python-twine" ,python-twine)
67 ("python-wheel" ,python-wheel)))
68 (synopsis "Tests components for Python")
69 (description "Testfixtures is a collection of helpers and mock objects that
70 are useful when writing automated tests in Python.")
71 (home-page "https://testfixtures.readthedocs.io/en/latest/")
72 (license license:expat)))
74 (define-public python-coveralls
76 (name "python-coveralls")
78 (home-page "https://github.com/coveralls-clients/coveralls-python")
81 ;; The PyPI release lacks tests, so we pull from git instead.
83 (uri (git-reference (url home-page) (commit version)))
84 (file-name (git-file-name name version))
87 "1zr1lqdjcfwj6wcx2449mzzjq8bbhwnqcm5vdif5s8hlz35bjxkp"))))
88 (build-system python-build-system)
90 '(#:phases (modify-phases %standard-phases
91 (add-before 'check 'disable-git-test
93 ;; Remove test that requires 'git' and the full checkout.
94 (delete-file "tests/git_test.py")
97 (lambda* (#:key tests? #:allow-other-keys)
99 (invoke "pytest" "-vv")
100 (format #t "test suite not run~%"))
103 `(("python-coverage" ,python-coverage)
104 ("python-docopt" ,python-docopt)
105 ("python-pyyaml" ,python-pyyaml)
106 ("python-requests" ,python-requests)))
108 `(("python-mock" ,python-mock)
109 ("python-pytest" ,python-pytest)))
110 (synopsis "Show coverage stats online via coveralls.io")
112 "Coveralls.io is a service for publishing code coverage statistics online.
113 This package provides seamless integration with coverage.py (and thus pytest,
114 nosetests, etc...) in Python projects.")
115 (license license:expat)))
117 (define-public python-junit-xml
118 ;; XXX: There are no tags or PyPI releases, so take the latest commit
119 ;; and use the version defined in setup.py.
120 (let ((version "1.9")
121 (commit "4bd08a272f059998cedf9b7779f944d49eba13a6")
124 (name "python-junit-xml")
125 (version (git-version version revision commit))
126 (home-page "https://github.com/kyrus/python-junit-xml")
129 (uri (git-reference (url home-page) (commit commit)))
130 (file-name (git-file-name name version))
133 "0b8kbjhk3j10rk0vcniy695m3h43yip6y93h1bd6jjh0cp7s09c7"))))
134 (build-system python-build-system)
136 `(#:phases (modify-phases %standard-phases
139 (invoke "pytest" "-vv"))))))
141 `(("python-pytest" ,python-pytest)))
143 `(("python-six" ,python-six)))
144 (synopsis "Create JUnit XML test results")
146 "This package provides a Python module for creating JUnit XML test
147 result documents that can be read by tools such as Jenkins or Bamboo.")
148 (license license:expat))))
150 (define-public python-vcrpy
152 (name "python-vcrpy")
157 (uri (pypi-uri "vcrpy" version))
160 "0kws7l3hci1dvjv01nxw3805q9v2mwldw58bgl8s90wqism69gjp"))))
161 (build-system python-build-system)
162 (arguments `(#:tests? #f)) ; tests require more packages for python-pytest-httpbin
164 `(("python-pyyaml" ,python-pyyaml)
165 ("python-six" ,python-six)
166 ("python-wrapt" ,python-wrapt)
167 ("python-yarl" ,python-yarl)))
169 `(("python-mock" ,python-mock)
170 ("python-pytest" ,python-pytest)
171 ("python-pytest-httpbin" ,python-pytest-httpbin)))
172 (home-page "https://github.com/kevin1024/vcrpy")
173 (synopsis "Automatically mock your HTTP interactions")
175 "VCR.py simplifies and speeds up tests that make HTTP requests. The first
176 time you run code that is inside a VCR.py context manager or decorated function,
177 VCR.py records all HTTP interactions that take place through the libraries it
178 supports and serializes and writes them to a flat file (in yaml format by
179 default). This flat file is called a cassette. When the relevant piece of code
180 is executed again, VCR.py will read the serialized requests and responses from
181 the aforementioned cassette file, and intercept any HTTP requests that it
182 recognizes from the original test run and return the responses that corresponded
183 to those requests. This means that the requests will not actually result in
184 HTTP traffic, which confers several benefits including:
186 @item The ability to work offline
187 @item Completely deterministic tests
188 @item Increased test execution speed
190 If the server you are testing against ever changes its API, all you need to do
191 is delete your existing cassette files, and run your tests again. VCR.py will
192 detect the absence of a cassette file and once again record all HTTP
193 interactions, which will update them to correspond to the new API.")
194 (license license:expat)))
196 (define-public python-pytest-ordering
198 (name "python-pytest-ordering")
202 ;; No tests in the PyPI tarball.
205 (url "https://github.com/ftobia/pytest-ordering")
207 (file-name (git-file-name name version))
209 (base32 "14msj5gyqza0gk3x7h1ivmjrwza82v84cj7jx3ks0fw9lpin7pjq"))))
210 (build-system python-build-system)
213 (modify-phases %standard-phases
215 (lambda* (#:key inputs outputs #:allow-other-keys)
216 (add-installed-pythonpath inputs outputs)
217 (invoke "pytest" "-vv" "-k"
218 ;; This test fails because of a type mismatch of an
219 ;; argument passed to @code{pytest.main}.
220 "not test_run_marker_registered"))))))
222 `(("python-pytest" ,python-pytest)))
223 (home-page "https://github.com/ftobia/pytest-ordering")
224 (synopsis "Pytest plugin to run your tests in a specific order")
226 "This plugin defines Pytest markers to ensure that some tests, or groups
227 of tests run in a specific order.")
228 (license license:expat)))
230 (define-public python-pytest-astropy-header
232 (name "python-pytest-astropy-header")
237 (uri (pypi-uri "pytest-astropy-header" version))
239 (base32 "1y87agr324p6x5gvhziymxjlw54pyn4gqnd49papbl941djpkp5g"))))
240 (build-system python-build-system)
242 `(("pytest" ,python-pytest)
243 ("setuptools-scm" ,python-setuptools-scm)))
244 (home-page "https://www.astropy.org/")
246 "Pytest plugin adding diagnostic data to the header of the test output")
248 "This plugin package provides a way to include information about the system,
249 Python installation, and select dependencies in the header of the output when
250 running pytest. It can be used with packages that are not affiliated with the
251 Astropy project, but is optimized for use with astropy-related projects.")
252 (license license:bsd-3)))
254 (define-public python-pytest-astropy
256 (name "python-pytest-astropy")
261 (uri (pypi-uri "pytest-astropy" version))
263 (base32 "18j6z6y2fvykmcs5z0mldhhaxxn6wzpnhlm2ps7m8r5z5kmh1631"))))
264 (build-system python-build-system)
269 `(("attrs" ,python-attrs)
270 ("hypothesis" ,python-hypothesis)
271 ("pytest" ,python-pytest)
272 ("pytest-arraydiff" ,python-pytest-arraydiff)
273 ("pytest-astropy-header" ,python-pytest-astropy-header)
274 ("pytest-cov" ,python-pytest-cov)
275 ("pytest-doctestplus" ,python-pytest-doctestplus)
276 ("pytest-filter-subpackage" ,python-pytest-filter-subpackage)
277 ("pytest-mock" ,python-pytest-mock)
278 ("pytest-openfiles" ,python-pytest-openfiles)
279 ("pytest-remotedata" ,python-pytest-remotedata)
280 ("setuptools-scm" ,python-setuptools-scm)))
281 (home-page "https://github.com/astropy/pytest-astropy")
283 "Metapackage for all the testing machinery used by the Astropy Project")
285 "This is a meta-package that pulls in the dependencies that are used by
286 astropy related packages.")
287 (license license:bsd-3)))
289 (define-public python-pytest-arraydiff
291 (name "python-pytest-arraydiff")
296 (uri (pypi-uri "pytest-arraydiff" version))
298 (base32 "05bcvhh2ycxa35znl8b3l9vkcmx7vwm5c3fpakbpw46c7vsn4bfy"))))
299 (build-system python-build-system)
301 ;; Tests require python-astropy, which itself requires this package.
302 ;; Disable tests to avoid the circular dependency problem.
305 `(("python-numpy" ,python-numpy)
306 ("python-six" ,python-six)))
307 (home-page "https://github.com/astropy/pytest-arraydiff")
308 (synopsis "Pytest plugin to help with comparing array output from tests")
310 "This is a py.test plugin to facilitate the generation and comparison of
311 data arrays produced during tests, in particular in cases where the arrays
312 are too large to conveniently hard-code them in the tests.")
313 (license license:bsd-3)))
315 (define-public python-pytest-doctestplus
317 (name "python-pytest-doctestplus")
322 (uri (pypi-uri "pytest-doctestplus" version))
324 (base32 "1ai9kvd7xbq2jg2h8gmkb8lqzyrxvdh4zg3vxndg149iwd1hyi7d"))))
325 (build-system python-build-system)
328 (modify-phases %standard-phases
330 (lambda* (#:key inputs outputs #:allow-other-keys)
331 ;; Make the installed plugin discoverable by Pytest.
332 (add-installed-pythonpath inputs outputs)
333 (invoke "pytest" "-vv"))))))
335 `(("python-pytest" ,python-pytest)))
336 (home-page "https://github.com/astropy/pytest-doctestplus")
337 (synopsis "Pytest plugin with advanced doctest features")
339 "This package contains a plugin for the Pytest framework that provides
340 advanced doctest support and enables the testing of reStructuredText files.")
341 (license license:bsd-3)))
343 (define-public python-pytest-filter-subpackage
345 (name "python-pytest-filter-subpackage")
350 (uri (pypi-uri "pytest-filter-subpackage" version))
352 (base32 "1s4s2kd31yc65rfvl4xhy8xx806xhy59kc7668h6b6wq88xgrn5p"))))
353 (build-system python-build-system)
355 '(;; One test is failing. There's an issue reported upstream. See
356 ;; https://github.com/astropy/pytest-filter-subpackage/issues/3.
357 ;; Disable it for now.
359 (modify-phases %standard-phases
361 (lambda* (#:key inputs outputs #:allow-other-keys)
362 ;; Make the installed plugin discoverable by Pytest.
363 (add-installed-pythonpath inputs outputs)
364 (invoke "pytest" "-vv" "-k" "not test_with_rst"))))))
366 `(("python-pytest" ,python-pytest)
367 ("python-pytest-cov" ,python-pytest-cov)
368 ("python-pytest-doctestplus"
369 ,python-pytest-doctestplus)))
370 (home-page "https://github.com/astropy/pytest-filter-subpackage")
371 (synopsis "Pytest plugin for filtering based on sub-packages")
373 "This package contains a simple plugin for the pytest framework that
374 provides a shortcut to testing all code and documentation for a given
376 (license license:bsd-3)))
378 (define-public python-pytest-helpers-namespace
380 (name "python-pytest-helpers-namespace")
381 (version "2021.3.24")
385 (uri (pypi-uri "pytest-helpers-namespace" version))
388 "0pyj2d45zagmzlajzqdnkw5yz8k49pkihbydsqkzm413qnkzb38q"))))
389 (build-system python-build-system)
392 (modify-phases %standard-phases
394 (lambda* (#:key inputs outputs #:allow-other-keys)
395 ;; Make the installed plugin discoverable by Pytest.
396 (add-installed-pythonpath inputs outputs)
397 (invoke "pytest" "-vv"))))))
399 `(("python-pytest" ,python-pytest-6)
400 ("python-setuptools" ,python-setuptools) ; needs setuptools >= 50.3.2
401 ("python-setuptools-scm" ,python-setuptools-scm)
402 ("python-setuptools-declarative-requirements"
403 ,python-setuptools-declarative-requirements)))
404 (home-page "https://github.com/saltstack/pytest-helpers-namespace")
405 (synopsis "Pytest Helpers Namespace Plugin")
406 (description "Pytest Helpers Namespace Plugin provides a helpers pytest
407 namespace which can be used to register helper functions without requiring
408 someone to import them in their actual tests to use them.")
409 (license license:asl2.0)))
411 (define-public python-pytest-openfiles
413 (name "python-pytest-openfiles")
418 (uri (pypi-uri "pytest-openfiles" version))
420 (base32 "0n0a7fdc9m86360y96l23fvdmd6rw04bl6h5xqgl9qxfv08jk70p"))))
421 (build-system python-build-system)
424 (modify-phases %standard-phases
426 (lambda* (#:key inputs outputs #:allow-other-keys)
427 ;; Make the installed plugin discoverable by Pytest.
428 (add-installed-pythonpath inputs outputs)
429 (invoke "pytest" "-vv"))))))
431 `(("python-setuptools-scm" ,python-setuptools-scm)
432 ("python-pytest" ,python-pytest)))
434 `(("python-psutil" ,python-psutil)))
435 (home-page "https://github.com/astropy/pytest-openfiles")
436 (synopsis "Pytest plugin for detecting inadvertent open file handles")
438 "This package provides a plugin for the pytest framework that allows
439 developers to detect whether any file handles or other file-like objects
440 were inadvertently left open at the end of a unit test.")
441 (license license:bsd-3)))
443 (define-public python-pytest-remotedata
445 (name "python-pytest-remotedata")
450 (uri (pypi-uri "pytest-remotedata" version))
452 (base32 "1h6g6shib6z07azf12rnsa053470ggbd7hy3bnbw8nf3nza5h372"))))
453 (build-system python-build-system)
456 (modify-phases %standard-phases
458 (lambda* (#:key inputs outputs #:allow-other-keys)
459 ;; Make the installed plugin discoverable by Pytest.
460 (add-installed-pythonpath inputs outputs)
461 (invoke "pytest" "-vv" "-k"
463 ;; These tests require internet access. Disable them.
464 "not test_default_behavior"
465 " and not test_strict_with_decorator")))))))
467 `(("python-pytest" ,python-pytest)))
469 `(("python-six" ,python-six)))
470 (home-page "https://github.com/astropy/pytest-remotedata")
471 (synopsis "Pytest plugin for controlling remote data access")
473 "This package provides a plugin for the Pytest framework that allows
474 developers to control unit tests that require access to data from the
476 (license license:bsd-3)))
478 (define-public python-pytest-mpl
480 (name "python-pytest-mpl")
485 (uri (pypi-uri "pytest-mpl" version))
487 (base32 "1km202c1s5kcn52fx0266p06qb34va3warcby594dh6vixxa9i96"))))
488 (build-system python-build-system)
491 (modify-phases %standard-phases
494 (invoke "pytest" "-vv"))))))
496 `(("python-pytest" ,python-pytest)))
498 `(("python-matplotlib" ,python-matplotlib)
499 ("python-pillow" ,python-pillow)))
500 (home-page "https://github.com/matplotlib/pytest-mpl")
501 (synopsis "Pytest plugin to help with testing figures output from Matplotlib")
503 "This is a plugin to facilitate image comparison for Matplotlib figures
505 (license license:bsd-3)))
507 (define-public python-covdefaults
509 (name "python-covdefaults")
513 ;; The PyPI tarball does not include tests.
516 (url "https://github.com/asottile/covdefaults")
517 (commit (string-append "v" version))))
518 (file-name (git-file-name name version))
520 (base32 "11a24c0wzv01n55fy4kdpnyqna4m9k0mp58kmhiaks34xw4k37hq"))))
521 (build-system python-build-system)
524 (modify-phases %standard-phases
527 (invoke "pytest" "-vv"))))))
529 `(("python-coverage" ,python-coverage)
530 ("python-pytest" ,python-pytest)))
531 (home-page "https://github.com/asottile/covdefaults")
532 (synopsis "Coverage plugin to provide opinionated default settings")
534 "Covdefaults is a coverage plugin to provide opinionated default
536 (license license:expat)))
538 (define-public python-pytest-vcr
539 ;; This commit fixes integration with pytest-5
540 (let ((commit "4d6c7b3e379a6a7cba0b8f9d20b704dc976e9f05")
543 (name "python-pytest-vcr")
544 (version (git-version "1.0.2" revision commit))
549 (url "https://github.com/ktosiek/pytest-vcr")
551 (file-name (git-file-name name version))
554 "1yk988zi0la6zpcm3fff0mxf942di2jiymrfqas19nyngj5ygaqs"))))
555 (build-system python-build-system)
558 (modify-phases %standard-phases
560 (lambda* (#:key inputs outputs #:allow-other-keys)
561 (add-installed-pythonpath inputs outputs)
562 (invoke "pytest" "tests/"))))))
564 `(("python-pytest" ,python-pytest)
565 ("python-vcrpy" ,python-vcrpy)))
566 (home-page "https://github.com/ktosiek/pytest-vcr")
567 (synopsis "Plugin for managing VCR.py cassettes")
569 "Plugin for managing VCR.py cassettes.")
570 (license license:expat))))
572 (define-public python-pytest-checkdocs
574 (name "python-pytest-checkdocs")
579 (uri (pypi-uri "pytest-checkdocs" version))
581 (base32 "0j6j1gvj6x451y3qsx4xbaq9p1w9gg3mwk7n0w80cy8vdyjkngb0"))))
582 (build-system python-build-system)
584 `(("python-docutils" ,python-docutils)
585 ("python-importlib-metadata" ,python-importlib-metadata)
586 ("python-more-itertools" ,python-more-itertools)))
588 `(("python-setuptools-scm" ,python-setuptools-scm)))
589 (home-page "https://github.com/jaraco/pytest-checkdocs")
590 (synopsis "Check the README when running tests")
592 "This package provides a pytest plugin that checks the long description
593 of the project to ensure it renders properly.")
594 (license license:expat)))
596 (define-public python-re-assert
598 (name "python-re-assert")
602 ;; There are no tests in the PyPI tarball.
605 (url "https://github.com/asottile/re-assert")
606 (commit (string-append "v" version))))
607 (file-name (git-file-name name version))
609 (base32 "1rssq4wpqmx1c17hjfx5l3sn3zmnlz9jffddiqrs4f6h7m6cadai"))))
610 (build-system python-build-system)
613 (modify-phases %standard-phases
616 (invoke "pytest" "-vv"))))))
618 `(("python-covdefaults" ,python-covdefaults)
619 ("python-coverage" ,python-coverage)
620 ("python-pytest" ,python-pytest)))
622 `(("python-regex" ,python-regex)))
623 (home-page "https://github.com/asottile/re-assert")
624 (synopsis "Show where your regex match assertion failed")
626 "@code{re-assert} provides a helper class to make assertions of regexes
628 (license license:expat)))
630 (define-public python-pytest-trio
632 (name "python-pytest-trio")
637 (uri (pypi-uri "pytest-trio" version))
639 (base32 "1zm8didm9h5jkqhghl9bvqs7kr7sjci282c7grhk6yhpzn8a9w4v"))))
640 (build-system python-build-system)
643 (modify-phases %standard-phases
645 (lambda* (#:key inputs outputs #:allow-other-keys)
646 (add-installed-pythonpath inputs outputs)
647 (invoke "pytest" "-W" "error" "-ra" "-v" "--pyargs"
648 "pytest_trio" "--verbose" "--cov"))))))
650 `(("python-hypothesis" ,python-hypothesis)
651 ("python-pytest" ,python-pytest)
652 ("python-pytest-cov" ,python-pytest-cov)))
654 `(("python-trio" ,python-trio)))
655 (home-page "https://github.com/python-trio/pytest-trio")
656 (synopsis "Pytest plugin for trio")
658 "This is a pytest plugin to help you test projects that use Trio, a
659 friendly library for concurrency and async I/O in Python.")
660 ;; Either license applies.
661 (license (list license:expat license:asl2.0))))
663 (define-public python-pytest-flake8
665 (name "python-pytest-flake8")
670 (uri (pypi-uri "pytest-flake8" version))
673 "0syx68xk5ss3hgp3nr2y122w0fgkzr5936ghsqrkymh3m5hrf9gh"))))
674 (build-system python-build-system)
676 `(("python-flake8" ,python-flake8)))
678 `(("python-pytest" ,python-pytest)))
679 (home-page "https://github.com/tholo/pytest-flake8")
680 (synopsis "Pytest plugin to check FLAKE8 requirements")
682 "This package provides a pytest plugin for efficiently checking PEP8
684 (license license:bsd-3)))
686 (define-public python-pytest-isort
688 (name "python-pytest-isort")
693 (uri (pypi-uri "pytest-isort" version))
695 (base32 "06myn5hhxs5yp8dqr1yjsgcnnxnsrvsqannm00bvaw0qml6ydzjb"))))
696 (build-system python-build-system)
699 (modify-phases %standard-phases
703 (string-append (getcwd) ":"
704 (getenv "PYTHONPATH")))
705 (invoke "pytest"))))))
707 `(("python-isort" ,python-isort)
708 ("python-pytest" ,python-pytest)))
709 (home-page "https://github.com/moccu/pytest-isort/")
710 (synopsis "Pytest plugin to check import ordering using isort")
712 "This package provides a pytest plugin to check import ordering using
714 (license license:bsd-3)))
716 (define-public python-pytest-shutil
718 (name "python-pytest-shutil")
723 (uri (pypi-uri "pytest-shutil" version))
726 "0q8j0ayzmnvlraml6i977ybdq4xi096djhf30n2m1rvnvrhm45nq"))))
727 (build-system python-build-system)
730 (modify-phases %standard-phases
731 (add-after 'unpack 'patch-tests
734 (substitute* "tests/integration/test_cmdline_integration.py"
735 (("dirname = '/bin'")
736 "dirname = '/tmp/bin'")
737 (("bindir = os.path.realpath\\('/bin'\\)")
738 "bindir = os.path.realpath('/tmp/bin')"))
741 `(("python-contextlib2" ,python-contextlib2)
742 ("python-execnet" ,python-execnet)
743 ("python-pathpy" ,python-pathpy)
744 ("python-termcolor" ,python-termcolor)))
746 `(("python-mock" ,python-mock)
747 ("python-pytest" ,python-pytest)
748 ("python-setuptools-git" ,python-setuptools-git)))
749 (home-page "https://github.com/manahl/pytest-plugins")
750 (synopsis "Assorted shell and environment tools for py.test")
752 "This package provides assorted shell and environment tools for the
753 py.test testing framework.")
754 (license license:expat)))
756 (define-public python-pytest-fixture-config
758 (name "python-pytest-fixture-config")
763 (uri (pypi-uri "pytest-fixture-config" version))
766 "13i1qpz22w3x4dmw8vih5jdnbqfqvl7jiqs0dg764s0zf8bp98a1"))))
767 (build-system python-build-system)
769 `(("python-pytest" ,python-pytest)
770 ("python-setuptools-git" ,python-setuptools-git)))
771 (home-page "https://github.com/manahl/pytest-plugins")
772 (synopsis "Fixture configuration utils for py.test")
774 "This package provides fixture configuration utilities for the py.test
776 (license license:expat)))
778 (define-public python-pytest-virtualenv
780 (name "python-pytest-virtualenv")
785 (uri (pypi-uri "pytest-virtualenv" version))
788 "03w2zz3crblj1p6i8nq17946hbn3zqp9z7cfnifw47hi4a4fww12"))))
789 (build-system python-build-system)
792 (modify-phases %standard-phases
793 ;; Reference the virtualenv executable directly, to avoid the need
794 ;; for PYTHONPATH, which gets cleared when instantiating a new
795 ;; virtualenv with pytest-virtualenv.
796 (add-after 'unpack 'patch-virtualenv-executable
797 (lambda* (#:key inputs #:allow-other-keys)
798 (let* ((virtualenv (assoc-ref inputs "python-virtualenv"))
799 (virtualenv-bin (string-append virtualenv
801 (substitute* "pytest_virtualenv.py"
802 (("^DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE.*$")
803 (format #f "DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE = '~a'"
807 `(("python-pytest-shutil" ,python-pytest-shutil)
808 ("python-pytest-fixture-config" ,python-pytest-fixture-config)))
810 `(("python-virtualenv" ,python-virtualenv)))
812 `(("python-mock" ,python-mock)
813 ("python-pytest" ,python-pytest)
814 ("python-setuptools-git" ,python-setuptools-git)))
815 (home-page "https://github.com/manahl/pytest-plugins")
816 (synopsis "Virtualenv fixture for py.test")
817 (description "This package provides a virtualenv fixture for the py.test
819 (license license:expat)))
821 (define-public python-pytest-pycodestyle
823 (name "python-pytest-pycodestyle")
824 (version "2.0.0") ;later versions require python-pytest~=5.4
828 (uri (pypi-uri "pytest-pycodestyle" version))
831 "02i5gl7pm9cwxk15sn29inz3n8flpj1r3p1l110h43f2na5w8h7z"))))
832 (build-system python-build-system)
834 `(("python-pycodestyle" ,python-pycodestyle)))
836 `(("python-pytest" ,python-pytest)))
837 (home-page "https://github.com/henry0312/pytest-pycodestyle")
838 (synopsis "Pytest plugin to run pycodestyle")
839 (description "This package provides a plugin to run @code{pycodestyle}
840 for the @code{pytest} framework.")
841 (license license:expat)))
843 (define-public python-pytest-benchmark
845 (name "python-pytest-benchmark")
850 (uri (pypi-uri "pytest-benchmark" version))
853 "0a4mpb4j73dsyk47hd1prrjpfk4r458s102cn80rf253jg818hxd"))))
854 (build-system python-build-system)
856 `(("python-py-cpuinfo" ,python-py-cpuinfo)))
858 `(("python-pathlib2" ,python-pathlib2)
859 ("python-pytest" ,python-pytest)))
860 (home-page "https://github.com/ionelmc/pytest-benchmark")
861 (synopsis "Pytest fixture for benchmarking code")
863 "This package provides a pytest fixture that will group the tests into
864 rounds that are calibrated to the chosen timer.")
865 (license license:bsd-2)))
867 (define-public python-pytest-services
869 (name "python-pytest-services")
874 (uri (pypi-uri "pytest-services" version))
877 "0b2zfv04w6m3gp2v44ifdhx22vcji069qnn95ry3zcyxib7cjnq3"))))
878 (build-system python-build-system)
879 (arguments '(#:tests? #f)) ; Tests not included in release tarball.
881 `(("python-psutil" ,python-psutil)
882 ("python-requests" ,python-requests)))
884 `(("python-pytest" ,python-pytest)))
885 (home-page "https://github.com/pytest-dev/pytest-services")
886 (synopsis "Services plugin for pytest testing framework")
888 "This plugin provides a set of fixtures and utility functions to start
889 service processes for your tests with pytest.")
890 (license license:expat)))
892 (define-public python-pytest-toolbox
894 (name "python-pytest-toolbox")
898 ;; No tests in the PyPI tarball.
901 (url "https://github.com/samuelcolvin/pytest-toolbox")
902 (commit (string-append "v" version))))
903 (file-name (git-file-name name version))
905 (base32 "1wqkr3g5gmqdxmhzfsxbwy8pm3cadaj6a8cxq58w9bacly4hqbh0"))))
906 (build-system python-build-system)
909 (modify-phases %standard-phases
911 (lambda* (#:key inputs outputs #:allow-other-keys)
912 ;; Make the installed plugin discoverable by Pytest.
913 (add-installed-pythonpath inputs outputs)
914 (invoke "pytest" "-vv"))))))
916 `(("python-coverage" ,python-coverage)
917 ("python-docutils" ,python-docutils)
918 ("python-flake8" ,python-flake8)
919 ("python-isort" ,python-isort)
920 ("python-pydantic" ,python-pydantic)
921 ("python-pyflakes" ,python-pyflakes)
922 ("python-pygments" ,python-pygments)
923 ("python-pytest" ,python-pytest)
924 ("python-pytest-cov" ,python-pytest-cov)
925 ("python-pytest-isort" ,python-pytest-isort)
926 ("python-pytest-mock" ,python-pytest-mock)
927 ("python-pytest-sugar" ,python-pytest-sugar)))
928 (home-page "https://github.com/samuelcolvin/pytest-toolbox")
929 (synopsis "Numerous useful plugins for Pytest")
931 "Pytest Toolbox contains many useful plugins for Pytest. Among them are
932 new fixtures, new methods and new comparison objects.")
933 (license license:expat)))
935 (define-public python-pytest-aiohttp
937 (name "python-pytest-aiohttp")
942 (uri (pypi-uri "pytest-aiohttp" version))
945 "0kx4mbs9bflycd8x9af0idcjhdgnzri3nw1qb0vpfyb3751qaaf9"))))
946 (build-system python-build-system)
948 `(("python-pytest" ,python-pytest)))
950 `(("python-aiohttp" ,python-aiohttp)))
951 (home-page "https://github.com/aio-libs/pytest-aiohttp/")
952 (synopsis "Pytest plugin for aiohttp support")
953 (description "This package provides a pytest plugin for aiohttp support.")
954 (license license:asl2.0)))
956 (define-public python-nbval
958 (name "python-nbval")
963 (uri (pypi-uri "nbval" version))
965 (base32 "0h3xrnw0mj1srigrx2rfnd73h8s0xjycclmjs0vx7qkfyqpcvvyg"))))
966 (build-system python-build-system)
969 (modify-phases %standard-phases
970 (add-before 'check 'fix-test
972 ;; This test fails because of a mismatch in the output of LaTeX
973 ;; equation environments. Seems OK to skip.
974 (delete-file "tests/ipynb-test-samples/test-latex-pass-correctouput.ipynb")
977 (lambda* (#:key inputs outputs #:allow-other-keys)
978 (add-installed-pythonpath inputs outputs)
979 (invoke "pytest" "-vv" "-k"
981 ;; This only works with Pytest < 5.
982 "not nbdime_reporter"
983 ;; https://github.com/computationalmodelling/nbval/pull/148.
984 " and not test_timeouts")))))))
986 `(("python-pytest" ,python-pytest)
987 ("python-pytest-cov" ,python-pytest-cov)
988 ("python-sympy" ,python-sympy)))
990 `(("python-ipykernel" ,python-ipykernel)
991 ("python-jupyter-client" ,python-jupyter-client)
992 ("python-nbformat" ,python-nbformat)
993 ("python-six" ,python-six)))
994 (home-page "https://github.com/computationalmodelling/nbval")
995 (synopsis "Pytest plugin to validate Jupyter notebooks")
997 "This plugin adds functionality to Pytest to recognise and collect Jupyter
998 notebooks. The intended purpose of the tests is to determine whether execution
999 of the stored inputs match the stored outputs of the @file{.ipynb} file. Whilst
1000 also ensuring that the notebooks are running without errors.")
1001 (license license:bsd-3)))
1003 (define-public python-pytest-flask
1005 (name "python-pytest-flask")
1010 (uri (pypi-uri "pytest-flask" version))
1013 "1hln7mwgdzfi5ma0kqfsi768l7p24jhkw8l0imhifwy08nh7hmjd"))))
1014 (build-system python-build-system)
1016 `(("python-flask" ,python-flask)
1017 ("python-pytest" ,python-pytest)
1018 ("python-setuptools-scm" ,python-setuptools-scm)
1019 ("python-werkzeug" ,python-werkzeug)))
1020 (home-page "https://github.com/pytest-dev/pytest-flask")
1021 (synopsis "Pytest fixtures to test Flask applications")
1023 "This pytest plugin provides fixtures to simplify Flask app testing.")
1024 (license license:expat)))
1026 (define-public python-pytest-env
1028 (name "python-pytest-env")
1033 (uri (pypi-uri "pytest-env" version))
1035 (base32 "1hl0ln0cicdid4qjk7mv90lw9xkb0v71dlj7q7rn89vzxxm9b53y"))))
1036 (build-system python-build-system)
1038 `(("python-pytest" ,python-pytest)))
1039 (home-page "https://github.com/MobileDynasty/pytest-env")
1040 (synopsis "Pytest plugin that allows you to add environment variables")
1042 "This is a @code{py.test} plugin that enables you to set environment
1043 variables in the @file{pytest.ini} file.")
1044 (license license:expat)))
1046 (define-public python-pyux
1048 (name "python-pyux")
1053 (uri (pypi-uri "pyux" version))
1056 "1i17xh4dy238ibrjdgh8vn78fk5q6dj37mcznpvdfzidj57js7ca"))))
1057 (build-system python-build-system)
1059 `(#:tests? #f)) ;the mini test suite fails
1060 (home-page "https://github.com/farizrahman4u/pyux")
1061 (synopsis "Utility to check API integrity in Python libraries")
1062 (description "The pyux utility detects API changes in Python
1064 (license license:expat)))
1066 (define-public python-codacy-coverage
1068 (name "python-codacy-coverage")
1073 (uri (pypi-uri "codacy-coverage" version))
1076 "1g0c0w56xdkmqb8slacyw5qhzrkp814ng3ddh2lkiij58y9m2imr"))))
1077 (build-system python-build-system)
1079 `(#:tests? #f)); no tests
1081 `(("python-check-manifest" ,python-check-manifest)))
1082 (home-page "https://github.com/codacy/python-codacy-coverage")
1083 (synopsis "Codacy coverage reporter for Python")
1084 (description "This package analyses Python test suites and reports how much
1085 of the code is covered by them. This tool is part of the Codacy suite for
1086 analysing code quality.")
1087 (license license:expat)))
1089 (define-public python-httmock
1091 (name "python-httmock")
1096 (uri (pypi-uri "httmock" version))
1099 "1zj1fcm0n6f0wr9mr0hmlqz9430fnr5cdwd5jkcvq9j44bnsrfz0"))))
1100 (build-system python-build-system)
1102 `(#:tests? #f)); no tests
1104 `(("python-requests" ,python-requests)))
1105 (home-page "https://github.com/patrys/httmock")
1106 (synopsis "Mocking library for requests.")
1107 (description "This package provides a library for replying fake data to
1108 Python software under test, when they make an HTTP query.")
1109 (license license:asl2.0)))
1111 (define-public python-atpublic
1113 (name "python-atpublic")
1118 (uri (pypi-uri "atpublic" version))
1121 "0i3sbxkdlbb4560rrlmwwd5y4ps7k73lp4d8wnmd7ag9k426gjkx"))))
1122 (build-system python-build-system)
1125 (modify-phases %standard-phases
1126 (add-before 'build 'enable-c-implementation
1128 (setenv "ATPUBLIC_BUILD_EXTENSION" "yes")
1132 (invoke "python" "-m" "nose2" "-v"))))))
1134 `(("python-nose2" ,python-nose2)))
1135 (home-page "https://public.readthedocs.io/")
1136 (synopsis "@code{@@public} decorator for populating @code{__all__}")
1138 "This Python module adds a @code{@@public} decorator and function which
1139 populates a module's @code{__all__} and optionally the module globals. With
1140 it, the declaration of a name's public export semantics are not separated from
1141 the implementation of that name.")
1142 (license (list license:asl2.0
1143 license:lgpl3)))) ; only for setup_helpers.py
1145 (define-public python-mypy-extensions
1147 (name "python-mypy-extensions")
1152 (uri (pypi-uri "mypy_extensions" version))
1155 "1a04qsk8hd1lqns8w1j7cr0vmvbhg450di5k1i16kqxkbf7q30id"))))
1156 (build-system python-build-system)
1157 (arguments `(#:tests? #f)); no tests
1158 (home-page "https://github.com/python/mypy_extensions")
1159 (synopsis "Experimental extensions for MyPy")
1160 (description "The @code{python-mypy-extensions} module defines
1161 experimental extensions to the standard @code{typing} module that are
1162 supported by the MyPy typechecker.")
1163 (license license:expat)))
1165 (define-public python-mypy
1167 (name "python-mypy")
1171 ;; Because of https://github.com/python/mypy/issues/9584, the
1172 ;; mypyc/analysis directory is missing in the PyPI archive, leading to
1176 (url "https://github.com/python/mypy")
1177 (commit (string-append "v" version))
1178 ;; Fetch git submodules otherwise typeshed is not fetched.
1179 ;; Typeshed is a collection of Python sources type annotation
1182 (file-name (git-file-name name version))
1185 "0zq3lpdf9hphcklk40wz444h8w3dkhwa12mqba5j9lmg11klnhz7"))))
1186 (build-system python-build-system)
1189 (modify-phases %standard-phases
1192 (invoke "pytest" "mypyc"))))))
1194 `(("python-attrs" ,python-attrs)
1195 ("python-flake8" ,python-flake8)
1196 ("python-flake8-bugbear" ,python-flake8-bugbear)
1197 ("python-flake8-pyi" ,python-flake8-pyi)
1198 ("python-importlib-metadata" ,python-importlib-metadata)
1199 ("python-lxml" ,python-lxml)
1200 ("python-psutil" ,python-psutil)
1201 ("python-pytest" ,python-pytest-6)
1202 ("python-pytest-cov" ,python-pytest-cov)
1203 ("python-pytest-forked" ,python-pytest-forked)
1204 ("python-pytest-xdist" ,python-pytest-xdist)
1205 ("python-virtualenv" ,python-virtualenv)))
1207 `(("python-mypy-extensions" ,python-mypy-extensions)
1208 ("python-typing-extensions" ,python-typing-extensions)
1209 ("python-typed-ast" ,python-typed-ast)))
1210 (home-page "http://www.mypy-lang.org/")
1211 (synopsis "Static type checker for Python")
1212 (description "Mypy is an optional static type checker for Python that aims
1213 to combine the benefits of dynamic (or 'duck') typing and static typing. Mypy combines
1214 the expressive power and convenience of Python with a powerful type system and
1215 compile-time type checking. Mypy type checks standard Python programs; run them using
1216 any Python VM with basically no runtime overhead.")
1217 ;; Most of the code is under MIT license; Some files are under Python Software
1218 ;; Foundation License version 2: stdlib-samples/*, mypyc/lib-rt/pythonsupport.h and
1219 ;; mypyc/lib-rt/getargs.c
1220 (license (list license:expat license:psfl))))
1222 (define-public python-pyannotate
1224 (name "python-pyannotate")
1229 (uri (pypi-uri "pyannotate" version))
1232 "16bm0mf7wxvy0lgmcs1p8n1ji8pnvj1jvj8zk3am70dkp825iv84"))))
1233 (build-system python-build-system)
1235 `(("python-mypy-extensions" ,python-mypy-extensions)
1236 ("python-six" ,python-six)))
1238 "https://github.com/dropbox/pyannotate")
1239 (synopsis "Auto-generate PEP-484 annotations")
1240 (description "This package, PyAnnotate, is used to auto-generate PEP-484
1242 (license license:asl2.0)))
1244 (define-public python-eradicate
1246 (name "python-eradicate")
1251 (uri (pypi-uri "eradicate" version))
1254 "1j30g9jfmbfki383qxwrfds8b23yiwywj40lng4lqcf5yab4ahr7"))))
1255 (build-system python-build-system)
1256 (home-page "https://github.com/myint/eradicate")
1257 (synopsis "Remove commented-out code from Python sources")
1258 (description "The @command{eradicate} command removes commented-out code
1259 from Python files. It does this by detecting block comments that contain
1260 valid Python syntax that are likely to be commented out code.")
1261 (license license:expat)))
1263 (define-public python-robber
1265 (name "python-robber")
1269 (uri (pypi-uri "robber" version))
1272 "0xp5csgv2g9q38hscml6bc5i1nm4xy5lzqqiimm2drxsf0hw2nq5"))))
1273 (build-system python-build-system)
1274 ;; There are no tests in the tarball downloaded from PyPI.
1275 ;; The last version tagged in Github (0.1.0) is older than the one on PyPI.
1276 ;; Reported upstream: <https://github.com/vesln/robber.py/issues/20>.
1277 (arguments '(#:tests? #f))
1279 `(("python-mock" ,python-mock)
1280 ("python-termcolor" ,python-termcolor)))
1281 ;; URL of the fork used to generate the package available on PyPI.
1282 (home-page "https://github.com/EastAgile/robber.py")
1283 (synopsis "Test-driven development (TDD) assertion library for Python")
1284 (description "Robber is a Python assertion library for test-driven and
1285 behavior-driven development (TDD and BDD).")
1286 (license license:expat)))
1288 (define-public python-stestr
1290 (name "python-stestr")
1295 (uri (pypi-uri "stestr" version))
1298 "0adhqp9c9338wlvlq776k57k04lyxp38bv591afdm9gjsn2qn1zm"))))
1299 (build-system python-build-system)
1301 `(#:tests? #f)) ;to avoid circular dependencies
1303 `(("python-pbr" ,python-pbr)))
1305 `(("python-cliff" ,python-cliff)
1306 ("python-fixtures" ,python-fixtures)
1307 ("python-future" ,python-future)
1308 ("python-pyyaml" ,python-pyyaml)
1309 ("python-subunit" ,python-subunit)
1310 ("python-testtools" ,python-testtools)
1311 ("python-voluptuous" ,python-voluptuous)))
1312 (home-page "https://stestr.readthedocs.io/en/latest/")
1313 (synopsis "Parallel Python test runner")
1314 (description "This package provides the @command{stestr} command, a
1315 parallel Python test runner built around @code{subunit}. It is designed to
1316 execute @code{unittest} test suites using multiple processes to split up
1317 execution of a test suite. It will also store a history of all test runs to
1318 help in debugging failures and optimizing the scheduler to improve speed.")
1319 (license license:asl2.0)))
1321 ;; This is only used by python-sanic
1322 (define-public python-pytest-sanic
1324 (name "python-pytest-sanic")
1328 (uri (pypi-uri "pytest-sanic" version))
1331 "0hm7im77dgqfk8k34qbbfhimg8hifl4zwpa2s3mgbknrjvyw5qpx"))))
1332 (build-system python-build-system)
1334 ;; Tests depend on python-sanic.
1337 `(("python-httpx" ,python-httpx)
1338 ("python-async-generator"
1339 ,python-async-generator)
1340 ("python-pytest" ,python-pytest)
1341 ("python-websockets" ,python-websockets)))
1343 "https://github.com/yunstanford/pytest-sanic")
1344 (synopsis "Pytest plugin for Sanic")
1345 (description "A pytest plugin for Sanic. It helps you to test your
1346 code asynchronously.")
1347 (license license:expat)))
1349 (define-public python-allpairspy
1351 (name "python-allpairspy")
1356 (uri (pypi-uri "allpairspy" version))
1358 (base32 "1c987h13dly9919d15w3h747rgn50ilnv7dginhlprxbj564hn4k"))))
1359 (build-system python-build-system)
1361 `(("python-pytest" ,python-pytest)
1362 ("python-pytest-runner" ,python-pytest-runner)))
1363 (home-page "https://github.com/thombashi/allpairspy")
1364 (synopsis "Pairwise test combinations generator")
1366 "This is a Python library for test combinations generator. The generator
1367 allows one to create a set of tests using @emph{pairwise combinations} method,
1368 reducing a number of combinations of variables into a lesser set that covers
1370 (license license:expat)))