gnu: Add texlive-generic-xstring.
[jackhill/guix/guix.git] / gnu / packages / python-check.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2019, 2021, 2022 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2019, 2020, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
6 ;;; Copyright © 2019, 2021 Hartmut Goebel <h.goebel@crazy-compilers.com>
7 ;;; Copyright © 2020, 2022 Julien Lepiller <julien@lepiller.eu>
8 ;;; Copyright © 2020, 2022 Marius Bakke <marius@gnu.org>
9 ;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
10 ;;; Copyright © 2020, 2021 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, 2022 Guillaume Le Vaillant <glv@posteo.net>
15 ;;; Copyright © 2021 Bonface Munyoki Kilyungi <me@bonfacemunyoki.com>
16 ;;; Copyright © 2022 Malte Frank Gerdes <malte.f.gerdes@gmail.com>
17 ;;; Copyright © 2022 Felix Gruber <felgru@posteo.net>
18 ;;; Copyright © 2022 Tomasz Jeneralczyk <tj@schwi.pl>
19 ;;;
20 ;;; This file is part of GNU Guix.
21 ;;;
22 ;;; GNU Guix is free software; you can redistribute it and/or modify it
23 ;;; under the terms of the GNU General Public License as published by
24 ;;; the Free Software Foundation; either version 3 of the License, or (at
25 ;;; your option) any later version.
26 ;;;
27 ;;; GNU Guix is distributed in the hope that it will be useful, but
28 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
29 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 ;;; GNU General Public License for more details.
31 ;;;
32 ;;; You should have received a copy of the GNU General Public License
33 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34
35 (define-module (gnu packages python-check)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages admin)
38 #:use-module (gnu packages base)
39 #:use-module (gnu packages bash)
40 #:use-module (gnu packages check)
41 #:use-module (gnu packages docker)
42 #:use-module (gnu packages django)
43 #:use-module (gnu packages openstack)
44 #:use-module (gnu packages perl)
45 #:use-module (gnu packages python-build)
46 #:use-module (gnu packages python-web)
47 #:use-module (gnu packages python-xyz)
48 #:use-module (gnu packages qt)
49 #:use-module (gnu packages web)
50 #:use-module (gnu packages xml)
51 #:use-module (gnu packages xorg)
52 #:use-module (guix utils)
53 #:use-module ((guix licenses) #:prefix license:)
54 #:use-module (guix packages)
55 #:use-module (guix gexp)
56 #:use-module (guix git-download)
57 #:use-module (guix download)
58 #:use-module (guix build-system python))
59
60 (define-public python-tappy
61 (package
62 (name "python-tappy")
63 (version "3.0")
64 (source
65 (origin
66 (method url-fetch)
67 (uri (pypi-uri "tap.py" version))
68 (sha256
69 (base32
70 "0w4w6pqjkv54j7rv6vdrpfxa72c5516bnlhpcqr3vrb4zpmyxvpm"))))
71 (build-system python-build-system)
72 (home-page "https://github.com/python-tap/tappy")
73 (synopsis "Tools for Test Anything Protocol")
74 (description "Tappy is a set of tools for working with the Test Anything
75 Protocol (TAP) in Python. TAP is a line based test protocol for recording test
76 data in a standard way.")
77 (license license:bsd-3)))
78
79 (define-public python-beartype
80 (package
81 (name "python-beartype")
82 (version "0.10.4")
83 (source
84 (origin
85 (method url-fetch)
86 (uri (pypi-uri "beartype" version))
87 (sha256
88 (base32 "0amzckgw9c93bl4jf0q6322j9wyyf3i8vl03yixfkrpllzv6kv14"))))
89 (build-system python-build-system)
90 (arguments
91 (list #:phases
92 #~(modify-phases %standard-phases
93 (replace 'check
94 (lambda* (#:key tests? #:allow-other-keys)
95 (when tests?
96 (invoke "pytest" "-vv" "beartype_test"
97 ;; These tests rely on git through the
98 ;; "get_main_readme_file" helper.
99 "-k"
100 (string-append "not test_doc_readme "
101 "and not test_sphinx "
102 "and not test_pep561_mypy"))))))))
103 (native-inputs
104 (list python-pytest))
105 (home-page "https://github.com/beartype/beartype")
106 (synopsis "Fast runtime type checking for Python")
107 (description "Beartype aims to be a very fast runtime type checking tool
108 written in pure Python.")
109 (license license:expat)))
110
111 (define-public python-pytest-click
112 (package
113 (name "python-pytest-click")
114 (version "1.0.2")
115 (source
116 (origin
117 (method url-fetch)
118 (uri
119 (pypi-uri "pytest_click" version))
120 (sha256
121 (base32 "1rcv4m850rl7djzdgzz2zhjd8g5ih8w6l0sj2f9hsynymlsq82xl"))))
122 (build-system python-build-system)
123 (propagated-inputs
124 (list python-click python-pytest))
125 (home-page "https://github.com/Stranger6667/pytest-click")
126 (synopsis "Py.test plugin for Click")
127 (description "This package provides a plugin to test Python click
128 interfaces with pytest.")
129 (license license:expat)))
130
131 (define-public python-pytest-cram
132 (package
133 (name "python-pytest-cram")
134 (version "0.2.2")
135 (source (origin
136 (method url-fetch)
137 (uri (pypi-uri "pytest-cram" version))
138 (sha256
139 (base32
140 "0405ymmrsv6ii2qhq35nxfjkb402sdb6d13xnk53jql3ybgmiqq0"))))
141 (build-system python-build-system)
142 (propagated-inputs (list python-cram python-pytest))
143 (home-page "https://github.com/tbekolay/pytest-cram")
144 (synopsis "Run cram tests with pytest.")
145 (description "Cram tests command line applications; Pytest tests Python
146 applications. @code{pytest-cram} tests Python command line applications by
147 letting you write your Python API tests with pytest, and your command line
148 tests in cram.")
149 (license license:expat)))
150
151 (define-public python-pytest-csv
152 (package
153 (name "python-pytest-csv")
154 (version "3.0.0")
155 (source
156 (origin
157 (method git-fetch) ;no tests in PyPI archive
158 (uri (git-reference
159 (url "https://github.com/nicoulaj/pytest-csv")
160 (commit version)))
161 (file-name (git-file-name name version))
162 (sha256
163 (base32
164 "17518f2fn5l98lyk9p8r7215c1whi61imzrh6ahrmcksr8w0zz04"))))
165 (build-system python-build-system)
166 (arguments
167 `(#:phases
168 (modify-phases %standard-phases
169 (replace 'check
170 (lambda* (#:key tests? inputs outputs #:allow-other-keys)
171 (when tests?
172 (add-installed-pythonpath inputs outputs)
173 (invoke "pytest")))))))
174 (native-inputs
175 (list python-pytest-flake8 python-pytest-xdist-next python-tabulate))
176 (propagated-inputs
177 (list python-pytest-6 python-six))
178 (home-page "https://github.com/nicoulaj/pytest-csv")
179 (synopsis "CSV reporter for Pytest")
180 (description "This package provides a plugin for Pytest that enables a
181 CSV output mode for Pytest. It can be enabled via the @option{--csv} option
182 it adds to the Pytest command line interface (CLI).")
183 (license license:gpl3+)))
184
185 (define-public python-testfixtures
186 (package
187 (name "python-testfixtures")
188 (version "6.17.1")
189 (source
190 (origin
191 (method url-fetch)
192 (uri (pypi-uri "testfixtures" version))
193 (sha256
194 (base32 "1nlv2hz20czjp4a811ichl5kwg99rh84l0mw9wq4rk3idzfs1hsy"))))
195 (build-system python-build-system)
196 (arguments
197 `(#:tests? #f)) ; PyTest-Django fails to build in master
198 (native-inputs
199 (list python-pytest python-pytest-cov
200 ;;("python-pytest-django" ,python-pytest-django)
201 python-twine python-wheel))
202 (synopsis "Tests components for Python")
203 (description "Testfixtures is a collection of helpers and mock objects that
204 are useful when writing automated tests in Python.")
205 (home-page "https://testfixtures.readthedocs.io/en/latest/")
206 (license license:expat)))
207
208 (define-public python-cucumber-tag-expressions
209 (package
210 (name "python-cucumber-tag-expressions")
211 (version "4.1.0")
212 (source
213 (origin
214 (method url-fetch)
215 (uri (pypi-uri "cucumber-tag-expressions" version))
216 (sha256
217 (base32 "0q7rn4l4ppjd1zsglr37ccc5xccg4iigaw827282zfzfsvzda573"))))
218 (build-system python-build-system)
219 (arguments
220 (list #:phases
221 #~(modify-phases %standard-phases
222 (replace 'check
223 (lambda* (#:key tests? #:allow-other-keys)
224 (when tests?
225 ;; Ignore the configuration file since we don't
226 ;; need HTML reports, etc.
227 (invoke "pytest" "-c" "/dev/null" "-vv")))))))
228 (native-inputs
229 (list python-invoke python-pathpy python-pytest))
230 (home-page "https://github.com/cucumber/tag-expressions-python")
231 (synopsis "Tag-expression parser for cucumber/behave")
232 (description
233 "This package provides a tag-expression parser for Cucumber and
234 @command{behave}.")
235 (license license:expat)))
236
237 (define-public python-coveralls
238 (package
239 (name "python-coveralls")
240 (version "3.2.0")
241 (home-page "https://github.com/coveralls-clients/coveralls-python")
242 (source
243 (origin
244 ;; The PyPI release lacks tests, so we pull from git instead.
245 (method git-fetch)
246 (uri (git-reference (url home-page) (commit version)))
247 (file-name (git-file-name name version))
248 (sha256
249 (base32
250 "1915ab77nfb1rfw4i2ps0zy19wpf20lwxn81qxxbwyd2gy7m0fn8"))))
251 (build-system python-build-system)
252 (arguments
253 '(#:phases (modify-phases %standard-phases
254 (add-before 'check 'disable-git-test
255 (lambda _
256 ;; Remove test that requires 'git' and the full checkout.
257 (delete-file "tests/git_test.py")))
258 (replace 'check
259 (lambda* (#:key tests? #:allow-other-keys)
260 (if tests?
261 (invoke "pytest" "-vv")
262 (format #t "test suite not run~%")))))))
263 (propagated-inputs
264 (list python-coverage python-docopt python-pyyaml python-requests))
265 (native-inputs
266 (list python-mock python-pytest python-responses))
267 (synopsis "Show coverage stats online via coveralls.io")
268 (description
269 "Coveralls.io is a service for publishing code coverage statistics online.
270 This package provides seamless integration with coverage.py (and thus pytest,
271 nosetests, etc...) in Python projects.")
272 (license license:expat)))
273
274 (define-public python-junit-xml
275 ;; XXX: There are no tags or PyPI releases, so take the latest commit
276 ;; and use the version defined in setup.py.
277 (let ((version "1.9")
278 (commit "4bd08a272f059998cedf9b7779f944d49eba13a6")
279 (revision "0"))
280 (package
281 (name "python-junit-xml")
282 (version (git-version version revision commit))
283 (home-page "https://github.com/kyrus/python-junit-xml")
284 (source (origin
285 (method git-fetch)
286 (uri (git-reference (url home-page) (commit commit)))
287 (file-name (git-file-name name version))
288 (sha256
289 (base32
290 "0b8kbjhk3j10rk0vcniy695m3h43yip6y93h1bd6jjh0cp7s09c7"))))
291 (build-system python-build-system)
292 (arguments
293 `(#:phases (modify-phases %standard-phases
294 (replace 'check
295 (lambda _
296 (invoke "pytest" "-vv"))))))
297 (native-inputs
298 (list python-pytest))
299 (propagated-inputs
300 (list python-six))
301 (synopsis "Create JUnit XML test results")
302 (description
303 "This package provides a Python module for creating JUnit XML test
304 result documents that can be read by tools such as Jenkins or Bamboo.")
305 (license license:expat))))
306
307 (define-public python-pyinstrument
308 (package
309 (name "python-pyinstrument")
310 (version "4.1.1")
311 (source
312 (origin
313 (method url-fetch)
314 (uri (pypi-uri "pyinstrument" version))
315 (sha256
316 (base32 "18n3waxsxcd48pmcp8158s5rlancll2000amrdck9zfj5hfpkhhx"))))
317 (build-system python-build-system)
318 (native-inputs
319 (list python-flaky
320 python-pytest
321 python-pytest-asyncio
322 python-pytest-trio))
323 (arguments
324 `(;; TODO: Get tests to work.
325 #:tests? #f
326 #:phases (modify-phases %standard-phases
327 (replace 'check
328 (lambda* (#:key tests? #:allow-other-keys)
329 (when tests?
330 (invoke "pytest" "-vv")))))))
331 (home-page "https://github.com/joerick/pyinstrument")
332 (synopsis "Call stack profiler for Python")
333 (description
334 "Pyinstrument is a Python profiler to help you optimize your code.")
335 (license license:bsd-3)))
336
337 (define-public python-vcrpy
338 (package
339 (name "python-vcrpy")
340 (version "4.1.1")
341 (source
342 (origin
343 (method url-fetch)
344 (uri (pypi-uri "vcrpy" version))
345 (sha256
346 (base32 "16gmzxs3lzbgf1828n0q61vbmwyhpvzdlk37x6gdk8n05zr5n2ap"))))
347 (build-system python-build-system)
348 (arguments
349 `(#:phases
350 (modify-phases %standard-phases
351 (replace 'check
352 (lambda* (#:key tests? outputs #:allow-other-keys)
353 (when tests?
354 (substitute* "tox.ini"
355 (("AWS_ACCESS_KEY_ID") "PYTHONPATH"))
356 ;; These tests require network access.
357 (delete-file "tests/unit/test_stubs.py")
358 (invoke "pytest" "tests/unit")))))))
359 (propagated-inputs
360 (list python-pyyaml python-six python-wrapt python-yarl))
361 (native-inputs
362 (list python-black
363 python-coverage
364 python-flake8
365 python-flask
366 python-httplib2
367 python-ipaddress
368 python-mock
369 python-pytest
370 python-pytest-cov
371 python-pytest-httpbin
372 python-tox
373 python-urllib3))
374 (home-page "https://github.com/kevin1024/vcrpy")
375 (synopsis "Automatically mock your HTTP interactions")
376 (description
377 "VCR.py simplifies and speeds up tests that make HTTP requests. The first
378 time you run code that is inside a VCR.py context manager or decorated function,
379 VCR.py records all HTTP interactions that take place through the libraries it
380 supports and serializes and writes them to a flat file (in yaml format by
381 default). This flat file is called a cassette. When the relevant piece of code
382 is executed again, VCR.py will read the serialized requests and responses from
383 the aforementioned cassette file, and intercept any HTTP requests that it
384 recognizes from the original test run and return the responses that corresponded
385 to those requests. This means that the requests will not actually result in
386 HTTP traffic, which confers several benefits including:
387 @enumerate
388 @item The ability to work offline
389 @item Completely deterministic tests
390 @item Increased test execution speed
391 @end enumerate
392 If the server you are testing against ever changes its API, all you need to do
393 is delete your existing cassette files, and run your tests again. VCR.py will
394 detect the absence of a cassette file and once again record all HTTP
395 interactions, which will update them to correspond to the new API.")
396 (license license:expat)))
397
398 (define-public python-pytest-ordering
399 (package
400 (name "python-pytest-ordering")
401 (version "0.6")
402 (source
403 (origin
404 ;; No tests in the PyPI tarball.
405 (method git-fetch)
406 (uri (git-reference
407 (url "https://github.com/ftobia/pytest-ordering")
408 (commit version)))
409 (file-name (git-file-name name version))
410 (sha256
411 (base32 "14msj5gyqza0gk3x7h1ivmjrwza82v84cj7jx3ks0fw9lpin7pjq"))))
412 (build-system python-build-system)
413 (arguments
414 '(#:phases
415 (modify-phases %standard-phases
416 (replace 'check
417 (lambda* (#:key inputs outputs #:allow-other-keys)
418 (add-installed-pythonpath inputs outputs)
419 (invoke "pytest" "-vv" "-k"
420 ;; This test fails because of a type mismatch of an
421 ;; argument passed to @code{pytest.main}.
422 "not test_run_marker_registered"))))))
423 (native-inputs
424 (list python-pytest))
425 (home-page "https://github.com/ftobia/pytest-ordering")
426 (synopsis "Pytest plugin to run your tests in a specific order")
427 (description
428 "This plugin defines Pytest markers to ensure that some tests, or groups
429 of tests run in a specific order.")
430 (license license:expat)))
431
432 (define-public python-pytest-astropy-header
433 (package
434 (name "python-pytest-astropy-header")
435 (version "0.1.2")
436 (source
437 (origin
438 (method url-fetch)
439 (uri (pypi-uri "pytest-astropy-header" version))
440 (sha256
441 (base32 "1y87agr324p6x5gvhziymxjlw54pyn4gqnd49papbl941djpkp5g"))))
442 (build-system python-build-system)
443 (native-inputs
444 (list python-pytest python-setuptools-scm))
445 (home-page "https://www.astropy.org/")
446 (synopsis
447 "Pytest plugin adding diagnostic data to the header of the test output")
448 (description
449 "This plugin package provides a way to include information about the system,
450 Python installation, and select dependencies in the header of the output when
451 running pytest. It can be used with packages that are not affiliated with the
452 Astropy project, but is optimized for use with astropy-related projects.")
453 (license license:bsd-3)))
454
455 (define-public python-pytest-astropy
456 (package
457 (name "python-pytest-astropy")
458 (version "0.8.0")
459 (source
460 (origin
461 (method url-fetch)
462 (uri (pypi-uri "pytest-astropy" version))
463 (sha256
464 (base32 "18j6z6y2fvykmcs5z0mldhhaxxn6wzpnhlm2ps7m8r5z5kmh1631"))))
465 (build-system python-build-system)
466 (arguments
467 `(#:tests? #f ; there are no tests
468 #:phases
469 (modify-phases %standard-phases
470 ;; There is a bug somewhere that makes pytest-filter-subpackage appear
471 ;; as version 0.0.0 to setup.py. Remove it from the requirements.
472 (add-after 'unpack 'remove-requirement
473 (lambda _
474 (substitute* "setup.cfg"
475 ((".*pytest-filter-subpackage.*") "")))))))
476 (native-inputs
477 (list python-attrs python-pytest-mock python-setuptools-scm))
478 (propagated-inputs
479 (list python-hypothesis
480 python-pytest-arraydiff
481 python-pytest-astropy-header
482 python-pytest-cov
483 python-pytest-doctestplus
484 python-pytest-filter-subpackage
485 python-pytest-openfiles
486 python-pytest-remotedata))
487 (home-page "https://github.com/astropy/pytest-astropy")
488 (synopsis
489 "Metapackage for all the testing machinery used by the Astropy Project")
490 (description
491 "This is a meta-package that pulls in the dependencies that are used by
492 astropy related packages.")
493 (license license:bsd-3)))
494
495 (define-public python-pytest-arraydiff
496 (package
497 (name "python-pytest-arraydiff")
498 (version "0.3")
499 (source
500 (origin
501 (method url-fetch)
502 (uri (pypi-uri "pytest-arraydiff" version))
503 (sha256
504 (base32 "05bcvhh2ycxa35znl8b3l9vkcmx7vwm5c3fpakbpw46c7vsn4bfy"))))
505 (build-system python-build-system)
506 (arguments
507 ;; Tests require python-astropy, which itself requires this package.
508 ;; Disable tests to avoid the circular dependency problem.
509 '(#:tests? #f))
510 (native-inputs
511 (list python-pytest)) ; for sanity-check
512 (propagated-inputs
513 (list python-numpy python-six))
514 (home-page "https://github.com/astropy/pytest-arraydiff")
515 (synopsis "Pytest plugin to help with comparing array output from tests")
516 (description
517 "This is a py.test plugin to facilitate the generation and comparison of
518 data arrays produced during tests, in particular in cases where the arrays
519 are too large to conveniently hard-code them in the tests.")
520 (license license:bsd-3)))
521
522 (define-public python-pytest-doctestplus
523 (package
524 (name "python-pytest-doctestplus")
525 (version "0.11.2")
526 (source
527 (origin
528 (method url-fetch)
529 (uri (pypi-uri "pytest-doctestplus" version))
530 (sha256
531 (base32 "0j1lvlj3ps975q9hmg8i6rpqm0313j3r18bc3l8mz6khb7vav4zk"))))
532 (build-system python-build-system)
533 (arguments
534 '(#:phases
535 (modify-phases %standard-phases
536 (replace 'check
537 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
538 ;; Make the installed plugin discoverable by Pytest.
539 (when tests?
540 (add-installed-pythonpath inputs outputs)
541 (invoke "python" "-m" "pytest" "-k"
542 (string-append ; skip tests that require remote data
543 "not test_remote_data_url"
544 " and not test_remote_data_float_cmp"
545 " and not test_remote_data_ignore_whitespace"
546 " and not test_remote_data_ellipsis"
547 " and not test_remote_data_requires"
548 " and not test_remote_data_ignore_warnings"))))))))
549 (native-inputs
550 (list python-pytest python-setuptools-scm))
551 (home-page "https://github.com/astropy/pytest-doctestplus")
552 (synopsis "Pytest plugin with advanced doctest features")
553 (description
554 "This package contains a plugin for the Pytest framework that provides
555 advanced doctest support and enables the testing of reStructuredText files.")
556 (license license:bsd-3)))
557
558 (define-public python-pytest-exploratory
559 (package
560 (name "python-pytest-exploratory")
561 (version "0.5")
562 (source
563 (origin
564 (method url-fetch)
565 (uri (pypi-uri "pytest_exploratory" version))
566 (sha256
567 (base32 "159rcqv6wrdqdlag1gz39n6fk58232hbxshan043ljgpp1qfs6xk"))))
568 (build-system python-build-system)
569 (arguments
570 `(#:phases
571 (modify-phases %standard-phases
572 (replace 'check
573 (lambda* (#:key tests? #:allow-other-keys)
574 (when tests?
575 (invoke "pytest" "tests")))))))
576 (propagated-inputs
577 (list python-ipython python-py python-pytest))
578 (native-inputs (list python-pytest))
579 (home-page "https://github.com/nokia/pytest-exploratory")
580 (synopsis "Interactive console for Pytest")
581 (description "This Pytest plugin provides an IPython extension that allows
582 for interactively selecting and running Pytest tests.")
583 (license license:expat)))
584
585 (define-public python-pytest-filter-subpackage
586 (package
587 (name "python-pytest-filter-subpackage")
588 (version "0.1.1")
589 (source
590 (origin
591 (method url-fetch)
592 (uri (pypi-uri "pytest-filter-subpackage" version))
593 (sha256
594 (base32 "1s4s2kd31yc65rfvl4xhy8xx806xhy59kc7668h6b6wq88xgrn5p"))))
595 (build-system python-build-system)
596 (arguments
597 '(;; One test is failing. There's an issue reported upstream. See
598 ;; https://github.com/astropy/pytest-filter-subpackage/issues/3.
599 ;; Disable it for now.
600 #:phases
601 (modify-phases %standard-phases
602 (replace 'check
603 (lambda* (#:key inputs outputs #:allow-other-keys)
604 ;; Make the installed plugin discoverable by Pytest.
605 (add-installed-pythonpath inputs outputs)
606 (invoke "pytest" "-vv" "-k" "not test_with_rst"))))))
607 (native-inputs
608 (list python-pytest python-pytest-cov python-pytest-doctestplus))
609 (home-page "https://github.com/astropy/pytest-filter-subpackage")
610 (synopsis "Pytest plugin for filtering based on sub-packages")
611 (description
612 "This package contains a simple plugin for the pytest framework that
613 provides a shortcut to testing all code and documentation for a given
614 sub-package.")
615 (license license:bsd-3)))
616
617 (define-public python-pytest-helpers-namespace
618 (package
619 (name "python-pytest-helpers-namespace")
620 (version "2021.3.24")
621 (source
622 (origin
623 (method url-fetch)
624 (uri (pypi-uri "pytest-helpers-namespace" version))
625 (sha256
626 (base32
627 "0pyj2d45zagmzlajzqdnkw5yz8k49pkihbydsqkzm413qnkzb38q"))))
628 (build-system python-build-system)
629 (arguments
630 '(#:phases
631 (modify-phases %standard-phases
632 (replace 'check
633 (lambda* (#:key inputs outputs #:allow-other-keys)
634 ;; Make the installed plugin discoverable by Pytest.
635 (add-installed-pythonpath inputs outputs)
636 (invoke "pytest" "-vv"))))))
637 (native-inputs
638 (list python-pytest python-setuptools ; needs setuptools >= 50.3.2
639 python-setuptools-scm python-setuptools-declarative-requirements))
640 (home-page "https://github.com/saltstack/pytest-helpers-namespace")
641 (synopsis "Pytest Helpers Namespace Plugin")
642 (description "Pytest Helpers Namespace Plugin provides a helpers pytest
643 namespace which can be used to register helper functions without requiring
644 someone to import them in their actual tests to use them.")
645 (license license:asl2.0)))
646
647 (define-public python-pytest-metadata
648 (package
649 (name "python-pytest-metadata")
650 (version "1.11.0")
651 (source
652 (origin
653 (method url-fetch)
654 (uri (pypi-uri "pytest-metadata" version))
655 (sha256
656 (base32 "1wgcz0w053lnjln0081kjmfflaq7bwncxdzx7k63kr9lkpa0ddbi"))))
657 (build-system python-build-system)
658 (arguments
659 (list #:phases
660 #~(modify-phases %standard-phases
661 (replace 'check
662 (lambda* (#:key tests? #:allow-other-keys)
663 (when tests?
664 (invoke "pytest" "-vv")))))))
665 (native-inputs (list python-pytest python-setuptools-scm))
666 (home-page "https://github.com/pytest-dev/pytest-metadata")
667 (synopsis "Access test session metadata with Pytest")
668 (description
669 "@code{pytest-metadata} is a @command{pytest} plugin that provides
670 access to test session metadata.")
671 (license license:mpl2.0)))
672
673 (define-public python-pytest-openfiles
674 (package
675 (name "python-pytest-openfiles")
676 (version "0.5.0")
677 (source
678 (origin
679 (method url-fetch)
680 (uri (pypi-uri "pytest-openfiles" version))
681 (sha256
682 (base32 "0n0a7fdc9m86360y96l23fvdmd6rw04bl6h5xqgl9qxfv08jk70p"))))
683 (build-system python-build-system)
684 (arguments
685 '(#:phases
686 (modify-phases %standard-phases
687 (replace 'check
688 (lambda* (#:key inputs outputs #:allow-other-keys)
689 ;; Make the installed plugin discoverable by Pytest.
690 (add-installed-pythonpath inputs outputs)
691 (invoke "pytest" "-vv"))))))
692 (native-inputs
693 (list python-setuptools-scm python-pytest))
694 (propagated-inputs
695 (list python-psutil))
696 (home-page "https://github.com/astropy/pytest-openfiles")
697 (synopsis "Pytest plugin for detecting inadvertent open file handles")
698 (description
699 "This package provides a plugin for the pytest framework that allows
700 developers to detect whether any file handles or other file-like objects
701 were inadvertently left open at the end of a unit test.")
702 (license license:bsd-3)))
703
704 (define-public python-pytest-remotedata
705 (package
706 (name "python-pytest-remotedata")
707 (version "0.3.2")
708 (source
709 (origin
710 (method url-fetch)
711 (uri (pypi-uri "pytest-remotedata" version))
712 (sha256
713 (base32 "1h6g6shib6z07azf12rnsa053470ggbd7hy3bnbw8nf3nza5h372"))))
714 (build-system python-build-system)
715 (arguments
716 '(#:phases
717 (modify-phases %standard-phases
718 (replace 'check
719 (lambda* (#:key inputs outputs #:allow-other-keys)
720 ;; Make the installed plugin discoverable by Pytest.
721 (add-installed-pythonpath inputs outputs)
722 (invoke "pytest" "-vv" "-k"
723 (string-append
724 ;; These tests require internet access. Disable them.
725 "not test_default_behavior"
726 " and not test_strict_with_decorator")))))))
727 (native-inputs
728 (list python-pytest))
729 (propagated-inputs
730 (list python-six))
731 (home-page "https://github.com/astropy/pytest-remotedata")
732 (synopsis "Pytest plugin for controlling remote data access")
733 (description
734 "This package provides a plugin for the Pytest framework that allows
735 developers to control unit tests that require access to data from the
736 internet.")
737 (license license:bsd-3)))
738
739 (define-public python-pytest-repeat
740 (package
741 (name "python-pytest-repeat")
742 (version "0.9.1")
743 (source
744 (origin
745 (method url-fetch)
746 (uri (pypi-uri "pytest-repeat" version))
747 (sha256
748 (base32 "0nxdbghjz6v4xidl5ky9wlx6z4has3vygj5r7va5ccdb8nbjilsw"))))
749 (build-system python-build-system)
750 (arguments
751 `(#:phases
752 (modify-phases %standard-phases
753 (replace 'check
754 (lambda* (#:key tests? #:allow-other-keys)
755 (when tests?
756 (invoke "pytest")))))))
757 (propagated-inputs
758 (list python-pytest))
759 (native-inputs
760 (list python-setuptools-scm))
761 (home-page "https://github.com/pytest-dev/pytest-repeat")
762 (synopsis "Pytest plugin for repeating tests")
763 (description "@code{pytest-repeat} is a plugin for Pytest that makes it
764 enables repeating a single test, or multiple tests, a specific number of
765 times.")
766 (license license:mpl2.0)))
767
768 (define-public python-pytest-mockito
769 (package
770 (name "python-pytest-mockito")
771 (version "0.0.4")
772 (source
773 (origin
774 (method git-fetch) ;no tests in pypi archive
775 (uri (git-reference
776 (url "https://github.com/kaste/pytest-mockito")
777 (commit version)))
778 (file-name (git-file-name name version))
779 (sha256
780 (base32
781 "0hnpazaw3mglx1c405z2hkavgan99rqb3wgrcqk8x5kmhpay53xx"))))
782 (build-system python-build-system)
783 (arguments
784 '(#:phases
785 (modify-phases %standard-phases
786 (replace 'check
787 (lambda* (#:key tests? #:allow-other-keys)
788 (when tests?
789 (invoke "python" "-m" "pytest" "-vv")))))))
790 (propagated-inputs
791 (list python-mockito python-pytest))
792 (home-page "https://github.com/kaste/pytest-mockito")
793 (synopsis "Mockito base fixtures for Pytest")
794 (description "The @code{pytest-mockito} plugin provides base Mockito
795 fixtures for Pytest. It covers the main entry points of the Mockito mocking
796 framework and makes it easy to undo any monkey patching. The fixtures are:
797 @itemize
798 @item when
799 @item when2
800 @item expect
801 @item patch
802 @item unstub
803 @item spy2
804 @end itemize")
805 (license license:expat)))
806
807 (define-public python-pytest-mpl
808 (package
809 (name "python-pytest-mpl")
810 (version "0.11")
811 (source
812 (origin
813 (method url-fetch)
814 (uri (pypi-uri "pytest-mpl" version))
815 (sha256
816 (base32 "1km202c1s5kcn52fx0266p06qb34va3warcby594dh6vixxa9i96"))))
817 (build-system python-build-system)
818 (arguments
819 '(#:phases
820 (modify-phases %standard-phases
821 (replace 'check
822 (lambda _
823 (invoke "pytest" "-vv"))))))
824 (native-inputs
825 (list python-pytest))
826 (propagated-inputs
827 (list python-matplotlib python-nose python-pillow))
828 (home-page "https://github.com/matplotlib/pytest-mpl")
829 (synopsis "Pytest plugin to help with testing figures output from Matplotlib")
830 (description
831 "This is a plugin to facilitate image comparison for Matplotlib figures
832 in Pytest.")
833 (license license:bsd-3)))
834
835 (define-public python-pytest-pydocstyle
836 (package
837 (name "python-pytest-pydocstyle")
838 (version "2.2.0")
839 (source
840 (origin
841 (method git-fetch)
842 (uri (git-reference
843 (url "https://github.com/henry0312/pytest-pydocstyle")
844 (commit (string-append "v" version))))
845 (file-name (git-file-name name version))
846 (sha256
847 (base32 "0w6fivz4nb4b70wzmi5sk17qs9pd05rnh03fmch6v00r3dmfpk39"))))
848 (build-system python-build-system)
849 (arguments
850 `(#:tests? #f)) ; test requires the package itself
851 (propagated-inputs
852 (list python-pydocstyle
853 python-pytest)) ;apparently required
854 (home-page "https://github.com/henry0312/pytest-pydocstyle")
855 (synopsis "Pytest plugin to run @command{pydocstyle}")
856 (description "This package provides a Pytest plugin to run
857 @command{pydocstyle}.")
858 (license license:expat)))
859
860 (define-public python-covdefaults
861 (package
862 (name "python-covdefaults")
863 (version "1.1.0")
864 (source
865 (origin
866 ;; The PyPI tarball does not include tests.
867 (method git-fetch)
868 (uri (git-reference
869 (url "https://github.com/asottile/covdefaults")
870 (commit (string-append "v" version))))
871 (file-name (git-file-name name version))
872 (sha256
873 (base32 "11a24c0wzv01n55fy4kdpnyqna4m9k0mp58kmhiaks34xw4k37hq"))))
874 (build-system python-build-system)
875 (arguments
876 `(#:phases
877 (modify-phases %standard-phases
878 (replace 'check
879 (lambda _
880 (invoke "pytest" "-vv"))))))
881 (native-inputs
882 (list python-coverage python-pytest))
883 (home-page "https://github.com/asottile/covdefaults")
884 (synopsis "Coverage plugin to provide opinionated default settings")
885 (description
886 "Covdefaults is a coverage plugin to provide opinionated default
887 settings.")
888 (license license:expat)))
889
890 (define-public python-pytest-subtests
891 (package
892 (name "python-pytest-subtests")
893 (version "0.5.0")
894 (source
895 (origin
896 (method url-fetch)
897 (uri (pypi-uri "pytest-subtests" version))
898 (sha256
899 (base32 "087i03nmkmfnrpc7mmizvr40ijnjw4lfxc22rnk8jk6s1szy9lav"))))
900 (build-system python-build-system)
901 (arguments
902 `(#:phases
903 (modify-phases %standard-phases
904 (replace 'check
905 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
906 (when tests?
907 (add-installed-pythonpath inputs outputs)
908 (invoke "python" "-m" "pytest")))))))
909 (native-inputs
910 (list python-pytest python-setuptools-scm))
911 (home-page "https://github.com/pytest-dev/pytest-subtests")
912 (synopsis "Unittest subTest() support and subtests fixture")
913 (description "This Pytest plugin provides unittest @code{subTest()}
914 support and @code{subtests} fixture.")
915 (license license:expat)))
916
917 (define-public python-pytest-vcr
918 ;; This commit fixes integration with pytest-5
919 (let ((commit "4d6c7b3e379a6a7cba0b8f9d20b704dc976e9f05")
920 (revision "1"))
921 (package
922 (name "python-pytest-vcr")
923 (version (git-version "1.0.2" revision commit))
924 (source
925 (origin
926 (method git-fetch)
927 (uri (git-reference
928 (url "https://github.com/ktosiek/pytest-vcr")
929 (commit commit)))
930 (file-name (git-file-name name version))
931 (sha256
932 (base32
933 "1yk988zi0la6zpcm3fff0mxf942di2jiymrfqas19nyngj5ygaqs"))))
934 (build-system python-build-system)
935 (arguments
936 `(#:phases
937 (modify-phases %standard-phases
938 (replace 'check
939 (lambda* (#:key inputs outputs #:allow-other-keys)
940 (add-installed-pythonpath inputs outputs)
941 (invoke "pytest" "tests/"))))))
942 (propagated-inputs
943 (list python-pytest python-vcrpy))
944 (home-page "https://github.com/ktosiek/pytest-vcr")
945 (synopsis "Plugin for managing VCR.py cassettes")
946 (description
947 "Plugin for managing VCR.py cassettes.")
948 (license license:expat))))
949
950 (define-public python-pytest-doctest-custom
951 (package
952 (name "python-pytest-doctest-custom")
953 (version "1.0.0")
954 (source
955 (origin
956 (method url-fetch)
957 (uri (pypi-uri "pytest-doctest-custom" version))
958 (sha256
959 (base32 "0kxkdd6q9c3h31kc88lbyfll4c45b0zjd24cbr4c083fcvcy7lip"))))
960 (build-system python-build-system)
961 (arguments
962 `(#:phases
963 (modify-phases %standard-phases
964 (replace 'check
965 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
966 (when tests?
967 (add-installed-pythonpath inputs outputs)
968 (invoke "python" "test_pytest_doctest_custom.py")))))))
969 (native-inputs
970 (list python-pytest))
971 (home-page "https://github.com/danilobellini/pytest-doctest-custom")
972 (synopsis
973 "Pytest plugin to customize string representations of doctest results")
974 (description "This package provides a Pytest plugin for customizing string
975 representations of doctest results. It can change the display hook used by
976 doctest to render the object representations.")
977 (license license:expat)))
978
979 (define-public python-pytest-checkdocs
980 (package
981 (name "python-pytest-checkdocs")
982 (version "2.7.1")
983 (source
984 (origin
985 (method url-fetch)
986 (uri (pypi-uri "pytest-checkdocs" version))
987 (sha256
988 (base32 "1bn1wr3yz8avkwacffyh26za7mg20f9pajpakfk4cn7yvmgbhcrb"))))
989 (build-system python-build-system)
990 (arguments (list #:tests? #f)) ;no tests in pypi archive
991 (propagated-inputs
992 (list python-docutils
993 python-importlib-metadata
994 python-pep517
995 python-pytest))
996 (native-inputs (list python-setuptools-scm))
997 (home-page "https://github.com/jaraco/pytest-checkdocs")
998 (synopsis "Check the README when running tests")
999 (description
1000 "This package provides a pytest plugin that checks the long description
1001 of the project to ensure it renders properly.")
1002 (license license:expat)))
1003
1004 (define-public python-re-assert
1005 (package
1006 (name "python-re-assert")
1007 (version "1.1.0")
1008 (source
1009 (origin
1010 ;; There are no tests in the PyPI tarball.
1011 (method git-fetch)
1012 (uri (git-reference
1013 (url "https://github.com/asottile/re-assert")
1014 (commit (string-append "v" version))))
1015 (file-name (git-file-name name version))
1016 (sha256
1017 (base32 "1rssq4wpqmx1c17hjfx5l3sn3zmnlz9jffddiqrs4f6h7m6cadai"))))
1018 (build-system python-build-system)
1019 (arguments
1020 `(#:phases
1021 (modify-phases %standard-phases
1022 (replace 'check
1023 (lambda _
1024 (invoke "pytest" "-vv"))))))
1025 (native-inputs
1026 (list python-covdefaults python-coverage python-pytest))
1027 (propagated-inputs
1028 (list python-regex))
1029 (home-page "https://github.com/asottile/re-assert")
1030 (synopsis "Show where your regex match assertion failed")
1031 (description
1032 "@code{re-assert} provides a helper class to make assertions of regexes
1033 simpler.")
1034 (license license:expat)))
1035
1036 (define-public python-pytest-trio
1037 (package
1038 (name "python-pytest-trio")
1039 (version "0.7.0")
1040 (source
1041 (origin
1042 (method url-fetch)
1043 (uri (pypi-uri "pytest-trio" version))
1044 (sha256
1045 (base32 "0c8cqf9by2884riksrqymqfp2g1d2d798a2zalcw9hmf34c786y0"))))
1046 (build-system python-build-system)
1047 (arguments
1048 `(#:phases
1049 (modify-phases %standard-phases
1050 (replace 'check
1051 (lambda* (#:key tests? inputs outputs #:allow-other-keys)
1052 (when tests?
1053 (add-installed-pythonpath inputs outputs)
1054 (invoke "pytest" "-W" "error" "-ra" "-v" "--pyargs"
1055 "pytest_trio" "--verbose" "--cov" "-k"
1056 (string-append
1057 ;; Needs network
1058 "not test_async_yield_fixture_with_nursery"
1059 " and not test_try"
1060 ;; No keyboard interrupt in our build environment.
1061 " and not test_actual_test"))))))))
1062 (native-inputs
1063 (list python-hypothesis python-pytest python-pytest-cov))
1064 (propagated-inputs
1065 (list python-async-generator python-outcome python-pytest python-trio))
1066 (home-page "https://github.com/python-trio/pytest-trio")
1067 (synopsis "Pytest plugin for trio")
1068 (description
1069 "This is a pytest plugin to help you test projects that use Trio, a
1070 friendly library for concurrency and async I/O in Python.")
1071 ;; Either license applies.
1072 (license (list license:expat license:asl2.0))))
1073
1074 (define-public python-pytest-flake8
1075 (package
1076 (name "python-pytest-flake8")
1077 (version "1.0.7")
1078 (source
1079 (origin
1080 (method url-fetch)
1081 (uri (pypi-uri "pytest-flake8" version))
1082 (sha256
1083 (base32
1084 "0syx68xk5ss3hgp3nr2y122w0fgkzr5936ghsqrkymh3m5hrf9gh"))))
1085 (build-system python-build-system)
1086 (propagated-inputs
1087 (list python-flake8))
1088 (native-inputs
1089 (list python-pytest))
1090 (home-page "https://github.com/tholo/pytest-flake8")
1091 (synopsis "Pytest plugin to check FLAKE8 requirements")
1092 (description
1093 "This package provides a pytest plugin for efficiently checking PEP8
1094 compliance.")
1095 (license license:bsd-3)))
1096
1097 (define-public python-pytest-isort
1098 (package
1099 (name "python-pytest-isort")
1100 (version "2.0.0")
1101 (source
1102 (origin
1103 (method url-fetch)
1104 (uri (pypi-uri "pytest-isort" version))
1105 (sha256
1106 (base32 "05wi28zlqk3jafpjal8j523y5jcsx3xl3id9rx93qfjgkif8q6l2"))))
1107 (build-system python-build-system)
1108 (arguments
1109 `(#:phases
1110 (modify-phases %standard-phases
1111 (replace 'check
1112 (lambda* (#:key tests? #:allow-other-keys)
1113 (when tests?
1114 (invoke "pytest")))))))
1115 (propagated-inputs
1116 (list python-isort python-pytest))
1117 (native-inputs
1118 (list python-mock))
1119 (home-page "https://github.com/moccu/pytest-isort/")
1120 (synopsis "Pytest plugin to check import ordering using isort")
1121 (description
1122 "This package provides a pytest plugin to check import ordering using
1123 isort.")
1124 (license license:bsd-3)))
1125
1126 (define-public python-pytest-shutil
1127 (package
1128 (name "python-pytest-shutil")
1129 (version "1.7.0")
1130 (source
1131 (origin
1132 (method url-fetch)
1133 (uri (pypi-uri "pytest-shutil" version))
1134 (sha256
1135 (base32
1136 "0q8j0ayzmnvlraml6i977ybdq4xi096djhf30n2m1rvnvrhm45nq"))))
1137 (build-system python-build-system)
1138 (arguments
1139 `(#:phases
1140 (modify-phases %standard-phases
1141 (add-after 'unpack 'use-path-instead-of-path.py
1142 ;; path.py is obsolete.
1143 (lambda _
1144 (substitute* "setup.py"
1145 (("'path.py'")
1146 "'path'"))))
1147 (add-after 'unpack 'patch-tests
1148 (lambda _
1149 (mkdir "/tmp/bin")
1150 (substitute* "tests/integration/test_cmdline_integration.py"
1151 (("dirname = '/bin'")
1152 "dirname = '/tmp/bin'")
1153 (("bindir = os.path.realpath\\('/bin'\\)")
1154 "bindir = os.path.realpath('/tmp/bin')")))))))
1155 (propagated-inputs
1156 (list python-contextlib2 python-execnet python-path python-termcolor))
1157 (native-inputs
1158 (list python-mock python-pytest python-setuptools-git))
1159 (home-page "https://github.com/manahl/pytest-plugins")
1160 (synopsis "Assorted shell and environment tools for py.test")
1161 (description
1162 "This package provides assorted shell and environment tools for the
1163 py.test testing framework.")
1164 (license license:expat)))
1165
1166 (define-public python-pytest-fixture-config
1167 (package
1168 (name "python-pytest-fixture-config")
1169 (version "1.7.0")
1170 (source
1171 (origin
1172 (method url-fetch)
1173 (uri (pypi-uri "pytest-fixture-config" version))
1174 (sha256
1175 (base32
1176 "13i1qpz22w3x4dmw8vih5jdnbqfqvl7jiqs0dg764s0zf8bp98a1"))))
1177 (build-system python-build-system)
1178 (native-inputs
1179 (list python-pytest python-setuptools-git))
1180 (home-page "https://github.com/manahl/pytest-plugins")
1181 (synopsis "Fixture configuration utils for py.test")
1182 (description
1183 "This package provides fixture configuration utilities for the py.test
1184 testing framework.")
1185 (license license:expat)))
1186
1187 (define-public python-pytest-virtualenv
1188 (package
1189 (name "python-pytest-virtualenv")
1190 (version "1.7.0")
1191 (source
1192 (origin
1193 (method url-fetch)
1194 (uri (pypi-uri "pytest-virtualenv" version))
1195 (sha256
1196 (base32
1197 "03w2zz3crblj1p6i8nq17946hbn3zqp9z7cfnifw47hi4a4fww12"))))
1198 (build-system python-build-system)
1199 (arguments
1200 `(#:phases
1201 (modify-phases %standard-phases
1202 ;; Reference the virtualenv executable directly, to avoid the need
1203 ;; for PYTHONPATH, which gets cleared when instantiating a new
1204 ;; virtualenv with pytest-virtualenv.
1205 (add-after 'unpack 'patch-virtualenv-executable
1206 (lambda* (#:key inputs #:allow-other-keys)
1207 (let* ((virtualenv (assoc-ref inputs "python-virtualenv"))
1208 (virtualenv-bin (string-append virtualenv
1209 "/bin/virtualenv")))
1210 (substitute* "pytest_virtualenv.py"
1211 (("^DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE.*$")
1212 (format #f "DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE = '~a'"
1213 virtualenv-bin)))
1214 #t))))))
1215 (propagated-inputs
1216 (list python-pytest-shutil python-pytest-fixture-config))
1217 (inputs
1218 (list python-virtualenv))
1219 (native-inputs
1220 (list python-mock python-pytest python-setuptools-git))
1221 (home-page "https://github.com/manahl/pytest-plugins")
1222 (synopsis "Virtualenv fixture for py.test")
1223 (description "This package provides a virtualenv fixture for the py.test
1224 framework.")
1225 (license license:expat)))
1226
1227 (define-public python-pytest-pycodestyle
1228 (package
1229 (name "python-pytest-pycodestyle")
1230 (version "2.2.0")
1231 (source
1232 (origin
1233 (method url-fetch)
1234 (uri (pypi-uri "pytest-pycodestyle" version))
1235 (sha256
1236 (base32
1237 "1clyjypn93hwvz17f4i6n2688835d4y8qsq2aw17d6fkbqiy8mg7"))))
1238 (build-system python-build-system)
1239 (propagated-inputs
1240 (list python-pycodestyle))
1241 (native-inputs
1242 (list python-pytest))
1243 (home-page "https://github.com/henry0312/pytest-pycodestyle")
1244 (synopsis "Pytest plugin to run pycodestyle")
1245 (description "This package provides a plugin to run @code{pycodestyle}
1246 for the @code{pytest} framework.")
1247 (license license:expat)))
1248
1249 (define-public python-pytest-benchmark
1250 (package
1251 (name "python-pytest-benchmark")
1252 (version "3.4.1")
1253 (source
1254 (origin
1255 (method url-fetch)
1256 (uri (pypi-uri "pytest-benchmark" version))
1257 (sha256
1258 (base32
1259 "0ivvrnhax2xr62grlgw4hlyjmmjp6nc35431j7c82nny2bwn7qj0"))))
1260 (build-system python-build-system)
1261 (arguments
1262 '(#:test-target "check"))
1263 (propagated-inputs
1264 (list python-py-cpuinfo))
1265 (native-inputs
1266 (list python-pytest))
1267 (home-page "https://github.com/ionelmc/pytest-benchmark")
1268 (synopsis "Pytest fixture for benchmarking code")
1269 (description
1270 "This package provides a pytest fixture that will group the tests into
1271 rounds that are calibrated to the chosen timer.")
1272 (license license:bsd-2)))
1273
1274 (define-public python-pytest-xvfb
1275 (package
1276 (name "python-pytest-xvfb")
1277 (version "2.0.0")
1278 (source
1279 (origin
1280 (method url-fetch)
1281 (uri (pypi-uri "pytest-xvfb" version))
1282 (sha256
1283 (base32 "1kyq5rg27dsnj7dc6x9y7r8vwf8rc88y2ppnnw6r96alw0nn9fn4"))))
1284 (build-system python-build-system)
1285 (arguments
1286 `(#:test-target "pytest"
1287 #:phases
1288 (modify-phases %standard-phases
1289 (add-before 'build 'prepare-tests
1290 (lambda _
1291 (system "Xvfb &")
1292 (setenv "DISPLAY" ":0")
1293
1294 ;; This test is meant to run on Windows.
1295 (delete-file "tests/test_xvfb_windows.py")
1296 #t)))))
1297 (native-inputs
1298 (list python-pytest python-pytest-runner xorg-server-for-tests))
1299 (propagated-inputs
1300 (list python-pyvirtualdisplay))
1301 (home-page "https://github.com/The-Compiler/pytest-xvfb")
1302 (synopsis "Pytest plugin to run Xvfb for tests")
1303 (description
1304 "This package provides a Pytest plugin to run Xvfb for tests.")
1305 (license license:expat)))
1306
1307 (define-public python-pytest-services
1308 (package
1309 (name "python-pytest-services")
1310 (version "1.3.1")
1311 (source
1312 (origin
1313 (method url-fetch)
1314 (uri (pypi-uri "pytest-services" version))
1315 (sha256
1316 (base32
1317 "0b2zfv04w6m3gp2v44ifdhx22vcji069qnn95ry3zcyxib7cjnq3"))))
1318 (build-system python-build-system)
1319 (arguments '(#:tests? #f)) ; Tests not included in release tarball.
1320 (propagated-inputs
1321 (list python-psutil python-requests))
1322 (native-inputs
1323 (list python-pytest))
1324 (home-page "https://github.com/pytest-dev/pytest-services")
1325 (synopsis "Services plugin for pytest testing framework")
1326 (description
1327 "This plugin provides a set of fixtures and utility functions to start
1328 service processes for your tests with pytest.")
1329 (license license:expat)))
1330
1331 (define-public python-pytest-toolbox
1332 (package
1333 (name "python-pytest-toolbox")
1334 (version "0.4")
1335 (source
1336 (origin
1337 ;; No tests in the PyPI tarball.
1338 (method git-fetch)
1339 (uri (git-reference
1340 (url "https://github.com/samuelcolvin/pytest-toolbox")
1341 (commit (string-append "v" version))))
1342 (file-name (git-file-name name version))
1343 (sha256
1344 (base32 "1wqkr3g5gmqdxmhzfsxbwy8pm3cadaj6a8cxq58w9bacly4hqbh0"))))
1345 (build-system python-build-system)
1346 (arguments
1347 '(#:phases
1348 (modify-phases %standard-phases
1349 (replace 'check
1350 (lambda* (#:key tests? inputs outputs #:allow-other-keys)
1351 (when tests?
1352 (substitute* "setup.cfg"
1353 ((".*timeout.*") ""))
1354 ;; Make the installed plugin discoverable by Pytest.
1355 (add-installed-pythonpath inputs outputs)
1356 (invoke "pytest" "-vv")))))))
1357 (native-inputs
1358 (list python-pydantic python-pytest python-pytest-isort))
1359 (home-page "https://github.com/samuelcolvin/pytest-toolbox")
1360 (synopsis "Numerous useful plugins for Pytest")
1361 (description
1362 "Pytest Toolbox contains many useful plugins for Pytest. Among them are
1363 new fixtures, new methods and new comparison objects.")
1364 (license license:expat)))
1365
1366 (define-public python-pytest-aiohttp
1367 (package
1368 (name "python-pytest-aiohttp")
1369 (version "0.3.0")
1370 (source
1371 (origin
1372 (method url-fetch)
1373 (uri (pypi-uri "pytest-aiohttp" version))
1374 (sha256
1375 (base32
1376 "0kx4mbs9bflycd8x9af0idcjhdgnzri3nw1qb0vpfyb3751qaaf9"))))
1377 (build-system python-build-system)
1378 (native-inputs
1379 (list python-pytest))
1380 (propagated-inputs
1381 (list python-aiohttp))
1382 (home-page "https://github.com/aio-libs/pytest-aiohttp/")
1383 (synopsis "Pytest plugin for aiohttp support")
1384 (description "This package provides a pytest plugin for aiohttp support.")
1385 (license license:asl2.0)))
1386
1387 (define-public python-nbval
1388 (package
1389 (name "python-nbval")
1390 (version "0.9.6")
1391 (source
1392 (origin
1393 (method url-fetch)
1394 (uri (pypi-uri "nbval" version))
1395 (sha256
1396 (base32 "0h3xrnw0mj1srigrx2rfnd73h8s0xjycclmjs0vx7qkfyqpcvvyg"))))
1397 (build-system python-build-system)
1398 (arguments
1399 `(#:phases
1400 (modify-phases %standard-phases
1401 (add-before 'check 'fix-test
1402 (lambda _
1403 ;; This test fails because of a mismatch in the output of LaTeX
1404 ;; equation environments. Seems OK to skip.
1405 (delete-file
1406 "tests/ipynb-test-samples/test-latex-pass-correctouput.ipynb")))
1407 (replace 'check
1408 (lambda* (#:key tests? #:allow-other-keys)
1409 (when tests?
1410 (invoke "pytest" "-vv" "-k"
1411 (string-append
1412 ;; This only works with Pytest < 5.
1413 "not nbdime_reporter"
1414 ;; https://github.com/computationalmodelling/nbval/pull/148.
1415 " and not test_timeouts"
1416 ;; It seems the output format has changed; the following
1417 ;; test fails with "Unexpected output fields from
1418 ;; running code: {'text/plain'}".
1419 " and not test_conf_ignore_stderr "))))))))
1420 (native-inputs
1421 (list python-pytest python-pytest-cov python-sympy))
1422 (propagated-inputs
1423 (list python-ipykernel python-jupyter-client python-nbformat
1424 python-six))
1425 (home-page "https://github.com/computationalmodelling/nbval")
1426 (synopsis "Pytest plugin to validate Jupyter notebooks")
1427 (description
1428 "This plugin adds functionality to Pytest to recognise and collect Jupyter
1429 notebooks. The intended purpose of the tests is to determine whether execution
1430 of the stored inputs match the stored outputs of the @file{.ipynb} file. Whilst
1431 also ensuring that the notebooks are running without errors.")
1432 (license license:bsd-3)))
1433
1434 (define-public python-pytest-flask
1435 (package
1436 (name "python-pytest-flask")
1437 (version "1.0.0")
1438 (source
1439 (origin
1440 (method url-fetch)
1441 (uri (pypi-uri "pytest-flask" version))
1442 (sha256
1443 (base32
1444 "1hln7mwgdzfi5ma0kqfsi768l7p24jhkw8l0imhifwy08nh7hmjd"))))
1445 (build-system python-build-system)
1446 (native-inputs
1447 (list python-flask python-pytest python-setuptools-scm
1448 python-werkzeug))
1449 (home-page "https://github.com/pytest-dev/pytest-flask")
1450 (synopsis "Pytest fixtures to test Flask applications")
1451 (description
1452 "This pytest plugin provides fixtures to simplify Flask app testing.")
1453 (license license:expat)))
1454
1455 (define-public python-pytest-console-scripts
1456 (package
1457 (name "python-pytest-console-scripts")
1458 (version "1.2.1")
1459 (source
1460 (origin
1461 (method url-fetch)
1462 (uri (pypi-uri "pytest-console-scripts" version))
1463 (sha256
1464 (base32
1465 "1qsw3i2h3psyi5avwf14panx8wxqfik2z7294dy37w8ha415iwn7"))))
1466 (build-system python-build-system)
1467 (arguments
1468 `(#:phases
1469 (modify-phases %standard-phases
1470 (replace 'check
1471 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
1472 (when tests?
1473 (add-installed-pythonpath inputs outputs)
1474 (invoke "pytest" "--verbose"
1475 ;; This one test fails because of PATH assumptions
1476 "-k" "not test_elsewhere_in_the_path")))))))
1477 (propagated-inputs
1478 (list python-mock python-pytest))
1479 (native-inputs
1480 (list python-setuptools-scm))
1481 (home-page "https://github.com/kvas-it/pytest-console-scripts")
1482 (synopsis "Pytest plugin for testing console scripts")
1483 (description
1484 "This package provides a pytest plugin for testing console scripts.")
1485 (license license:expat)))
1486
1487 (define-public python-pytest-tornado
1488 (package
1489 (name "python-pytest-tornado")
1490 (version "0.8.1")
1491 (source (origin
1492 (method git-fetch) ;no tests in pypi archive
1493 (uri (git-reference
1494 (url "https://github.com/eugeniy/pytest-tornado")
1495 (commit (string-append "v" version))))
1496 (file-name (git-file-name name version))
1497 (sha256
1498 (base32
1499 "05hgq1m9g35kpc01im7ci1wd85xi1rdxnyms9izjg65c9976zn6x"))))
1500 (build-system python-build-system)
1501 (arguments
1502 (list
1503 #:phases
1504 #~(modify-phases %standard-phases
1505 (replace 'check
1506 (lambda* (#:key tests? #:allow-other-keys)
1507 (when tests?
1508 (invoke "pytest" "-vv")))))))
1509 (propagated-inputs (list python-pytest python-setuptools python-tornado))
1510 (home-page "https://github.com/eugeniy/pytest-tornado")
1511 (synopsis "Pytest plugin to ease testing tornado applications")
1512 (description
1513 "This package provides a py.test plugin providing fixtures and markers to
1514 simplify testing of asynchronous tornado applications.")
1515 (license license:asl2.0)))
1516
1517 (define-public python-pytest-tornasync
1518 (package
1519 (name "python-pytest-tornasync")
1520 (version "0.6.0.post2")
1521 (source
1522 (origin
1523 (method url-fetch)
1524 (uri (pypi-uri "pytest-tornasync" version))
1525 (sha256
1526 (base32
1527 "0pdyddbzppkfqwa7g17sdfl4w2v1hgsky78l8f4c1rx2a7cvd0fp"))))
1528 (build-system python-build-system)
1529 (arguments
1530 `(#:tests? #false ; TODO: fails at "from test import MESSAGE, PAUSE_TIME"
1531 #:phases
1532 (modify-phases %standard-phases
1533 (replace 'check
1534 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
1535 (when tests?
1536 (add-installed-pythonpath inputs outputs)
1537 (invoke "pytest" "--verbose")))))))
1538 (propagated-inputs
1539 (list python-pytest python-tornado))
1540 (home-page "https://github.com/eukaryote/pytest-tornasync")
1541 (synopsis "Pytest plugin for testing Tornado code")
1542 (description
1543 "This package provides a simple pytest plugin that provides some helpful
1544 fixtures for testing Tornado (version 5.0 or newer) apps and easy handling of
1545 plain (undecoratored) native coroutine tests.")
1546 (license license:expat)))
1547
1548 (define-public python-pytest-celery
1549 (package
1550 (name "python-pytest-celery")
1551 (version "0.0.0")
1552 (source
1553 (origin
1554 (method url-fetch)
1555 (uri (pypi-uri "pytest-celery" version))
1556 (sha256
1557 (base32 "01pli108qqiiyrn8qsqqabcpazrzj27r7cji9wgglsk76by61l6g"))))
1558 (build-system python-build-system)
1559 (arguments
1560 `(#:tests? #f ; no tests and circular dependency on python-celery
1561 #:phases
1562 (modify-phases %standard-phases
1563 (delete 'sanity-check)))) ; checks for celery
1564 (home-page "https://github.com/graingert/pytest-celery")
1565 (synopsis "Shim pytest plugin to enable @code{celery.contrib.pytest}")
1566 (description
1567 "This package provides a shim Pytest plugin to enable a Celery marker.")
1568 (license license:bsd-3)))
1569
1570 (define-public python-pytest-env
1571 (package
1572 (name "python-pytest-env")
1573 (version "0.6.2")
1574 (source
1575 (origin
1576 (method url-fetch)
1577 (uri (pypi-uri "pytest-env" version))
1578 (sha256
1579 (base32 "1hl0ln0cicdid4qjk7mv90lw9xkb0v71dlj7q7rn89vzxxm9b53y"))))
1580 (build-system python-build-system)
1581 (native-inputs
1582 (list python-pytest))
1583 (home-page "https://github.com/MobileDynasty/pytest-env")
1584 (synopsis "Pytest plugin that allows you to add environment variables")
1585 (description
1586 "This is a @code{py.test} plugin that enables you to set environment
1587 variables in the @file{pytest.ini} file.")
1588 (license license:expat)))
1589
1590 (define-public python-pyux
1591 (package
1592 (name "python-pyux")
1593 (version "0.0.6")
1594 (source
1595 (origin
1596 (method url-fetch)
1597 (uri (pypi-uri "pyux" version))
1598 (sha256
1599 (base32
1600 "1i17xh4dy238ibrjdgh8vn78fk5q6dj37mcznpvdfzidj57js7ca"))))
1601 (build-system python-build-system)
1602 (arguments
1603 `(#:tests? #f)) ;the mini test suite fails
1604 (home-page "https://github.com/farizrahman4u/pyux")
1605 (synopsis "Utility to check API integrity in Python libraries")
1606 (description "The pyux utility detects API changes in Python
1607 libraries.")
1608 (license license:expat)))
1609
1610 (define-public python-pytest-qt
1611 (package
1612 (name "python-pytest-qt")
1613 (version "3.3.0")
1614 (source
1615 (origin
1616 (method url-fetch)
1617 (uri (pypi-uri "pytest-qt" version))
1618 (sha256
1619 (base32 "09c9psfn3zigpaw1l1cmynpa3csxa49wc2ih5lzl24skdkw0njvi"))))
1620 (build-system python-build-system)
1621 (arguments
1622 `(#:test-target "pytest"
1623 #:phases
1624 (modify-phases %standard-phases
1625 (add-before 'check 'set-qpa
1626 (lambda _
1627 (setenv "QT_QPA_PLATFORM" "offscreen")
1628 #t)))))
1629 (propagated-inputs
1630 (list python-pyqt-without-qtwebkit))
1631 (native-inputs
1632 (list python-pytest python-pytest-runner python-setuptools-scm))
1633 (home-page "https://github.com/pytest-dev/pytest-qt")
1634 (synopsis "Pytest support for PyQt and PySide applications")
1635 (description
1636 "@code{pytest-qt} is a Pytest plugin that allows programmers to write
1637 tests for PyQt5 and PySide2 applications.
1638
1639 The main usage is to use the @code{qtbot} fixture, responsible for handling
1640 @code{qApp} creation as needed and provides methods to simulate user
1641 interaction, like key presses and mouse clicks.")
1642 (license license:expat)))
1643
1644 (define-public python-codacy-coverage
1645 (package
1646 (name "python-codacy-coverage")
1647 (version "1.3.11")
1648 (source
1649 (origin
1650 (method url-fetch)
1651 (uri (pypi-uri "codacy-coverage" version))
1652 (sha256
1653 (base32
1654 "1g0c0w56xdkmqb8slacyw5qhzrkp814ng3ddh2lkiij58y9m2imr"))))
1655 (build-system python-build-system)
1656 (arguments
1657 `(#:tests? #f)); no tests
1658 (propagated-inputs
1659 (list python-check-manifest python-requests))
1660 (home-page "https://github.com/codacy/python-codacy-coverage")
1661 (synopsis "Codacy coverage reporter for Python")
1662 (description "This package analyses Python test suites and reports how much
1663 of the code is covered by them. This tool is part of the Codacy suite for
1664 analysing code quality.")
1665 (license license:expat)))
1666
1667 (define-public python-httmock
1668 (package
1669 (name "python-httmock")
1670 (version "1.3.0")
1671 (source
1672 (origin
1673 (method url-fetch)
1674 (uri (pypi-uri "httmock" version))
1675 (sha256
1676 (base32
1677 "1zj1fcm0n6f0wr9mr0hmlqz9430fnr5cdwd5jkcvq9j44bnsrfz0"))))
1678 (build-system python-build-system)
1679 (arguments
1680 `(#:tests? #f)); no tests
1681 (propagated-inputs
1682 (list python-requests))
1683 (home-page "https://github.com/patrys/httmock")
1684 (synopsis "Mocking library for requests")
1685 (description "This package provides a library for replying fake data to
1686 Python software under test, when they make an HTTP query.")
1687 (license license:asl2.0)))
1688
1689 (define-public python-atpublic
1690 (package
1691 (name "python-atpublic")
1692 (version "1.0")
1693 (source
1694 (origin
1695 (method url-fetch)
1696 (uri (pypi-uri "atpublic" version))
1697 (sha256
1698 (base32
1699 "0i3sbxkdlbb4560rrlmwwd5y4ps7k73lp4d8wnmd7ag9k426gjkx"))))
1700 (build-system python-build-system)
1701 (arguments
1702 '(#:phases
1703 (modify-phases %standard-phases
1704 (add-before 'build 'enable-c-implementation
1705 (lambda _
1706 (setenv "ATPUBLIC_BUILD_EXTENSION" "yes")
1707 #t))
1708 (replace 'check
1709 (lambda _
1710 (invoke "python" "-m" "nose2" "-v"))))))
1711 (native-inputs
1712 (list python-nose2))
1713 (home-page "https://public.readthedocs.io/")
1714 (synopsis "@code{@@public} decorator for populating @code{__all__}")
1715 (description
1716 "This Python module adds a @code{@@public} decorator and function which
1717 populates a module's @code{__all__} and optionally the module globals. With
1718 it, the declaration of a name's public export semantics are not separated from
1719 the implementation of that name.")
1720 (license (list license:asl2.0
1721 license:lgpl3)))) ; only for setup_helpers.py
1722
1723 (define-public python-mockito
1724 (package
1725 (name "python-mockito")
1726 (version "1.2.2")
1727 (source
1728 (origin
1729 (method git-fetch) ;no tests in pypi archive
1730 (uri (git-reference
1731 (url "https://github.com/kaste/mockito-python")
1732 (commit version)))
1733 (file-name (git-file-name name version))
1734 (sha256
1735 (base32
1736 "0fg8jflcf4c929gd4zbcrk73d08waaqjfjmdjrgnv54mzl35pjxl"))))
1737 (build-system python-build-system)
1738 (arguments
1739 `(#:phases
1740 (modify-phases %standard-phases
1741 (replace 'check
1742 (lambda* (#:key tests? #:allow-other-keys)
1743 (when tests?
1744 (invoke "pytest")))))))
1745 (native-inputs
1746 (list python-numpy python-pytest))
1747 (home-page "https://github.com/kaste/mockito-python")
1748 (synopsis "Mocking library for Python")
1749 (description "This package provides a Python implementation of the Java
1750 library of the same name. It eases monkey patching, for example to stub out
1751 side effects when unit testing.")
1752 (license license:expat)))
1753
1754 (define-public python-mypy-extensions
1755 (package
1756 (name "python-mypy-extensions")
1757 (version "0.4.3")
1758 (source
1759 (origin
1760 (method url-fetch)
1761 (uri (pypi-uri "mypy_extensions" version))
1762 (sha256
1763 (base32
1764 "1a04qsk8hd1lqns8w1j7cr0vmvbhg450di5k1i16kqxkbf7q30id"))))
1765 (build-system python-build-system)
1766 (arguments `(#:tests? #f)); no tests
1767 (home-page "https://github.com/python/mypy_extensions")
1768 (synopsis "Experimental extensions for MyPy")
1769 (description "The @code{python-mypy-extensions} module defines
1770 experimental extensions to the standard @code{typing} module that are
1771 supported by the MyPy typechecker.")
1772 (license license:expat)))
1773
1774 (define-public python-mypy
1775 (package
1776 (name "python-mypy")
1777 (version "0.971")
1778 (source
1779 (origin
1780 ;; Because of https://github.com/python/mypy/issues/9584, the
1781 ;; mypyc/analysis directory is missing in the PyPI archive, leading to
1782 ;; test failures.
1783 (method git-fetch)
1784 (uri (git-reference
1785 (url "https://github.com/python/mypy")
1786 (commit (string-append "v" version))
1787 ;; Fetch git submodules otherwise typeshed is not fetched.
1788 ;; Typeshed is a collection of Python sources type annotation
1789 ;; (data) files.
1790 (recursive? #t)))
1791 (file-name (git-file-name name version))
1792 (sha256
1793 (base32
1794 "0i8swdynms1wpiprgqn24za6mx8rlgxr2jash3cb5xi8jyf58n97"))))
1795 (build-system python-build-system)
1796 (arguments
1797 `(#:phases
1798 (modify-phases %standard-phases
1799 (replace 'check
1800 (lambda* (#:key tests? #:allow-other-keys)
1801 (when tests?
1802 (invoke "pytest" "-vv" "mypyc"
1803 ;; XXX: This test gets an unexpected DeprecationWarning
1804 ;; from recent versions of setuptools. Ignore for now.
1805 "-k" "not testImports")))))))
1806 (native-inputs
1807 (list python-attrs
1808 python-lxml
1809 python-psutil
1810 python-pytest
1811 python-pytest-forked
1812 python-pytest-xdist
1813 python-virtualenv))
1814 (propagated-inputs
1815 (list python-mypy-extensions python-tomli python-typing-extensions))
1816 (home-page "http://www.mypy-lang.org/")
1817 (synopsis "Static type checker for Python")
1818 (description "Mypy is an optional static type checker for Python that aims
1819 to combine the benefits of dynamic typing and static typing. Mypy combines
1820 the expressive power and convenience of Python with a powerful type system and
1821 compile-time type checking. Mypy type checks standard Python programs; run
1822 them using any Python VM with basically no runtime overhead.")
1823 ;; Most of the code is under MIT license; Some files are under Python Software
1824 ;; Foundation License version 2: stdlib-samples/*, mypyc/lib-rt/pythonsupport.h and
1825 ;; mypyc/lib-rt/getargs.c
1826 (license (list license:expat license:psfl))))
1827
1828 ;;; This variant exists to break a cycle between python-pylama and python-isort.
1829 (define-public python-mypy-minimal
1830 (hidden-package
1831 (package
1832 (inherit python-mypy)
1833 (name "python-mypy-minimal")
1834 (arguments
1835 `(#:tests? #f
1836 #:phases (modify-phases %standard-phases
1837 ;; XXX: Fails with: "In procedure utime: No such file or
1838 ;; directory".
1839 (delete 'ensure-no-mtimes-pre-1980))))
1840 (native-inputs '()))))
1841
1842 (define-public python-nptyping
1843 (package
1844 (name "python-nptyping")
1845 (version "2.0.0")
1846 (source (origin
1847 (method git-fetch) ;pypi only contains a binary wheel
1848 (uri (git-reference
1849 (url "https://github.com/ramonhagenaars/nptyping")
1850 (commit (string-append "v" version))))
1851 (file-name (git-file-name name version))
1852 (sha256
1853 (base32
1854 "0839mcrv5jljq9k9124ssnl1hc1inbxwlwjk72imabsbqssjy9rb"))))
1855 (build-system python-build-system)
1856 (arguments
1857 `(#:phases
1858 (modify-phases %standard-phases
1859 (add-before 'build 'set-source-date-epoch
1860 (lambda _
1861 ;; Otherwise the wheel building test would fail with "ZIP does
1862 ;; not support timestamps before 1980".
1863 (setenv "SOURCE_DATE_EPOCH" "315532800"))))))
1864 (native-inputs
1865 (list python-beartype
1866 python-mypy
1867 python-typeguard
1868 python-wheel))
1869 (propagated-inputs (list python-numpy python-typing-extensions))
1870 (home-page "https://github.com/ramonhagenaars/nptyping")
1871 (synopsis "Type hints for Numpy")
1872 (description "This package provides extensive dynamic type checks for
1873 dtypes and shapes of arrays for NumPy, extending @code{numpy.typing}.")
1874 (license license:expat)))
1875
1876 (define-public python-pylama
1877 (package
1878 (name "python-pylama")
1879 (version "7.7.1")
1880 (source
1881 (origin
1882 (method url-fetch)
1883 (uri (pypi-uri "pylama" version))
1884 (sha256
1885 (base32
1886 "13vx7daqz2918y9s8q3v2i3xaq3ah43a9p58srqi6hqskkpm7blv"))))
1887 (build-system python-build-system)
1888 (arguments
1889 `(#:phases (modify-phases %standard-phases
1890 (add-after 'unpack 'disable-failing-tests
1891 (lambda _
1892 ;; Fails with: "ImportError: cannot import name
1893 ;; 'commented_out_code_line_numbers' from 'eradicate'".
1894 (delete-file "pylama/lint/pylama_eradicate.py")
1895 ;; Requires python-astroid, which fails to build on
1896 ;; Python 3.9+ (see:
1897 ;; https://github.com/PyCQA/astroid/issues/881).
1898 (delete-file "pylama/lint/pylama_pylint.py"))))))
1899 (native-inputs
1900 (list python-py python-pytest python-radon))
1901 (propagated-inputs
1902 `(("python-mccabe" ,python-mccabe)
1903 ("python-mypy", python-mypy-minimal)
1904 ("python-pycodestyle" ,python-pycodestyle)
1905 ("python-pydocstyle" ,python-pydocstyle)
1906 ("python-pyflakes" ,python-pyflakes)))
1907 (home-page "https://github.com/klen/pylama")
1908 (synopsis "Code audit tool for python")
1909 (description "Pylama is a code audit tool for Python and JavaScript to check
1910 for style, syntax and other code health metrics. It is essentially a
1911 convenient wrapper above tools such as Pyflakes, pydocstyle, pycodestyle and
1912 McCabe, among others.")
1913 (license license:lgpl3+)))
1914
1915 (define-public python-pyannotate
1916 (package
1917 (name "python-pyannotate")
1918 (version "1.2.0")
1919 (source
1920 (origin
1921 (method url-fetch)
1922 (uri (pypi-uri "pyannotate" version))
1923 (sha256
1924 (base32
1925 "16bm0mf7wxvy0lgmcs1p8n1ji8pnvj1jvj8zk3am70dkp825iv84"))))
1926 (build-system python-build-system)
1927 (propagated-inputs
1928 (list python-mypy-extensions python-six))
1929 (home-page
1930 "https://github.com/dropbox/pyannotate")
1931 (synopsis "Auto-generate PEP-484 annotations")
1932 (description "This package, PyAnnotate, is used to auto-generate PEP-484
1933 annotations.")
1934 (license license:asl2.0)))
1935
1936 (define-public python-eradicate
1937 (package
1938 (name "python-eradicate")
1939 (version "2.0.0")
1940 (source
1941 (origin
1942 (method url-fetch)
1943 (uri (pypi-uri "eradicate" version))
1944 (sha256
1945 (base32
1946 "1j30g9jfmbfki383qxwrfds8b23yiwywj40lng4lqcf5yab4ahr7"))))
1947 (build-system python-build-system)
1948 (home-page "https://github.com/myint/eradicate")
1949 (synopsis "Remove commented-out code from Python sources")
1950 (description "The @command{eradicate} command removes commented-out code
1951 from Python files. It does this by detecting block comments that contain
1952 valid Python syntax that are likely to be commented out code.")
1953 (license license:expat)))
1954
1955 (define-public python-robber
1956 (package
1957 (name "python-robber")
1958 (version "1.1.5")
1959 (source (origin
1960 (method url-fetch)
1961 (uri (pypi-uri "robber" version))
1962 (sha256
1963 (base32
1964 "0xp5csgv2g9q38hscml6bc5i1nm4xy5lzqqiimm2drxsf0hw2nq5"))))
1965 (build-system python-build-system)
1966 ;; There are no tests in the tarball downloaded from PyPI.
1967 ;; The last version tagged in Github (0.1.0) is older than the one on PyPI.
1968 ;; Reported upstream: <https://github.com/vesln/robber.py/issues/20>.
1969 (arguments '(#:tests? #f))
1970 (propagated-inputs
1971 (list python-mock python-termcolor))
1972 ;; URL of the fork used to generate the package available on PyPI.
1973 (home-page "https://github.com/EastAgile/robber.py")
1974 (synopsis "Test-driven development (TDD) assertion library for Python")
1975 (description "Robber is a Python assertion library for test-driven and
1976 behavior-driven development (TDD and BDD).")
1977 (license license:expat)))
1978
1979 (define-public python-stestr
1980 (package
1981 (name "python-stestr")
1982 (version "3.2.1")
1983 (source
1984 (origin
1985 (method url-fetch)
1986 (uri (pypi-uri "stestr" version))
1987 (sha256
1988 (base32
1989 "1kg9gfdr4bj2m7s1r44z530a0ba4p17j4jlhcn1xha0j8jmyfgn2"))))
1990 (build-system python-build-system)
1991 (arguments
1992 `(#:tests? #f)) ;to avoid circular dependencies
1993 (native-inputs
1994 (list python-pbr))
1995 (propagated-inputs
1996 (list python-cliff
1997 python-fixtures
1998 python-future
1999 python-pyyaml
2000 python-subunit
2001 python-testtools
2002 python-voluptuous))
2003 (home-page "https://stestr.readthedocs.io/en/latest/")
2004 (synopsis "Parallel Python test runner")
2005 (description "This package provides the @command{stestr} command, a
2006 parallel Python test runner built around @code{subunit}. It is designed to
2007 execute @code{unittest} test suites using multiple processes to split up
2008 execution of a test suite. It will also store a history of all test runs to
2009 help in debugging failures and optimizing the scheduler to improve speed.")
2010 (license license:asl2.0)))
2011
2012 ;; This is only used by python-sanic
2013 (define-public python-pytest-sanic
2014 (package
2015 (name "python-pytest-sanic")
2016 (version "1.9.1")
2017 (source (origin
2018 (method url-fetch)
2019 (uri (pypi-uri "pytest-sanic" version))
2020 (sha256
2021 (base32
2022 "0shq1bqnydj0l3ipb73j1qh5kqcjvzkps30zk8grq3dwmh3wmnkr"))))
2023 (build-system python-build-system)
2024 (arguments
2025 ;; Tests depend on python-sanic.
2026 `(#:tests? #f))
2027 (propagated-inputs
2028 (list python-httpx python-async-generator python-pytest
2029 python-websockets))
2030 (home-page
2031 "https://github.com/yunstanford/pytest-sanic")
2032 (synopsis "Pytest plugin for Sanic")
2033 (description "A pytest plugin for Sanic. It helps you to test your
2034 code asynchronously.")
2035 (license license:expat)))
2036
2037 (define-public python-allpairspy
2038 (package
2039 (name "python-allpairspy")
2040 (version "2.5.0")
2041 (source
2042 (origin
2043 (method url-fetch)
2044 (uri (pypi-uri "allpairspy" version))
2045 (sha256
2046 (base32 "1c987h13dly9919d15w3h747rgn50ilnv7dginhlprxbj564hn4k"))))
2047 (build-system python-build-system)
2048 (native-inputs
2049 (list python-pytest python-pytest-runner))
2050 (home-page "https://github.com/thombashi/allpairspy")
2051 (synopsis "Pairwise test combinations generator")
2052 (description
2053 "This is a Python library for test combinations generator. The generator
2054 allows one to create a set of tests using @emph{pairwise combinations} method,
2055 reducing a number of combinations of variables into a lesser set that covers
2056 most situations.")
2057 (license license:expat)))
2058
2059 (define-public python-pytest-mp
2060 (package
2061 (name "python-pytest-mp")
2062 (version "0.0.4p2")
2063 (source
2064 (origin
2065 (method git-fetch)
2066 (uri (git-reference
2067 (url "https://github.com/ansible/pytest-mp")
2068 (commit "49a8ff2ca9ef62d8c86854ab31d6b5d5d6cf3f28")))
2069 (file-name (git-file-name name version))
2070 (sha256
2071 (base32 "01v98b6n3yvkfmxf2v38xk5ijqlk6ika0yljwkhl5bh6qhq23498"))))
2072 (build-system python-build-system)
2073 (propagated-inputs
2074 (list python-pytest python-psutil))
2075 (arguments
2076 ;; tests require setuptools-markdown, which is deprecated and not in guix
2077 '(#:tests? #f
2078 #:phases
2079 (modify-phases %standard-phases
2080 (add-after 'unpack 'remove-useless-requirements
2081 (lambda _
2082 (substitute* "setup.py"
2083 ((" setup_requires=") " #")))))))
2084 (home-page "https://github.com/ansible/pytest-mp")
2085 (synopsis "Segregate tests into several processes")
2086 (description "pytest-mp is a minimalist approach to distribute and
2087 segregate pytest tests across processes using python's multiprocessing library
2088 and is heavily inspired by pytest-concurrent and pytest-xdist. As a very
2089 early beta, it doesn't pledge or intend to support the majority of platforms
2090 or use cases. Design is based on supporting slow, io-bound testing with often
2091 tedious system under test configuration that can benefit from running several
2092 tests at one time.")
2093 (license license:expat)))
2094
2095 (define-public python-aioresponses
2096 (package
2097 (name "python-aioresponses")
2098 (version "0.7.2")
2099 (source
2100 (origin
2101 (method url-fetch)
2102 (uri (pypi-uri "aioresponses" version))
2103 (sha256
2104 (base32 "16p8mdyfirddrsay62ji7rwcrqmmzxzf2isdbfm9cj5p338rbr42"))))
2105 (build-system python-build-system)
2106 (arguments
2107 `(#:phases
2108 (modify-phases %standard-phases
2109 (replace 'check
2110 (lambda* (#:key tests? #:allow-other-keys)
2111 (when tests?
2112 (invoke
2113 "pytest" "-vv" "tests" "-k"
2114 (string-append
2115 ;; These tests require network access.
2116 "not test_address_as_instance_of_url_combined_with_pass_through "
2117 "and not test_pass_through_with_origin_params"))))))))
2118 (native-inputs
2119 (list python-pbr python-ddt python-pytest))
2120 (propagated-inputs
2121 (list python-aiohttp))
2122 (home-page "https://github.com/pnuckowski/aioresponses")
2123 (synopsis "Mock out requests made by ClientSession from aiohttp package")
2124 (description
2125 "Aioresponses is a helper to mock/fake web requests in python aiohttp
2126 package. For requests module there are a lot of packages that help us with
2127 testing (eg. httpretty, responses, requests-mock). When it comes to testing
2128 asynchronous HTTP requests it is a bit harder (at least at the beginning).
2129 The purpose of this package is to provide an easy way to test asynchronous
2130 HTTP requests.")
2131 (license license:expat)))
2132
2133 (define-public python-avocado-framework
2134 (package
2135 (name "python-avocado-framework")
2136 (version "96.0")
2137 (source
2138 (origin
2139 (method url-fetch)
2140 (uri (pypi-uri "avocado-framework" version))
2141 (sha256
2142 (base32 "0zhz6423p0b5gqx2mvg7dmq8m9gbsay7wqjdwzirlwcg2v3rcz0m"))))
2143 (build-system python-build-system)
2144 (arguments
2145 (list
2146 ;; The test suite hangs, due to a serious bug in Python/Avocado (see:
2147 ;; https://github.com/avocado-framework/avocado/issues/4935).
2148 #:tests? #f
2149 #:phases
2150 #~(modify-phases %standard-phases
2151 (add-after 'unpack 'patch-paths
2152 (lambda* (#:key native-inputs inputs #:allow-other-keys)
2153 ;; These are runtime dependencies (inputs).
2154 (substitute* "avocado/plugins/spawners/podman.py"
2155 (("default='/usr/bin/podman'")
2156 "default='podman'"))
2157 (substitute* "avocado/utils/podman.py"
2158 (("\"/usr/bin/env\", \"python3\"")
2159 (format #f "~s" (search-input-file inputs "bin/python"))))
2160 (substitute* "avocado/utils/memory.py"
2161 (("\"sync\"")
2162 (format #f "~s" (search-input-file inputs "bin/sync")))
2163 (("/bin/sh")
2164 (search-input-file inputs "bin/sh")))
2165 ;; Batch process the tests modules with less care; if something
2166 ;; is wrong, the test suite will fail. These are tests
2167 ;; dependencies (native inputs).
2168 (substitute* (find-files "selftests" "\\.py$")
2169 (("#!/usr/bin/env")
2170 (string-append "#!" (search-input-file (or native-inputs inputs)
2171 "bin/env")))
2172 (("/bin/(false|true|sh|sleep|sudo)" _ name)
2173 (search-input-file (or native-inputs inputs)
2174 (string-append "bin/" name))))))
2175 (add-after 'unpack 'remove-broken-entrypoints
2176 ;; The avocado-external-runner entry point fails to load, the
2177 ;; 'scripts' top level package not being found (see:
2178 ;; https://github.com/avocado-framework/avocado/issues/5370).
2179 (lambda _
2180 (substitute* "setup.py"
2181 (("'avocado-external-runner = scripts.external_runner:main'.*")
2182 ""))))
2183 (replace 'check
2184 (lambda* (#:key tests? #:allow-other-keys)
2185 (when tests?
2186 (setenv "HOME" "/tmp")
2187 (setenv "PYTHONPATH" (getcwd))
2188 (invoke "./selftests/check.py" "--skip" "static-checks")))))))
2189 (native-inputs (list bash-minimal coreutils-minimal perl sudo))
2190 (inputs (list bash-minimal coreutils-minimal))
2191 (home-page "https://avocado-framework.github.io/")
2192 (synopsis "Tools and libraries to help with automated testing")
2193 (description "Avocado is a set of tools and libraries to help with
2194 automated testing, i.e. a test framework. Native tests are written in Python
2195 and they follow the unittest pattern, but any executable can serve as a
2196 test. The following output formats are supported:
2197 @table @asis
2198 @item xUnit
2199 an XML format that contains test results in a structured form, and are used by
2200 other test automation projects, such as Jenkins.
2201 @item JSON
2202 a widely used data exchange format. The JSON Avocado plugin outputs job
2203 information, similarly to the xunit output plugin.
2204 @item TAP
2205 Provides the basic TAP (Test Anything Protocol) results. Unlike most existing
2206 Avocado machine readable outputs this one is streamlined (per test results).
2207 @end table")
2208 (license license:gpl2))) ;some files are under GPLv2 only
2209
2210 (define-public python-parameterizedtestcase
2211 (package
2212 (name "python-parameterizedtestcase")
2213 (version "0.1.0")
2214 (source
2215 (origin
2216 (method url-fetch)
2217 (uri (pypi-uri "parameterizedtestcase" version))
2218 (sha256
2219 (base32 "0zhjmsd16xacg4vd7zb75kw8q9khn52wvad634v1bvz7swaivk2c"))))
2220 (build-system python-build-system)
2221 (native-inputs (list python-setuptools)) ;for use_2to3
2222 (home-page
2223 "https://github.com/msabramo/python_unittest_parameterized_test_case")
2224 (synopsis "Parameterized tests for Python's unittest module")
2225 (description "This package provides parameterized tests for Python's
2226 @code{unittest} module taking inspiration from pytest.")
2227 (license license:expat)))
2228
2229 (define-public python-pytest-rerunfailures
2230 (package
2231 (name "python-pytest-rerunfailures")
2232 (version "10.2")
2233 (source
2234 (origin
2235 (method url-fetch)
2236 (uri (pypi-uri "pytest-rerunfailures" version))
2237 (sha256
2238 (base32 "15v68kggjvkflbqr0vz8gp5yp3pcsk0rz05bpg2l4xp0a6nin7ly"))))
2239 (build-system python-build-system)
2240 (propagated-inputs (list python-pytest python-setuptools))
2241 (home-page "https://github.com/pytest-dev/pytest-rerunfailures")
2242 (synopsis "Pytest plugin to re-run flaky tests")
2243 (description "This package provides a pytest plugin to re-run tests to
2244 eliminate flaky failures.")
2245 (license license:mpl2.0)))
2246
2247 (define-public python-xunitparser
2248 (package
2249 (name "python-xunitparser")
2250 (version "1.3.4")
2251 (source
2252 (origin
2253 (method url-fetch)
2254 (uri (pypi-uri "xunitparser" version))
2255 (sha256
2256 (base32 "00lapxi770mg7jkw16zy3a91hbdfz4a9h43ryczdsgd3z4cl6vyf"))))
2257 (build-system python-build-system)
2258 (arguments
2259 `(#:phases
2260 (modify-phases %standard-phases
2261 ;; See https://github.com/laurentb/xunitparser/pull/11
2262 (add-after 'unpack 'fix-test-suite
2263 (lambda _
2264 (substitute* "xunitparser.py"
2265 (("(^ +)self.stderr = None" m indent)
2266 (string-append m "\n" indent "self._cleanup = False\n"))))))))
2267 (home-page "http://git.p.engu.in/laurentb/xunitparser/")
2268 (synopsis "Read JUnit/XUnit XML files and map them to Python objects")
2269 (description "xunitparser reads a JUnit/XUnit XML file and maps it to
2270 Python objects. It tries to use the objects available in the standard
2271 @code{unittest} module.")
2272 (license license:expat)))
2273
2274 (define-public python-test-utils
2275 (package
2276 (name "python-test-utils")
2277 (version "0.1.0")
2278 (source
2279 (origin
2280 (method url-fetch)
2281 (uri (pypi-uri "test-utils" version))
2282 (sha256
2283 (base32 "0cs0gyihnkj8ya4yg3ld3ly73mpxrkn2gq9acamclhqvhxsv7zd6"))))
2284 (build-system python-build-system)
2285 (home-page "https://github.com/Kami/python-test-utils/")
2286 (synopsis "Utilities for functional and integration tests")
2287 (description
2288 "This package provides a collection of utility functions and classes
2289 which make writing and running functional and integration tests easier.")
2290 (license license:asl2.0)))
2291
2292 (define-public python-tox
2293 (package
2294 (name "python-tox")
2295 (version "3.20.0")
2296 (source
2297 (origin
2298 (method url-fetch)
2299 (uri (pypi-uri "tox" version))
2300 (sha256
2301 (base32
2302 "0nk0nyzhzamcrvn0qqzzy54isxxqwdi28swml7a2ym78c3f9sqpb"))))
2303 (build-system python-build-system)
2304 (arguments
2305 (list
2306 #:phases
2307 #~(modify-phases %standard-phases
2308 (replace 'check
2309 (lambda* (#:key tests? #:allow-other-keys)
2310 (when tests?
2311 (invoke "pytest" "-vv" "-k"
2312 (string-join
2313 (map (lambda (test)
2314 (string-append "not test_" test))
2315 '("invocation_error"
2316 "create_KeyboadInterrupt"
2317 "exit_code"
2318 "tox_get_python_executable"
2319 "find_alias_on_path"
2320 "get_executable"
2321 "get_executable_no_exist"
2322 "get_sitepackagesdir_error"
2323 "spinner_stdout_not_unicode"
2324 "provision_non_canonical_dep"
2325 "package_setuptools"
2326 "package_poetry"
2327 "parallel_interrupt"
2328 "provision_missing"
2329 "provision_from_pyvenv"
2330 "provision_interrupt_child"
2331 "create"
2332 "run_custom_install_command"
2333 "toxuone_env"
2334 "different_config_cwd"
2335 "test_usedevelop"
2336 "build_backend_without_submodule"
2337 "parallel"
2338 "parallel_live"
2339 "tox_env_var_flags_inserted_isolated"))
2340 " and "))))))))
2341 (propagated-inputs
2342 (list python-filelock
2343 python-packaging
2344 python-pluggy
2345 python-py
2346 python-six
2347 python-toml
2348 python-virtualenv))
2349 (native-inputs
2350 (list python-flaky
2351 python-pathlib2
2352 python-pytest ; >= 2.3.5
2353 python-pytest-freezegun
2354 python-pytest-timeout
2355 python-setuptools-scm))
2356 (home-page "https://tox.readthedocs.io")
2357 (synopsis "Virtualenv-based automation of test activities")
2358 (description "Tox is a generic virtualenv management and test command line
2359 tool. It can be used to check that a package installs correctly with
2360 different Python versions and interpreters, or run tests in each type of
2361 supported environment, or act as a frontend to continuous integration
2362 servers.")
2363 (license license:expat)))
2364
2365 (define-public python-sybil
2366 (package
2367 (name "python-sybil")
2368 (version "3.0.1")
2369 (source
2370 (origin
2371 (method url-fetch)
2372 (uri (pypi-uri "sybil" version))
2373 (sha256
2374 (base32 "03ak1w93linfqx6c9lwgq5niyy3j9yblv4ip40hmlzmg0hidq0kg"))))
2375 (build-system python-build-system)
2376 (arguments
2377 `(#:phases
2378 (modify-phases %standard-phases
2379 (replace 'check
2380 (lambda* (#:key tests? #:allow-other-keys)
2381 (when tests?
2382 (invoke "pytest")))))))
2383 (native-inputs (list python-pytest python-pytest-cov))
2384 (home-page "https://github.com/simplistix/sybil")
2385 (synopsis "Automated testing for examples in code and documentation")
2386 (description
2387 "This library provides a way to check examples in your code and
2388 documentation by parsing them from their source and evaluating the
2389 parsed examples as part of your normal test run. Integration is
2390 provided for the main Python test runners.")
2391 (license license:expat)))
2392
2393 (define-public python-pytest-httpx
2394 (package
2395 (name "python-pytest-httpx")
2396 (version "0.21.0")
2397 (source
2398 (origin
2399 ;; pypi package doesn't include the tests
2400 (method git-fetch)
2401 (uri (git-reference
2402 (url "https://github.com/Colin-b/pytest_httpx")
2403 (commit (string-append "v" version))))
2404 (file-name (git-file-name name version))
2405 (sha256
2406 (base32 "12mcy1f5d5cq3rqrqgi2ar0qvzw62ibys17hw6dsdfd0j2syck4r"))))
2407 (build-system python-build-system)
2408 (arguments
2409 `(#:phases
2410 (modify-phases %standard-phases
2411 (replace 'check
2412 (lambda* (#:key tests? #:allow-other-keys)
2413 (when tests?
2414 (setenv "PYTHONPATH" (getcwd))
2415 (invoke "pytest" "-vv")))))))
2416 (propagated-inputs (list python-httpx))
2417 (native-inputs (list python-pytest python-pytest-asyncio))
2418 (home-page "https://colin-b.github.io/pytest_httpx/")
2419 (synopsis "Pytest plugin to mock httpx")
2420 (description "This package provides a pytest fixture to mock httpx
2421 requests to be replied to with user provided responses.")
2422 (license license:expat)))
2423
2424 (define-public python-pycotap
2425 (package
2426 (name "python-pycotap")
2427 (version "1.2.2")
2428 (source
2429 (origin
2430 (method url-fetch)
2431 (uri (pypi-uri "pycotap" version))
2432 (sha256
2433 (base32 "1v69fxial9i5wlap6wc4igq3hydvxbak7dlgb7cikk8wjgafqf7r"))))
2434 (build-system python-build-system)
2435 (home-page "https://el-tramo.be/pycotap")
2436 (synopsis "Tiny Python TAP test runner")
2437 (description "This package provides a simple Python test runner for
2438 unittest that outputs Test Anything Protocol (TAP) results to standard
2439 output. Contrary to other TAP runners for Python, pycotap...
2440 @itemize
2441 @item
2442 prints TAP (and only TAP) to standard output instead of to a separate file,
2443 allowing you to pipe it directly to TAP pretty printers and processors;
2444 @item only contains a TAP reporter, so no parsers, no frameworks, no
2445 dependencies, etc;
2446 @item
2447 is configurable: you can choose how you want the test output and test result
2448 diagnostics to end up in your TAP output (as TAP diagnostics, YAML blocks, or
2449 attachments).
2450 @end itemize")
2451 (license license:expat)))
2452
2453 (define-public python-xvfbwrapper
2454 (package
2455 (name "python-xvfbwrapper")
2456 (version "0.2.9")
2457 (source (origin
2458 (method url-fetch)
2459 (uri (pypi-uri "xvfbwrapper" version))
2460 (sha256
2461 (base32
2462 "097wxhvp01ikqpg1z3v8rqhss6f1vwr399zpz9a05d2135bsxx5w"))))
2463 (build-system python-build-system)
2464 (propagated-inputs (list xorg-server-for-tests))
2465 (home-page "https://github.com/cgoldberg/xvfbwrapper")
2466 (synopsis "Python module for controlling virtual displays with Xvfb")
2467 (description
2468 "Xvfb (X virtual framebuffer) is a display server implementing
2469 the X11 display server protocol. It runs in memory and does not require a
2470 physical display. Only a network layer is necessary. Xvfb is useful for
2471 running acceptance tests on headless servers.")
2472 (license license:expat)))