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 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>
13 ;;; This file is part of GNU Guix.
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28 (define-module (gnu packages python-check)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages check)
31 #:use-module (gnu packages openstack)
32 #:use-module (gnu packages python-web)
33 #:use-module (gnu packages python-xyz)
34 #:use-module (gnu packages web)
35 #:use-module (gnu packages xml)
36 #:use-module (guix utils)
37 #:use-module ((guix licenses) #:prefix license:)
38 #:use-module (guix packages)
39 #:use-module (guix git-download)
40 #:use-module (guix download)
41 #:use-module (guix build-system python))
43 (define-public python-coveralls
45 (name "python-coveralls")
47 (home-page "https://github.com/coveralls-clients/coveralls-python")
50 ;; The PyPI release lacks tests, so we pull from git instead.
52 (uri (git-reference (url home-page) (commit version)))
53 (file-name (git-file-name name version))
56 "1zr1lqdjcfwj6wcx2449mzzjq8bbhwnqcm5vdif5s8hlz35bjxkp"))))
57 (build-system python-build-system)
59 '(#:phases (modify-phases %standard-phases
60 (add-before 'check 'disable-git-test
62 ;; Remove test that requires 'git' and the full checkout.
63 (delete-file "tests/git_test.py")
66 (lambda* (#:key tests? #:allow-other-keys)
68 (invoke "pytest" "-vv")
69 (format #t "test suite not run~%"))
72 `(("python-coverage" ,python-coverage)
73 ("python-docopt" ,python-docopt)
74 ("python-pyyaml" ,python-pyyaml)
75 ("python-requests" ,python-requests)))
77 `(("python-mock" ,python-mock)
78 ("python-pytest" ,python-pytest)))
79 (synopsis "Show coverage stats online via coveralls.io")
81 "Coveralls.io is a service for publishing code coverage statistics online.
82 This package provides seamless integration with coverage.py (and thus pytest,
83 nosetests, etc...) in Python projects.")
84 (license license:expat)))
86 (define-public python-junit-xml
87 ;; XXX: There are no tags or PyPI releases, so take the latest commit
88 ;; and use the version defined in setup.py.
90 (commit "4bd08a272f059998cedf9b7779f944d49eba13a6")
93 (name "python-junit-xml")
94 (version (git-version version revision commit))
95 (home-page "https://github.com/kyrus/python-junit-xml")
98 (uri (git-reference (url home-page) (commit commit)))
99 (file-name (git-file-name name version))
102 "0b8kbjhk3j10rk0vcniy695m3h43yip6y93h1bd6jjh0cp7s09c7"))))
103 (build-system python-build-system)
105 `(#:phases (modify-phases %standard-phases
108 (invoke "pytest" "-vv"))))))
110 `(("python-pytest" ,python-pytest)))
112 `(("python-six" ,python-six)))
113 (synopsis "Create JUnit XML test results")
115 "This package provides a Python module for creating JUnit XML test
116 result documents that can be read by tools such as Jenkins or Bamboo.")
117 (license license:expat))))
119 (define-public python-vcrpy
121 (name "python-vcrpy")
126 (uri (pypi-uri "vcrpy" version))
129 "0kws7l3hci1dvjv01nxw3805q9v2mwldw58bgl8s90wqism69gjp"))))
130 (build-system python-build-system)
131 (arguments `(#:tests? #f)) ; tests require more packages for python-pytest-httpbin
133 `(("python-pyyaml" ,python-pyyaml)
134 ("python-six" ,python-six)
135 ("python-wrapt" ,python-wrapt)
136 ("python-yarl" ,python-yarl)))
138 `(("python-mock" ,python-mock)
139 ("python-pytest" ,python-pytest)
140 ("python-pytest-httpbin" ,python-pytest-httpbin)))
141 (home-page "https://github.com/kevin1024/vcrpy")
142 (synopsis "Automatically mock your HTTP interactions")
144 "VCR.py simplifies and speeds up tests that make HTTP requests. The first
145 time you run code that is inside a VCR.py context manager or decorated function,
146 VCR.py records all HTTP interactions that take place through the libraries it
147 supports and serializes and writes them to a flat file (in yaml format by
148 default). This flat file is called a cassette. When the relevant piece of code
149 is executed again, VCR.py will read the serialized requests and responses from
150 the aforementioned cassette file, and intercept any HTTP requests that it
151 recognizes from the original test run and return the responses that corresponded
152 to those requests. This means that the requests will not actually result in
153 HTTP traffic, which confers several benefits including:
155 @item The ability to work offline
156 @item Completely deterministic tests
157 @item Increased test execution speed
159 If the server you are testing against ever changes its API, all you need to do
160 is delete your existing cassette files, and run your tests again. VCR.py will
161 detect the absence of a cassette file and once again record all HTTP
162 interactions, which will update them to correspond to the new API.")
163 (license license:expat)))
165 (define-public python-pytest-ordering
167 (name "python-pytest-ordering")
171 ;; No tests in the PyPI tarball.
174 (url "https://github.com/ftobia/pytest-ordering")
176 (file-name (git-file-name name version))
178 (base32 "14msj5gyqza0gk3x7h1ivmjrwza82v84cj7jx3ks0fw9lpin7pjq"))))
179 (build-system python-build-system)
182 (modify-phases %standard-phases
184 (lambda* (#:key inputs outputs #:allow-other-keys)
185 (add-installed-pythonpath inputs outputs)
186 (invoke "pytest" "-vv" "-k"
187 ;; This test fails because of a type mismatch of an
188 ;; argument passed to @code{pytest.main}.
189 "not test_run_marker_registered"))))))
191 `(("python-pytest" ,python-pytest)))
192 (home-page "https://github.com/ftobia/pytest-ordering")
193 (synopsis "Pytest plugin to run your tests in a specific order")
195 "This plugin defines Pytest markers to ensure that some tests, or groups
196 of tests run in a specific order.")
197 (license license:expat)))
199 (define-public python-pytest-arraydiff
201 (name "python-pytest-arraydiff")
206 (uri (pypi-uri "pytest-arraydiff" version))
208 (base32 "05bcvhh2ycxa35znl8b3l9vkcmx7vwm5c3fpakbpw46c7vsn4bfy"))))
209 (build-system python-build-system)
211 ;; Tests require python-astropy, which itself requires this package.
212 ;; Disable tests to avoid the circular dependency problem.
215 `(("python-numpy" ,python-numpy)
216 ("python-six" ,python-six)))
217 (home-page "https://github.com/astropy/pytest-arraydiff")
218 (synopsis "Pytest plugin to help with comparing array output from tests")
220 "This is a py.test plugin to facilitate the generation and comparison of
221 data arrays produced during tests, in particular in cases where the arrays
222 are too large to conveniently hard-code them in the tests.")
223 (license license:bsd-3)))
225 (define-public python-pytest-doctestplus
227 (name "python-pytest-doctestplus")
232 (uri (pypi-uri "pytest-doctestplus" version))
234 (base32 "1ai9kvd7xbq2jg2h8gmkb8lqzyrxvdh4zg3vxndg149iwd1hyi7d"))))
235 (build-system python-build-system)
238 (modify-phases %standard-phases
240 (lambda* (#:key inputs outputs #:allow-other-keys)
241 ;; Make the installed plugin discoverable by Pytest.
242 (add-installed-pythonpath inputs outputs)
243 (invoke "pytest" "-vv"))))))
245 `(("python-pytest" ,python-pytest)))
246 (home-page "https://github.com/astropy/pytest-doctestplus")
247 (synopsis "Pytest plugin with advanced doctest features")
249 "This package contains a plugin for the Pytest framework that provides
250 advanced doctest support and enables the testing of reStructuredText files.")
251 (license license:bsd-3)))
253 (define-public python-pytest-filter-subpackage
255 (name "python-pytest-filter-subpackage")
260 (uri (pypi-uri "pytest-filter-subpackage" version))
262 (base32 "1s4s2kd31yc65rfvl4xhy8xx806xhy59kc7668h6b6wq88xgrn5p"))))
263 (build-system python-build-system)
265 '(;; One test is failing. There's an issue reported upstream. See
266 ;; https://github.com/astropy/pytest-filter-subpackage/issues/3.
267 ;; Disable it for now.
269 (modify-phases %standard-phases
271 (lambda* (#:key inputs outputs #:allow-other-keys)
272 ;; Make the installed plugin discoverable by Pytest.
273 (add-installed-pythonpath inputs outputs)
274 (invoke "pytest" "-vv" "-k" "not test_with_rst"))))))
276 `(("python-pytest" ,python-pytest)
277 ("python-pytest-cov" ,python-pytest-cov)
278 ("python-pytest-doctestplus"
279 ,python-pytest-doctestplus)))
280 (home-page "https://github.com/astropy/pytest-filter-subpackage")
281 (synopsis "Pytest plugin for filtering based on sub-packages")
283 "This package contains a simple plugin for the pytest framework that
284 provides a shortcut to testing all code and documentation for a given
286 (license license:bsd-3)))
288 (define-public python-pytest-openfiles
290 (name "python-pytest-openfiles")
295 (uri (pypi-uri "pytest-openfiles" version))
297 (base32 "0n0a7fdc9m86360y96l23fvdmd6rw04bl6h5xqgl9qxfv08jk70p"))))
298 (build-system python-build-system)
301 (modify-phases %standard-phases
303 (lambda* (#:key inputs outputs #:allow-other-keys)
304 ;; Make the installed plugin discoverable by Pytest.
305 (add-installed-pythonpath inputs outputs)
306 (invoke "pytest" "-vv"))))))
308 `(("python-setuptools-scm" ,python-setuptools-scm)
309 ("python-pytest" ,python-pytest)))
311 `(("python-psutil" ,python-psutil)))
312 (home-page "https://github.com/astropy/pytest-openfiles")
313 (synopsis "Pytest plugin for detecting inadvertent open file handles")
315 "This package provides a plugin for the pytest framework that allows
316 developers to detect whether any file handles or other file-like objects
317 were inadvertently left open at the end of a unit test.")
318 (license license:bsd-3)))
320 (define-public python-pytest-remotedata
322 (name "python-pytest-remotedata")
327 (uri (pypi-uri "pytest-remotedata" version))
329 (base32 "1h6g6shib6z07azf12rnsa053470ggbd7hy3bnbw8nf3nza5h372"))))
330 (build-system python-build-system)
333 (modify-phases %standard-phases
335 (lambda* (#:key inputs outputs #:allow-other-keys)
336 ;; Make the installed plugin discoverable by Pytest.
337 (add-installed-pythonpath inputs outputs)
338 (invoke "pytest" "-vv" "-k"
340 ;; These tests require internet access. Disable them.
341 "not test_default_behavior"
342 " and not test_strict_with_decorator")))))))
344 `(("python-pytest" ,python-pytest)))
346 `(("python-six" ,python-six)))
347 (home-page "https://github.com/astropy/pytest-remotedata")
348 (synopsis "Pytest plugin for controlling remote data access")
350 "This package provides a plugin for the Pytest framework that allows
351 developers to control unit tests that require access to data from the
353 (license license:bsd-3)))
355 (define-public python-pytest-mpl
357 (name "python-pytest-mpl")
362 (uri (pypi-uri "pytest-mpl" version))
364 (base32 "1km202c1s5kcn52fx0266p06qb34va3warcby594dh6vixxa9i96"))))
365 (build-system python-build-system)
368 (modify-phases %standard-phases
371 (invoke "pytest" "-vv"))))))
373 `(("python-pytest" ,python-pytest)))
375 `(("python-matplotlib" ,python-matplotlib)
376 ("python-pillow" ,python-pillow)))
377 (home-page "https://github.com/matplotlib/pytest-mpl")
378 (synopsis "Pytest plugin to help with testing figures output from Matplotlib")
380 "This is a plugin to facilitate image comparison for Matplotlib figures
382 (license license:bsd-3)))
384 (define-public python-covdefaults
386 (name "python-covdefaults")
390 ;; The PyPI tarball does not include tests.
393 (url "https://github.com/asottile/covdefaults")
394 (commit (string-append "v" version))))
395 (file-name (git-file-name name version))
397 (base32 "11a24c0wzv01n55fy4kdpnyqna4m9k0mp58kmhiaks34xw4k37hq"))))
398 (build-system python-build-system)
401 (modify-phases %standard-phases
404 (invoke "pytest" "-vv"))))))
406 `(("python-coverage" ,python-coverage)
407 ("python-pytest" ,python-pytest)))
408 (home-page "https://github.com/asottile/covdefaults")
409 (synopsis "Coverage plugin to provide opinionated default settings")
411 "Covdefaults is a coverage plugin to provide opinionated default
413 (license license:expat)))
415 (define-public python-pytest-vcr
416 ;; This commit fixes integration with pytest-5
417 (let ((commit "4d6c7b3e379a6a7cba0b8f9d20b704dc976e9f05")
420 (name "python-pytest-vcr")
421 (version (git-version "1.0.2" revision commit))
426 (url "https://github.com/ktosiek/pytest-vcr")
428 (file-name (git-file-name name version))
431 "1yk988zi0la6zpcm3fff0mxf942di2jiymrfqas19nyngj5ygaqs"))))
432 (build-system python-build-system)
435 (modify-phases %standard-phases
437 (lambda* (#:key inputs outputs #:allow-other-keys)
438 (add-installed-pythonpath inputs outputs)
439 (invoke "pytest" "tests/"))))))
441 `(("python-pytest" ,python-pytest)
442 ("python-vcrpy" ,python-vcrpy)))
443 (home-page "https://github.com/ktosiek/pytest-vcr")
444 (synopsis "Plugin for managing VCR.py cassettes")
446 "Plugin for managing VCR.py cassettes.")
447 (license license:expat))))
449 (define-public python-pytest-checkdocs
451 (name "python-pytest-checkdocs")
456 (uri (pypi-uri "pytest-checkdocs" version))
458 (base32 "0j6j1gvj6x451y3qsx4xbaq9p1w9gg3mwk7n0w80cy8vdyjkngb0"))))
459 (build-system python-build-system)
461 `(("python-docutils" ,python-docutils)
462 ("python-importlib-metadata" ,python-importlib-metadata)
463 ("python-more-itertools" ,python-more-itertools)))
465 `(("python-setuptools-scm" ,python-setuptools-scm)))
466 (home-page "https://github.com/jaraco/pytest-checkdocs")
467 (synopsis "Check the README when running tests")
469 "This package provides a pytest plugin that checks the long description
470 of the project to ensure it renders properly.")
471 (license license:expat)))
473 (define-public python-re-assert
475 (name "python-re-assert")
479 ;; There are no tests in the PyPI tarball.
482 (url "https://github.com/asottile/re-assert")
483 (commit (string-append "v" version))))
484 (file-name (git-file-name name version))
486 (base32 "1rssq4wpqmx1c17hjfx5l3sn3zmnlz9jffddiqrs4f6h7m6cadai"))))
487 (build-system python-build-system)
490 (modify-phases %standard-phases
493 (invoke "pytest" "-vv"))))))
495 `(("python-covdefaults" ,python-covdefaults)
496 ("python-coverage" ,python-coverage)
497 ("python-pytest" ,python-pytest)))
499 `(("python-regex" ,python-regex)))
500 (home-page "https://github.com/asottile/re-assert")
501 (synopsis "Show where your regex match assertion failed")
503 "@code{re-assert} provides a helper class to make assertions of regexes
505 (license license:expat)))
507 (define-public python-pytest-trio
509 (name "python-pytest-trio")
514 (uri (pypi-uri "pytest-trio" version))
516 (base32 "1zm8didm9h5jkqhghl9bvqs7kr7sjci282c7grhk6yhpzn8a9w4v"))))
517 (build-system python-build-system)
520 (modify-phases %standard-phases
522 (lambda* (#:key inputs outputs #:allow-other-keys)
523 (add-installed-pythonpath inputs outputs)
524 (invoke "pytest" "-W" "error" "-ra" "-v" "--pyargs"
525 "pytest_trio" "--verbose" "--cov"))))))
527 `(("python-hypothesis" ,python-hypothesis)
528 ("python-pytest" ,python-pytest)
529 ("python-pytest-cov" ,python-pytest-cov)))
531 `(("python-trio" ,python-trio)))
532 (home-page "https://github.com/python-trio/pytest-trio")
533 (synopsis "Pytest plugin for trio")
535 "This is a pytest plugin to help you test projects that use Trio, a
536 friendly library for concurrency and async I/O in Python.")
537 ;; Either license applies.
538 (license (list license:expat license:asl2.0))))
540 (define-public python-pytest-flake8
542 (name "python-pytest-flake8")
547 (uri (pypi-uri "pytest-flake8" version))
550 "09vhn7r77s1yiqnlwfvh5585f904zpyd6620a90dpccfr1cbp0hv"))))
551 (build-system python-build-system)
553 `(("python-flake8" ,python-flake8)))
555 `(("python-pytest" ,python-pytest)))
556 (home-page "https://github.com/tholo/pytest-flake8")
557 (synopsis "Pytest plugin to check FLAKE8 requirements")
559 "This package provides a pytest plugin for efficiently checking PEP8
561 (license license:bsd-3)))
563 (define-public python-pytest-isort
565 (name "python-pytest-isort")
570 (uri (pypi-uri "pytest-isort" version))
572 (base32 "06myn5hhxs5yp8dqr1yjsgcnnxnsrvsqannm00bvaw0qml6ydzjb"))))
573 (build-system python-build-system)
576 (modify-phases %standard-phases
580 (string-append (getcwd) ":"
581 (getenv "PYTHONPATH")))
582 (invoke "pytest"))))))
584 `(("python-isort" ,python-isort)
585 ("python-pytest" ,python-pytest)))
586 (home-page "https://github.com/moccu/pytest-isort/")
587 (synopsis "Pytest plugin to check import ordering using isort")
589 "This package provides a pytest plugin to check import ordering using
591 (license license:bsd-3)))
593 (define-public python-pytest-shutil
595 (name "python-pytest-shutil")
600 (uri (pypi-uri "pytest-shutil" version))
603 "0q8j0ayzmnvlraml6i977ybdq4xi096djhf30n2m1rvnvrhm45nq"))))
604 (build-system python-build-system)
607 (modify-phases %standard-phases
608 (add-after 'unpack 'patch-tests
611 (substitute* "tests/integration/test_cmdline_integration.py"
612 (("dirname = '/bin'")
613 "dirname = '/tmp/bin'")
614 (("bindir = os.path.realpath\\('/bin'\\)")
615 "bindir = os.path.realpath('/tmp/bin')"))
618 `(("python-contextlib2" ,python-contextlib2)
619 ("python-execnet" ,python-execnet)
620 ("python-pathpy" ,python-pathpy)
621 ("python-termcolor" ,python-termcolor)))
623 `(("python-mock" ,python-mock)
624 ("python-pytest" ,python-pytest)
625 ("python-setuptools-git" ,python-setuptools-git)))
626 (home-page "https://github.com/manahl/pytest-plugins")
627 (synopsis "Assorted shell and environment tools for py.test")
629 "This package provides assorted shell and environment tools for the
630 py.test testing framework.")
631 (license license:expat)))
633 (define-public python-pytest-fixture-config
635 (name "python-pytest-fixture-config")
640 (uri (pypi-uri "pytest-fixture-config" version))
643 "13i1qpz22w3x4dmw8vih5jdnbqfqvl7jiqs0dg764s0zf8bp98a1"))))
644 (build-system python-build-system)
646 `(("python-pytest" ,python-pytest)
647 ("python-setuptools-git" ,python-setuptools-git)))
648 (home-page "https://github.com/manahl/pytest-plugins")
649 (synopsis "Fixture configuration utils for py.test")
651 "This package provides fixture configuration utilities for the py.test
653 (license license:expat)))
655 (define-public python-pytest-virtualenv
657 (name "python-pytest-virtualenv")
662 (uri (pypi-uri "pytest-virtualenv" version))
665 "03w2zz3crblj1p6i8nq17946hbn3zqp9z7cfnifw47hi4a4fww12"))))
666 (build-system python-build-system)
669 (modify-phases %standard-phases
670 ;; Reference the virtualenv executable directly, to avoid the need
671 ;; for PYTHONPATH, which gets cleared when instantiating a new
672 ;; virtualenv with pytest-virtualenv.
673 (add-after 'unpack 'patch-virtualenv-executable
674 (lambda* (#:key inputs #:allow-other-keys)
675 (let* ((virtualenv (assoc-ref inputs "python-virtualenv"))
676 (virtualenv-bin (string-append virtualenv
678 (substitute* "pytest_virtualenv.py"
679 (("^DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE.*$")
680 (format #f "DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE = '~a'"
684 `(("python-pytest-shutil" ,python-pytest-shutil)
685 ("python-pytest-fixture-config" ,python-pytest-fixture-config)))
687 `(("python-virtualenv" ,python-virtualenv)))
689 `(("python-mock" ,python-mock)
690 ("python-pytest" ,python-pytest)
691 ("python-setuptools-git" ,python-setuptools-git)))
692 (home-page "https://github.com/manahl/pytest-plugins")
693 (synopsis "Virtualenv fixture for py.test")
694 (description "This package provides a virtualenv fixture for the py.test
696 (license license:expat)))
698 (define-public python-pytest-pycodestyle
700 (name "python-pytest-pycodestyle")
701 (version "2.0.0") ;later versions require python-pytest~=5.4
705 (uri (pypi-uri "pytest-pycodestyle" version))
708 "02i5gl7pm9cwxk15sn29inz3n8flpj1r3p1l110h43f2na5w8h7z"))))
709 (build-system python-build-system)
711 `(("python-pycodestyle" ,python-pycodestyle)))
713 `(("python-pytest" ,python-pytest)))
714 (home-page "https://github.com/henry0312/pytest-pycodestyle")
715 (synopsis "Pytest plugin to run pycodestyle")
716 (description "This package provides a plugin to run @code{pycodestyle}
717 for the @code{pytest} framework.")
718 (license license:expat)))
720 (define-public python-pytest-benchmark
722 (name "python-pytest-benchmark")
727 (uri (pypi-uri "pytest-benchmark" version))
730 "0a4mpb4j73dsyk47hd1prrjpfk4r458s102cn80rf253jg818hxd"))))
731 (build-system python-build-system)
733 `(("python-py-cpuinfo" ,python-py-cpuinfo)))
735 `(("python-pathlib2" ,python-pathlib2)
736 ("python-pytest" ,python-pytest)))
737 (home-page "https://github.com/ionelmc/pytest-benchmark")
738 (synopsis "Pytest fixture for benchmarking code")
740 "This package provides a pytest fixture that will group the tests into
741 rounds that are calibrated to the chosen timer.")
742 (license license:bsd-2)))
744 (define-public python-pytest-services
746 (name "python-pytest-services")
751 (uri (pypi-uri "pytest-services" version))
754 "0b2zfv04w6m3gp2v44ifdhx22vcji069qnn95ry3zcyxib7cjnq3"))))
755 (build-system python-build-system)
756 (arguments '(#:tests? #f)) ; Tests not included in release tarball.
758 `(("python-psutil" ,python-psutil)
759 ("python-requests" ,python-requests)))
761 `(("python-pytest" ,python-pytest)))
762 (home-page "https://github.com/pytest-dev/pytest-services")
763 (synopsis "Services plugin for pytest testing framework")
765 "This plugin provides a set of fixtures and utility functions to start
766 service processes for your tests with pytest.")
767 (license license:expat)))
769 (define-public python-pytest-toolbox
771 (name "python-pytest-toolbox")
775 ;; No tests in the PyPI tarball.
778 (url "https://github.com/samuelcolvin/pytest-toolbox")
779 (commit (string-append "v" version))))
780 (file-name (git-file-name name version))
782 (base32 "1wqkr3g5gmqdxmhzfsxbwy8pm3cadaj6a8cxq58w9bacly4hqbh0"))))
783 (build-system python-build-system)
786 (modify-phases %standard-phases
788 (lambda* (#:key inputs outputs #:allow-other-keys)
789 ;; Make the installed plugin discoverable by Pytest.
790 (add-installed-pythonpath inputs outputs)
791 (invoke "pytest" "-vv"))))))
793 `(("python-coverage" ,python-coverage)
794 ("python-docutils" ,python-docutils)
795 ("python-flake8" ,python-flake8)
796 ("python-isort" ,python-isort)
797 ("python-pydantic" ,python-pydantic)
798 ("python-pyflakes" ,python-pyflakes)
799 ("python-pygments" ,python-pygments)
800 ("python-pytest" ,python-pytest)
801 ("python-pytest-cov" ,python-pytest-cov)
802 ("python-pytest-isort" ,python-pytest-isort)
803 ("python-pytest-mock" ,python-pytest-mock)
804 ("python-pytest-sugar" ,python-pytest-sugar)))
805 (home-page "https://github.com/samuelcolvin/pytest-toolbox")
806 (synopsis "Numerous useful plugins for Pytest")
808 "Pytest Toolbox contains many useful plugins for Pytest. Among them are
809 new fixtures, new methods and new comparison objects.")
810 (license license:expat)))
812 (define-public python-pytest-aiohttp
814 (name "python-pytest-aiohttp")
819 (uri (pypi-uri "pytest-aiohttp" version))
822 "0kx4mbs9bflycd8x9af0idcjhdgnzri3nw1qb0vpfyb3751qaaf9"))))
823 (build-system python-build-system)
825 `(("python-pytest" ,python-pytest)))
827 `(("python-aiohttp" ,python-aiohttp)))
828 (home-page "https://github.com/aio-libs/pytest-aiohttp/")
829 (synopsis "Pytest plugin for aiohttp support")
830 (description "This package provides a pytest plugin for aiohttp support.")
831 (license license:asl2.0)))
833 (define-public python-nbval
835 (name "python-nbval")
840 (uri (pypi-uri "nbval" version))
842 (base32 "0h3xrnw0mj1srigrx2rfnd73h8s0xjycclmjs0vx7qkfyqpcvvyg"))))
843 (build-system python-build-system)
846 (modify-phases %standard-phases
847 (add-before 'check 'fix-test
849 ;; This test fails because of a mismatch in the output of LaTeX
850 ;; equation environments. Seems OK to skip.
851 (delete-file "tests/ipynb-test-samples/test-latex-pass-correctouput.ipynb")
854 (lambda* (#:key inputs outputs #:allow-other-keys)
855 (add-installed-pythonpath inputs outputs)
856 (invoke "pytest" "-vv" "-k"
858 ;; This only works with Pytest < 5.
859 "not nbdime_reporter"
860 ;; https://github.com/computationalmodelling/nbval/pull/148.
861 " and not test_timeouts")))))))
863 `(("python-pytest" ,python-pytest)
864 ("python-pytest-cov" ,python-pytest-cov)
865 ("python-sympy" ,python-sympy)))
867 `(("python-ipykernel" ,python-ipykernel)
868 ("python-jupyter-client" ,python-jupyter-client)
869 ("python-nbformat" ,python-nbformat)
870 ("python-six" ,python-six)))
871 (home-page "https://github.com/computationalmodelling/nbval")
872 (synopsis "Pytest plugin to validate Jupyter notebooks")
874 "This plugin adds functionality to Pytest to recognise and collect Jupyter
875 notebooks. The intended purpose of the tests is to determine whether execution
876 of the stored inputs match the stored outputs of the @file{.ipynb} file. Whilst
877 also ensuring that the notebooks are running without errors.")
878 (license license:bsd-3)))
880 (define-public python-pytest-flask
882 (name "python-pytest-flask")
887 (uri (pypi-uri "pytest-flask" version))
890 "1hln7mwgdzfi5ma0kqfsi768l7p24jhkw8l0imhifwy08nh7hmjd"))))
891 (build-system python-build-system)
893 `(("python-flask" ,python-flask)
894 ("python-pytest" ,python-pytest)
895 ("python-setuptools-scm" ,python-setuptools-scm)
896 ("python-werkzeug" ,python-werkzeug)))
897 (home-page "https://github.com/pytest-dev/pytest-flask")
898 (synopsis "Pytest fixtures to test Flask applications")
900 "This pytest plugin provides fixtures to simplify Flask app testing.")
901 (license license:expat)))
903 (define-public python-pytest-env
905 (name "python-pytest-env")
910 (uri (pypi-uri "pytest-env" version))
912 (base32 "1hl0ln0cicdid4qjk7mv90lw9xkb0v71dlj7q7rn89vzxxm9b53y"))))
913 (build-system python-build-system)
915 `(("python-pytest" ,python-pytest)))
916 (home-page "https://github.com/MobileDynasty/pytest-env")
917 (synopsis "Pytest plugin that allows you to add environment variables")
919 "This is a @code{py.test} plugin that enables you to set environment
920 variables in the @file{pytest.ini} file.")
921 (license license:expat)))
923 (define-public python-pyux
930 (uri (pypi-uri "pyux" version))
933 "1i17xh4dy238ibrjdgh8vn78fk5q6dj37mcznpvdfzidj57js7ca"))))
934 (build-system python-build-system)
936 `(#:tests? #f)) ;the mini test suite fails
937 (home-page "https://github.com/farizrahman4u/pyux")
938 (synopsis "Utility to check API integrity in Python libraries")
939 (description "The pyux utility detects API changes in Python
941 (license license:expat)))
943 (define-public python-codacy-coverage
945 (name "python-codacy-coverage")
950 (uri (pypi-uri "codacy-coverage" version))
953 "1g0c0w56xdkmqb8slacyw5qhzrkp814ng3ddh2lkiij58y9m2imr"))))
954 (build-system python-build-system)
956 `(#:tests? #f)); no tests
958 `(("python-check-manifest" ,python-check-manifest)))
959 (home-page "https://github.com/codacy/python-codacy-coverage")
960 (synopsis "Codacy coverage reporter for Python")
961 (description "This package analyses Python test suites and reports how much
962 of the code is covered by them. This tool is part of the Codacy suite for
963 analysing code quality.")
964 (license license:expat)))
966 (define-public python-httmock
968 (name "python-httmock")
973 (uri (pypi-uri "httmock" version))
976 "1zj1fcm0n6f0wr9mr0hmlqz9430fnr5cdwd5jkcvq9j44bnsrfz0"))))
977 (build-system python-build-system)
979 `(#:tests? #f)); no tests
981 `(("python-requests" ,python-requests)))
982 (home-page "https://github.com/patrys/httmock")
983 (synopsis "Mocking library for requests.")
984 (description "This package provides a library for replying fake data to
985 Python software under test, when they make an HTTP query.")
986 (license license:asl2.0)))
988 (define-public python-atpublic
990 (name "python-atpublic")
995 (uri (pypi-uri "atpublic" version))
998 "0i3sbxkdlbb4560rrlmwwd5y4ps7k73lp4d8wnmd7ag9k426gjkx"))))
999 (build-system python-build-system)
1002 (modify-phases %standard-phases
1003 (add-before 'build 'enable-c-implementation
1005 (setenv "ATPUBLIC_BUILD_EXTENSION" "yes")
1009 (invoke "python" "-m" "nose2" "-v"))))))
1011 `(("python-nose2" ,python-nose2)))
1012 (home-page "https://public.readthedocs.io/")
1013 (synopsis "@code{@@public} decorator for populating @code{__all__}")
1015 "This Python module adds a @code{@@public} decorator and function which
1016 populates a module's @code{__all__} and optionally the module globals. With
1017 it, the declaration of a name's public export semantics are not separated from
1018 the implementation of that name.")
1019 (license (list license:asl2.0
1020 license:lgpl3)))) ; only for setup_helpers.py
1022 (define-public python-mypy-extensions
1024 (name "python-mypy-extensions")
1029 (uri (pypi-uri "mypy_extensions" version))
1032 "1a04qsk8hd1lqns8w1j7cr0vmvbhg450di5k1i16kqxkbf7q30id"))))
1033 (build-system python-build-system)
1034 (arguments `(#:tests? #f)); no tests
1035 (home-page "https://github.com/python/mypy_extensions")
1036 (synopsis "Experimental extensions for MyPy")
1037 (description "The @code{python-mypy-extensions} module defines
1038 experimental extensions to the standard @code{typing} module that are
1039 supported by the MyPy typechecker.")
1040 (license license:expat)))
1042 (define-public python-mypy
1044 (name "python-mypy")
1048 ;; Because of https://github.com/python/mypy/issues/9584, the
1049 ;; mypyc/analysis directory is missing in the PyPI archive, leading to
1053 (url "https://github.com/python/mypy")
1054 (commit (string-append "v" version))
1055 ;; Fetch git submodules otherwise typeshed is not fetched.
1056 ;; Typeshed is a collection of Python sources type annotation
1059 (file-name (git-file-name name version))
1062 "0zq3lpdf9hphcklk40wz444h8w3dkhwa12mqba5j9lmg11klnhz7"))))
1063 (build-system python-build-system)
1066 (modify-phases %standard-phases
1069 (invoke "pytest" "mypyc"))))))
1071 `(("python-attrs" ,python-attrs)
1072 ("python-flake8" ,python-flake8)
1073 ("python-flake8-bugbear" ,python-flake8-bugbear)
1074 ("python-flake8-pyi" ,python-flake8-pyi)
1075 ("python-importlib-metadata" ,python-importlib-metadata)
1076 ("python-lxml" ,python-lxml)
1077 ("python-psutil" ,python-psutil)
1078 ("python-pytest" ,python-pytest-6)
1079 ("python-pytest-cov" ,python-pytest-cov)
1080 ("python-pytest-forked" ,python-pytest-forked)
1081 ("python-pytest-xdist" ,python-pytest-xdist)
1082 ("python-virtualenv" ,python-virtualenv)))
1084 `(("python-mypy-extensions" ,python-mypy-extensions)
1085 ("python-typing-extensions" ,python-typing-extensions)
1086 ("python-typed-ast" ,python-typed-ast)))
1087 (home-page "http://www.mypy-lang.org/")
1088 (synopsis "Static type checker for Python")
1089 (description "Mypy is an optional static type checker for Python that aims
1090 to combine the benefits of dynamic (or 'duck') typing and static typing. Mypy combines
1091 the expressive power and convenience of Python with a powerful type system and
1092 compile-time type checking. Mypy type checks standard Python programs; run them using
1093 any Python VM with basically no runtime overhead.")
1094 ;; Most of the code is under MIT license; Some files are under Python Software
1095 ;; Foundation License version 2: stdlib-samples/*, mypyc/lib-rt/pythonsupport.h and
1096 ;; mypyc/lib-rt/getargs.c
1097 (license (list license:expat license:psfl))))
1099 (define-public python-robber
1101 (name "python-robber")
1105 (uri (pypi-uri "robber" version))
1108 "0xp5csgv2g9q38hscml6bc5i1nm4xy5lzqqiimm2drxsf0hw2nq5"))))
1109 (build-system python-build-system)
1110 ;; There are no tests in the tarball downloaded from PyPI.
1111 ;; The last version tagged in Github (0.1.0) is older than the one on PyPI.
1112 ;; Reported upstream: <https://github.com/vesln/robber.py/issues/20>.
1113 (arguments '(#:tests? #f))
1115 `(("python-mock" ,python-mock)
1116 ("python-termcolor" ,python-termcolor)))
1117 ;; URL of the fork used to generate the package available on PyPI.
1118 (home-page "https://github.com/EastAgile/robber.py")
1119 (synopsis "Test-driven development (TDD) assertion library for Python")
1120 (description "Robber is a Python assertion library for test-driven and
1121 behavior-driven development (TDD and BDD).")
1122 (license license:expat)))
1124 (define-public python-stestr
1126 (name "python-stestr")
1131 (uri (pypi-uri "stestr" version))
1134 "0adhqp9c9338wlvlq776k57k04lyxp38bv591afdm9gjsn2qn1zm"))))
1135 (build-system python-build-system)
1137 `(#:tests? #f)) ;to avoid circular dependencies
1139 `(("python-pbr" ,python-pbr)))
1141 `(("python-cliff" ,python-cliff)
1142 ("python-fixtures" ,python-fixtures)
1143 ("python-future" ,python-future)
1144 ("python-pyyaml" ,python-pyyaml)
1145 ("python-subunit" ,python-subunit)
1146 ("python-testtools" ,python-testtools)
1147 ("python-voluptuous" ,python-voluptuous)))
1148 (home-page "https://stestr.readthedocs.io/en/latest/")
1149 (synopsis "Parallel Python test runner")
1150 (description "This package provides the @command{stestr} command, a
1151 parallel Python test runner built around @code{subunit}. It is designed to
1152 execute @code{unittest} test suites using multiple processes to split up
1153 execution of a test suite. It will also store a history of all test runs to
1154 help in debugging failures and optimizing the scheduler to improve speed.")
1155 (license license:asl2.0)))
1157 ;; This is only used by python-sanic
1158 (define-public python-pytest-sanic
1160 (name "python-pytest-sanic")
1164 (uri (pypi-uri "pytest-sanic" version))
1167 "02ajd8z77ahi69kzkz200qgxrb4s2j4qb6k8j9ds1kz6qa6fsa34"))))
1168 (build-system python-build-system)
1170 ;; Tests depend on python-sanic.
1173 `(("python-aiohttp" ,python-aiohttp)
1174 ("python-async-generator"
1175 ,python-async-generator)
1176 ("python-pytest" ,python-pytest)))
1178 "https://github.com/yunstanford/pytest-sanic")
1179 (synopsis "Pytest plugin for Sanic")
1180 (description "A pytest plugin for Sanic. It helps you to test your
1181 code asynchronously.")
1182 (license license:expat)))