gnu: Add python-pytest-sanic.
[jackhill/guix/guix.git] / gnu / packages / python-check.scm
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>
12 ;;;
13 ;;; This file is part of GNU Guix.
14 ;;;
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.
19 ;;;
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.
24 ;;;
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/>.
27
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))
42
43 (define-public python-coveralls
44 (package
45 (name "python-coveralls")
46 (version "1.11.1")
47 (home-page "https://github.com/coveralls-clients/coveralls-python")
48 (source
49 (origin
50 ;; The PyPI release lacks tests, so we pull from git instead.
51 (method git-fetch)
52 (uri (git-reference (url home-page) (commit version)))
53 (file-name (git-file-name name version))
54 (sha256
55 (base32
56 "1zr1lqdjcfwj6wcx2449mzzjq8bbhwnqcm5vdif5s8hlz35bjxkp"))))
57 (build-system python-build-system)
58 (arguments
59 '(#:phases (modify-phases %standard-phases
60 (add-before 'check 'disable-git-test
61 (lambda _
62 ;; Remove test that requires 'git' and the full checkout.
63 (delete-file "tests/git_test.py")
64 #t))
65 (replace 'check
66 (lambda* (#:key tests? #:allow-other-keys)
67 (if tests?
68 (invoke "pytest" "-vv")
69 (format #t "test suite not run~%"))
70 #t)))))
71 (propagated-inputs
72 `(("python-coverage" ,python-coverage)
73 ("python-docopt" ,python-docopt)
74 ("python-pyyaml" ,python-pyyaml)
75 ("python-requests" ,python-requests)))
76 (native-inputs
77 `(("python-mock" ,python-mock)
78 ("python-pytest" ,python-pytest)))
79 (synopsis "Show coverage stats online via coveralls.io")
80 (description
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)))
85
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.
89 (let ((version "1.9")
90 (commit "4bd08a272f059998cedf9b7779f944d49eba13a6")
91 (revision "0"))
92 (package
93 (name "python-junit-xml")
94 (version (git-version version revision commit))
95 (home-page "https://github.com/kyrus/python-junit-xml")
96 (source (origin
97 (method git-fetch)
98 (uri (git-reference (url home-page) (commit commit)))
99 (file-name (git-file-name name version))
100 (sha256
101 (base32
102 "0b8kbjhk3j10rk0vcniy695m3h43yip6y93h1bd6jjh0cp7s09c7"))))
103 (build-system python-build-system)
104 (arguments
105 `(#:phases (modify-phases %standard-phases
106 (replace 'check
107 (lambda _
108 (invoke "pytest" "-vv"))))))
109 (native-inputs
110 `(("python-pytest" ,python-pytest)))
111 (propagated-inputs
112 `(("python-six" ,python-six)))
113 (synopsis "Create JUnit XML test results")
114 (description
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))))
118
119 (define-public python-vcrpy
120 (package
121 (name "python-vcrpy")
122 (version "2.0.1")
123 (source
124 (origin
125 (method url-fetch)
126 (uri (pypi-uri "vcrpy" version))
127 (sha256
128 (base32
129 "0kws7l3hci1dvjv01nxw3805q9v2mwldw58bgl8s90wqism69gjp"))))
130 (build-system python-build-system)
131 (arguments `(#:tests? #f)) ; tests require more packages for python-pytest-httpbin
132 (propagated-inputs
133 `(("python-pyyaml" ,python-pyyaml)
134 ("python-six" ,python-six)
135 ("python-wrapt" ,python-wrapt)
136 ("python-yarl" ,python-yarl)))
137 (native-inputs
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")
143 (description
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:
154 @enumerate
155 @item The ability to work offline
156 @item Completely deterministic tests
157 @item Increased test execution speed
158 @end enumerate
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)))
164
165 (define-public python-pytest-ordering
166 (package
167 (name "python-pytest-ordering")
168 (version "0.6")
169 (source
170 (origin
171 ;; No tests in the PyPI tarball.
172 (method git-fetch)
173 (uri (git-reference
174 (url "https://github.com/ftobia/pytest-ordering")
175 (commit version)))
176 (file-name (git-file-name name version))
177 (sha256
178 (base32 "14msj5gyqza0gk3x7h1ivmjrwza82v84cj7jx3ks0fw9lpin7pjq"))))
179 (build-system python-build-system)
180 (arguments
181 '(#:phases
182 (modify-phases %standard-phases
183 (replace 'check
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"))))))
190 (native-inputs
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")
194 (description
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)))
198
199 (define-public python-pytest-arraydiff
200 (package
201 (name "python-pytest-arraydiff")
202 (version "0.3")
203 (source
204 (origin
205 (method url-fetch)
206 (uri (pypi-uri "pytest-arraydiff" version))
207 (sha256
208 (base32 "05bcvhh2ycxa35znl8b3l9vkcmx7vwm5c3fpakbpw46c7vsn4bfy"))))
209 (build-system python-build-system)
210 (arguments
211 ;; Tests require python-astropy, which itself requires this package.
212 ;; Disable tests to avoid the circular dependency problem.
213 '(#:tests? #f))
214 (propagated-inputs
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")
219 (description
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)))
224
225 (define-public python-pytest-doctestplus
226 (package
227 (name "python-pytest-doctestplus")
228 (version "0.7.0")
229 (source
230 (origin
231 (method url-fetch)
232 (uri (pypi-uri "pytest-doctestplus" version))
233 (sha256
234 (base32 "1ai9kvd7xbq2jg2h8gmkb8lqzyrxvdh4zg3vxndg149iwd1hyi7d"))))
235 (build-system python-build-system)
236 (arguments
237 '(#:phases
238 (modify-phases %standard-phases
239 (replace 'check
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"))))))
244 (native-inputs
245 `(("python-pytest" ,python-pytest)))
246 (home-page "https://github.com/astropy/pytest-doctestplus")
247 (synopsis "Pytest plugin with advanced doctest features")
248 (description
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)))
252
253 (define-public python-pytest-filter-subpackage
254 (package
255 (name "python-pytest-filter-subpackage")
256 (version "0.1.1")
257 (source
258 (origin
259 (method url-fetch)
260 (uri (pypi-uri "pytest-filter-subpackage" version))
261 (sha256
262 (base32 "1s4s2kd31yc65rfvl4xhy8xx806xhy59kc7668h6b6wq88xgrn5p"))))
263 (build-system python-build-system)
264 (arguments
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.
268 #:phases
269 (modify-phases %standard-phases
270 (replace 'check
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"))))))
275 (native-inputs
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")
282 (description
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
285 sub-package.")
286 (license license:bsd-3)))
287
288 (define-public python-pytest-openfiles
289 (package
290 (name "python-pytest-openfiles")
291 (version "0.5.0")
292 (source
293 (origin
294 (method url-fetch)
295 (uri (pypi-uri "pytest-openfiles" version))
296 (sha256
297 (base32 "0n0a7fdc9m86360y96l23fvdmd6rw04bl6h5xqgl9qxfv08jk70p"))))
298 (build-system python-build-system)
299 (arguments
300 '(#:phases
301 (modify-phases %standard-phases
302 (replace 'check
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"))))))
307 (native-inputs
308 `(("python-setuptools-scm" ,python-setuptools-scm)
309 ("python-pytest" ,python-pytest)))
310 (propagated-inputs
311 `(("python-psutil" ,python-psutil)))
312 (home-page "https://github.com/astropy/pytest-openfiles")
313 (synopsis "Pytest plugin for detecting inadvertent open file handles")
314 (description
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)))
319
320 (define-public python-pytest-remotedata
321 (package
322 (name "python-pytest-remotedata")
323 (version "0.3.2")
324 (source
325 (origin
326 (method url-fetch)
327 (uri (pypi-uri "pytest-remotedata" version))
328 (sha256
329 (base32 "1h6g6shib6z07azf12rnsa053470ggbd7hy3bnbw8nf3nza5h372"))))
330 (build-system python-build-system)
331 (arguments
332 '(#:phases
333 (modify-phases %standard-phases
334 (replace 'check
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"
339 (string-append
340 ;; These tests require internet access. Disable them.
341 "not test_default_behavior"
342 " and not test_strict_with_decorator")))))))
343 (native-inputs
344 `(("python-pytest" ,python-pytest)))
345 (propagated-inputs
346 `(("python-six" ,python-six)))
347 (home-page "https://github.com/astropy/pytest-remotedata")
348 (synopsis "Pytest plugin for controlling remote data access")
349 (description
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
352 internet.")
353 (license license:bsd-3)))
354
355 (define-public python-pytest-mpl
356 (package
357 (name "python-pytest-mpl")
358 (version "0.11")
359 (source
360 (origin
361 (method url-fetch)
362 (uri (pypi-uri "pytest-mpl" version))
363 (sha256
364 (base32 "1km202c1s5kcn52fx0266p06qb34va3warcby594dh6vixxa9i96"))))
365 (build-system python-build-system)
366 (arguments
367 '(#:phases
368 (modify-phases %standard-phases
369 (replace 'check
370 (lambda _
371 (invoke "pytest" "-vv"))))))
372 (native-inputs
373 `(("python-pytest" ,python-pytest)))
374 (propagated-inputs
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")
379 (description
380 "This is a plugin to facilitate image comparison for Matplotlib figures
381 in Pytest.")
382 (license license:bsd-3)))
383
384 (define-public python-covdefaults
385 (package
386 (name "python-covdefaults")
387 (version "1.1.0")
388 (source
389 (origin
390 ;; The PyPI tarball does not include tests.
391 (method git-fetch)
392 (uri (git-reference
393 (url "https://github.com/asottile/covdefaults")
394 (commit (string-append "v" version))))
395 (file-name (git-file-name name version))
396 (sha256
397 (base32 "11a24c0wzv01n55fy4kdpnyqna4m9k0mp58kmhiaks34xw4k37hq"))))
398 (build-system python-build-system)
399 (arguments
400 `(#:phases
401 (modify-phases %standard-phases
402 (replace 'check
403 (lambda _
404 (invoke "pytest" "-vv"))))))
405 (native-inputs
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")
410 (description
411 "Covdefaults is a coverage plugin to provide opinionated default
412 settings.")
413 (license license:expat)))
414
415 (define-public python-pytest-vcr
416 ;; This commit fixes integration with pytest-5
417 (let ((commit "4d6c7b3e379a6a7cba0b8f9d20b704dc976e9f05")
418 (revision "1"))
419 (package
420 (name "python-pytest-vcr")
421 (version (git-version "1.0.2" revision commit))
422 (source
423 (origin
424 (method git-fetch)
425 (uri (git-reference
426 (url "https://github.com/ktosiek/pytest-vcr")
427 (commit commit)))
428 (file-name (git-file-name name version))
429 (sha256
430 (base32
431 "1yk988zi0la6zpcm3fff0mxf942di2jiymrfqas19nyngj5ygaqs"))))
432 (build-system python-build-system)
433 (arguments
434 `(#:phases
435 (modify-phases %standard-phases
436 (replace 'check
437 (lambda* (#:key inputs outputs #:allow-other-keys)
438 (add-installed-pythonpath inputs outputs)
439 (invoke "pytest" "tests/"))))))
440 (propagated-inputs
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")
445 (description
446 "Plugin for managing VCR.py cassettes.")
447 (license license:expat))))
448
449 (define-public python-pytest-checkdocs
450 (package
451 (name "python-pytest-checkdocs")
452 (version "1.2.2")
453 (source
454 (origin
455 (method url-fetch)
456 (uri (pypi-uri "pytest-checkdocs" version))
457 (sha256
458 (base32 "0j6j1gvj6x451y3qsx4xbaq9p1w9gg3mwk7n0w80cy8vdyjkngb0"))))
459 (build-system python-build-system)
460 (propagated-inputs
461 `(("python-docutils" ,python-docutils)
462 ("python-importlib-metadata" ,python-importlib-metadata)
463 ("python-more-itertools" ,python-more-itertools)))
464 (native-inputs
465 `(("python-setuptools-scm" ,python-setuptools-scm)))
466 (home-page "https://github.com/jaraco/pytest-checkdocs")
467 (synopsis "Check the README when running tests")
468 (description
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)))
472
473 (define-public python-re-assert
474 (package
475 (name "python-re-assert")
476 (version "1.1.0")
477 (source
478 (origin
479 ;; There are no tests in the PyPI tarball.
480 (method git-fetch)
481 (uri (git-reference
482 (url "https://github.com/asottile/re-assert")
483 (commit (string-append "v" version))))
484 (file-name (git-file-name name version))
485 (sha256
486 (base32 "1rssq4wpqmx1c17hjfx5l3sn3zmnlz9jffddiqrs4f6h7m6cadai"))))
487 (build-system python-build-system)
488 (arguments
489 `(#:phases
490 (modify-phases %standard-phases
491 (replace 'check
492 (lambda _
493 (invoke "pytest" "-vv"))))))
494 (native-inputs
495 `(("python-covdefaults" ,python-covdefaults)
496 ("python-coverage" ,python-coverage)
497 ("python-pytest" ,python-pytest)))
498 (propagated-inputs
499 `(("python-regex" ,python-regex)))
500 (home-page "https://github.com/asottile/re-assert")
501 (synopsis "Show where your regex match assertion failed")
502 (description
503 "@code{re-assert} provides a helper class to make assertions of regexes
504 simpler.")
505 (license license:expat)))
506
507 (define-public python-pytest-trio
508 (package
509 (name "python-pytest-trio")
510 (version "0.6.0")
511 (source
512 (origin
513 (method url-fetch)
514 (uri (pypi-uri "pytest-trio" version))
515 (sha256
516 (base32 "1zm8didm9h5jkqhghl9bvqs7kr7sjci282c7grhk6yhpzn8a9w4v"))))
517 (build-system python-build-system)
518 (arguments
519 `(#:phases
520 (modify-phases %standard-phases
521 (replace 'check
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"))))))
526 (native-inputs
527 `(("python-hypothesis" ,python-hypothesis)
528 ("python-pytest" ,python-pytest)
529 ("python-pytest-cov" ,python-pytest-cov)))
530 (propagated-inputs
531 `(("python-trio" ,python-trio)))
532 (home-page "https://github.com/python-trio/pytest-trio")
533 (synopsis "Pytest plugin for trio")
534 (description
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))))
539
540 (define-public python-pytest-flake8
541 (package
542 (name "python-pytest-flake8")
543 (version "1.0.6")
544 (source
545 (origin
546 (method url-fetch)
547 (uri (pypi-uri "pytest-flake8" version))
548 (sha256
549 (base32
550 "09vhn7r77s1yiqnlwfvh5585f904zpyd6620a90dpccfr1cbp0hv"))))
551 (build-system python-build-system)
552 (propagated-inputs
553 `(("python-flake8" ,python-flake8)))
554 (native-inputs
555 `(("python-pytest" ,python-pytest)))
556 (home-page "https://github.com/tholo/pytest-flake8")
557 (synopsis "Pytest plugin to check FLAKE8 requirements")
558 (description
559 "This package provides a pytest plugin for efficiently checking PEP8
560 compliance.")
561 (license license:bsd-3)))
562
563 (define-public python-pytest-isort
564 (package
565 (name "python-pytest-isort")
566 (version "0.3.1")
567 (source
568 (origin
569 (method url-fetch)
570 (uri (pypi-uri "pytest-isort" version))
571 (sha256
572 (base32 "06myn5hhxs5yp8dqr1yjsgcnnxnsrvsqannm00bvaw0qml6ydzjb"))))
573 (build-system python-build-system)
574 (arguments
575 `(#:phases
576 (modify-phases %standard-phases
577 (replace 'check
578 (lambda _
579 (setenv "PYTHONPATH"
580 (string-append (getcwd) ":"
581 (getenv "PYTHONPATH")))
582 (invoke "pytest"))))))
583 (propagated-inputs
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")
588 (description
589 "This package provides a pytest plugin to check import ordering using
590 isort.")
591 (license license:bsd-3)))
592
593 (define-public python-pytest-shutil
594 (package
595 (name "python-pytest-shutil")
596 (version "1.7.0")
597 (source
598 (origin
599 (method url-fetch)
600 (uri (pypi-uri "pytest-shutil" version))
601 (sha256
602 (base32
603 "0q8j0ayzmnvlraml6i977ybdq4xi096djhf30n2m1rvnvrhm45nq"))))
604 (build-system python-build-system)
605 (arguments
606 `(#:phases
607 (modify-phases %standard-phases
608 (add-after 'unpack 'patch-tests
609 (lambda _
610 (mkdir "/tmp/bin")
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')"))
616 #t)))))
617 (propagated-inputs
618 `(("python-contextlib2" ,python-contextlib2)
619 ("python-execnet" ,python-execnet)
620 ("python-pathpy" ,python-pathpy)
621 ("python-termcolor" ,python-termcolor)))
622 (native-inputs
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")
628 (description
629 "This package provides assorted shell and environment tools for the
630 py.test testing framework.")
631 (license license:expat)))
632
633 (define-public python-pytest-fixture-config
634 (package
635 (name "python-pytest-fixture-config")
636 (version "1.7.0")
637 (source
638 (origin
639 (method url-fetch)
640 (uri (pypi-uri "pytest-fixture-config" version))
641 (sha256
642 (base32
643 "13i1qpz22w3x4dmw8vih5jdnbqfqvl7jiqs0dg764s0zf8bp98a1"))))
644 (build-system python-build-system)
645 (native-inputs
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")
650 (description
651 "This package provides fixture configuration utilities for the py.test
652 testing framework.")
653 (license license:expat)))
654
655 (define-public python-pytest-virtualenv
656 (package
657 (name "python-pytest-virtualenv")
658 (version "1.7.0")
659 (source
660 (origin
661 (method url-fetch)
662 (uri (pypi-uri "pytest-virtualenv" version))
663 (sha256
664 (base32
665 "03w2zz3crblj1p6i8nq17946hbn3zqp9z7cfnifw47hi4a4fww12"))))
666 (build-system python-build-system)
667 (arguments
668 `(#:phases
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
677 "/bin/virtualenv")))
678 (substitute* "pytest_virtualenv.py"
679 (("^DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE.*$")
680 (format #f "DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE = '~a'"
681 virtualenv-bin)))
682 #t))))))
683 (propagated-inputs
684 `(("python-pytest-shutil" ,python-pytest-shutil)
685 ("python-pytest-fixture-config" ,python-pytest-fixture-config)))
686 (inputs
687 `(("python-virtualenv" ,python-virtualenv)))
688 (native-inputs
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
695 framework.")
696 (license license:expat)))
697
698 (define-public python-pytest-pycodestyle
699 (package
700 (name "python-pytest-pycodestyle")
701 (version "2.0.0") ;later versions require python-pytest~=5.4
702 (source
703 (origin
704 (method url-fetch)
705 (uri (pypi-uri "pytest-pycodestyle" version))
706 (sha256
707 (base32
708 "02i5gl7pm9cwxk15sn29inz3n8flpj1r3p1l110h43f2na5w8h7z"))))
709 (build-system python-build-system)
710 (propagated-inputs
711 `(("python-pycodestyle" ,python-pycodestyle)))
712 (native-inputs
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)))
719
720 (define-public python-pytest-benchmark
721 (package
722 (name "python-pytest-benchmark")
723 (version "3.2.3")
724 (source
725 (origin
726 (method url-fetch)
727 (uri (pypi-uri "pytest-benchmark" version))
728 (sha256
729 (base32
730 "0a4mpb4j73dsyk47hd1prrjpfk4r458s102cn80rf253jg818hxd"))))
731 (build-system python-build-system)
732 (propagated-inputs
733 `(("python-py-cpuinfo" ,python-py-cpuinfo)))
734 (native-inputs
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")
739 (description
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)))
743
744 (define-public python-pytest-services
745 (package
746 (name "python-pytest-services")
747 (version "1.3.1")
748 (source
749 (origin
750 (method url-fetch)
751 (uri (pypi-uri "pytest-services" version))
752 (sha256
753 (base32
754 "0b2zfv04w6m3gp2v44ifdhx22vcji069qnn95ry3zcyxib7cjnq3"))))
755 (build-system python-build-system)
756 (arguments '(#:tests? #f)) ; Tests not included in release tarball.
757 (propagated-inputs
758 `(("python-psutil" ,python-psutil)
759 ("python-requests" ,python-requests)))
760 (native-inputs
761 `(("python-pytest" ,python-pytest)))
762 (home-page "https://github.com/pytest-dev/pytest-services")
763 (synopsis "Services plugin for pytest testing framework")
764 (description
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)))
768
769 (define-public python-pytest-toolbox
770 (package
771 (name "python-pytest-toolbox")
772 (version "0.4")
773 (source
774 (origin
775 ;; No tests in the PyPI tarball.
776 (method git-fetch)
777 (uri (git-reference
778 (url "https://github.com/samuelcolvin/pytest-toolbox")
779 (commit (string-append "v" version))))
780 (file-name (git-file-name name version))
781 (sha256
782 (base32 "1wqkr3g5gmqdxmhzfsxbwy8pm3cadaj6a8cxq58w9bacly4hqbh0"))))
783 (build-system python-build-system)
784 (arguments
785 '(#:phases
786 (modify-phases %standard-phases
787 (replace 'check
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"))))))
792 (native-inputs
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")
807 (description
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)))
811
812 (define-public python-pytest-aiohttp
813 (package
814 (name "python-pytest-aiohttp")
815 (version "0.3.0")
816 (source
817 (origin
818 (method url-fetch)
819 (uri (pypi-uri "pytest-aiohttp" version))
820 (sha256
821 (base32
822 "0kx4mbs9bflycd8x9af0idcjhdgnzri3nw1qb0vpfyb3751qaaf9"))))
823 (build-system python-build-system)
824 (native-inputs
825 `(("python-pytest" ,python-pytest)))
826 (propagated-inputs
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)))
832
833 (define-public python-nbval
834 (package
835 (name "python-nbval")
836 (version "0.9.6")
837 (source
838 (origin
839 (method url-fetch)
840 (uri (pypi-uri "nbval" version))
841 (sha256
842 (base32 "0h3xrnw0mj1srigrx2rfnd73h8s0xjycclmjs0vx7qkfyqpcvvyg"))))
843 (build-system python-build-system)
844 (arguments
845 `(#:phases
846 (modify-phases %standard-phases
847 (add-before 'check 'fix-test
848 (lambda _
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")
852 #t))
853 (replace 'check
854 (lambda* (#:key inputs outputs #:allow-other-keys)
855 (add-installed-pythonpath inputs outputs)
856 (invoke "pytest" "-vv" "-k"
857 (string-append
858 ;; This only works with Pytest < 5.
859 "not nbdime_reporter"
860 ;; https://github.com/computationalmodelling/nbval/pull/148.
861 " and not test_timeouts")))))))
862 (native-inputs
863 `(("python-pytest" ,python-pytest)
864 ("python-pytest-cov" ,python-pytest-cov)
865 ("python-sympy" ,python-sympy)))
866 (propagated-inputs
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")
873 (description
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)))
879
880 (define-public python-pytest-flask
881 (package
882 (name "python-pytest-flask")
883 (version "1.0.0")
884 (source
885 (origin
886 (method url-fetch)
887 (uri (pypi-uri "pytest-flask" version))
888 (sha256
889 (base32
890 "1hln7mwgdzfi5ma0kqfsi768l7p24jhkw8l0imhifwy08nh7hmjd"))))
891 (build-system python-build-system)
892 (native-inputs
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")
899 (description
900 "This pytest plugin provides fixtures to simplify Flask app testing.")
901 (license license:expat)))
902
903 (define-public python-pytest-env
904 (package
905 (name "python-pytest-env")
906 (version "0.6.2")
907 (source
908 (origin
909 (method url-fetch)
910 (uri (pypi-uri "pytest-env" version))
911 (sha256
912 (base32 "1hl0ln0cicdid4qjk7mv90lw9xkb0v71dlj7q7rn89vzxxm9b53y"))))
913 (build-system python-build-system)
914 (native-inputs
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")
918 (description
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)))
922
923 (define-public python-pyux
924 (package
925 (name "python-pyux")
926 (version "0.0.6")
927 (source
928 (origin
929 (method url-fetch)
930 (uri (pypi-uri "pyux" version))
931 (sha256
932 (base32
933 "1i17xh4dy238ibrjdgh8vn78fk5q6dj37mcznpvdfzidj57js7ca"))))
934 (build-system python-build-system)
935 (arguments
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
940 libraries.")
941 (license license:expat)))
942
943 (define-public python-codacy-coverage
944 (package
945 (name "python-codacy-coverage")
946 (version "1.3.11")
947 (source
948 (origin
949 (method url-fetch)
950 (uri (pypi-uri "codacy-coverage" version))
951 (sha256
952 (base32
953 "1g0c0w56xdkmqb8slacyw5qhzrkp814ng3ddh2lkiij58y9m2imr"))))
954 (build-system python-build-system)
955 (arguments
956 `(#:tests? #f)); no tests
957 (propagated-inputs
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)))
965
966 (define-public python-httmock
967 (package
968 (name "python-httmock")
969 (version "1.3.0")
970 (source
971 (origin
972 (method url-fetch)
973 (uri (pypi-uri "httmock" version))
974 (sha256
975 (base32
976 "1zj1fcm0n6f0wr9mr0hmlqz9430fnr5cdwd5jkcvq9j44bnsrfz0"))))
977 (build-system python-build-system)
978 (arguments
979 `(#:tests? #f)); no tests
980 (propagated-inputs
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)))
987
988 (define-public python-atpublic
989 (package
990 (name "python-atpublic")
991 (version "1.0")
992 (source
993 (origin
994 (method url-fetch)
995 (uri (pypi-uri "atpublic" version))
996 (sha256
997 (base32
998 "0i3sbxkdlbb4560rrlmwwd5y4ps7k73lp4d8wnmd7ag9k426gjkx"))))
999 (build-system python-build-system)
1000 (arguments
1001 '(#:phases
1002 (modify-phases %standard-phases
1003 (add-before 'build 'enable-c-implementation
1004 (lambda _
1005 (setenv "ATPUBLIC_BUILD_EXTENSION" "yes")
1006 #t))
1007 (replace 'check
1008 (lambda _
1009 (invoke "python" "-m" "nose2" "-v"))))))
1010 (native-inputs
1011 `(("python-nose2" ,python-nose2)))
1012 (home-page "https://public.readthedocs.io/")
1013 (synopsis "@code{@@public} decorator for populating @code{__all__}")
1014 (description
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
1021
1022 (define-public python-mypy-extensions
1023 (package
1024 (name "python-mypy-extensions")
1025 (version "0.4.3")
1026 (source
1027 (origin
1028 (method url-fetch)
1029 (uri (pypi-uri "mypy_extensions" version))
1030 (sha256
1031 (base32
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)))
1041
1042 (define-public python-mypy
1043 (package
1044 (name "python-mypy")
1045 (version "0.790")
1046 (source
1047 (origin
1048 ;; Because of https://github.com/python/mypy/issues/9584, the
1049 ;; mypyc/analysis directory is missing in the PyPI archive, leading to
1050 ;; test failures.
1051 (method git-fetch)
1052 (uri (git-reference
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
1057 ;; (data) files.
1058 (recursive? #t)))
1059 (file-name (git-file-name name version))
1060 (sha256
1061 (base32
1062 "0zq3lpdf9hphcklk40wz444h8w3dkhwa12mqba5j9lmg11klnhz7"))))
1063 (build-system python-build-system)
1064 (arguments
1065 `(#:phases
1066 (modify-phases %standard-phases
1067 (replace 'check
1068 (lambda _
1069 (invoke "pytest" "mypyc"))))))
1070 (native-inputs
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)))
1083 (propagated-inputs
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))))
1098
1099 (define-public python-robber
1100 (package
1101 (name "python-robber")
1102 (version "1.1.5")
1103 (source (origin
1104 (method url-fetch)
1105 (uri (pypi-uri "robber" version))
1106 (sha256
1107 (base32
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))
1114 (propagated-inputs
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)))
1123
1124 (define-public python-stestr
1125 (package
1126 (name "python-stestr")
1127 (version "3.0.1")
1128 (source
1129 (origin
1130 (method url-fetch)
1131 (uri (pypi-uri "stestr" version))
1132 (sha256
1133 (base32
1134 "0adhqp9c9338wlvlq776k57k04lyxp38bv591afdm9gjsn2qn1zm"))))
1135 (build-system python-build-system)
1136 (arguments
1137 `(#:tests? #f)) ;to avoid circular dependencies
1138 (native-inputs
1139 `(("python-pbr" ,python-pbr)))
1140 (propagated-inputs
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)))
1156
1157 ;; This is only used by python-sanic
1158 (define-public python-pytest-sanic
1159 (package
1160 (name "python-pytest-sanic")
1161 (version "1.6.2")
1162 (source (origin
1163 (method url-fetch)
1164 (uri (pypi-uri "pytest-sanic" version))
1165 (sha256
1166 (base32
1167 "02ajd8z77ahi69kzkz200qgxrb4s2j4qb6k8j9ds1kz6qa6fsa34"))))
1168 (build-system python-build-system)
1169 (arguments
1170 ;; Tests depend on python-sanic.
1171 `(#:tests? #f))
1172 (propagated-inputs
1173 `(("python-aiohttp" ,python-aiohttp)
1174 ("python-async-generator"
1175 ,python-async-generator)
1176 ("python-pytest" ,python-pytest)))
1177 (home-page
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)))