gnu: python2-subunit: Remove package.
[jackhill/guix/guix.git] / gnu / packages / check.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
3 ;;; Copyright © 2014 David Thompson <davet@gnu.org>
4 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
5 ;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
6 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
7 ;;; Copyright © 2015, 2017 Cyril Roelandt <tipecaml@gmail.com>
8 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
9 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
10 ;;; Copyright © 2015, 2016, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
11 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
12 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
13 ;;; Copyright © 2016, 2017 Danny Milosavljevic <dannym+a@scratchpost.org>
14 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
15 ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
16 ;;; Copyright © 2016 Troy Sankey <sankeytms@gmail.com>
17 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
18 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
19 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
20 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
21 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
22 ;;; Copyright © 2017, 2018 Arun Isaac <arunisaac@systemreboot.net>
23 ;;; Copyright © 2017 Frederick M. Muriithi <fredmanglis@gmail.com>
24 ;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
25 ;;; Copyright © 2017, 2019 Kei Kebreau <kkebreau@posteo.net>
26 ;;; Copyright © 2017 Nikita <nikita@n0.is>
27 ;;; Copyright © 2015, 2017, 2018, 2020 Ricardo Wurmus <rekado@elephly.net>
28 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
29 ;;; Copyright © 2017, 2018, 2020 Ludovic Courtès <ludo@gnu.org>
30 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
31 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
32 ;;; Copyright © 2019 Chris Marusich <cmmarusich@gmail.com>
33 ;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org>
34 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
35 ;;; Copyright © 2020 Josh Marshall <joshua.r.marshall.1991@gmail.com>
36 ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
37 ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
38 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
39 ;;;
40 ;;; This file is part of GNU Guix.
41 ;;;
42 ;;; GNU Guix is free software; you can redistribute it and/or modify it
43 ;;; under the terms of the GNU General Public License as published by
44 ;;; the Free Software Foundation; either version 3 of the License, or (at
45 ;;; your option) any later version.
46 ;;;
47 ;;; GNU Guix is distributed in the hope that it will be useful, but
48 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
49 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50 ;;; GNU General Public License for more details.
51 ;;;
52 ;;; You should have received a copy of the GNU General Public License
53 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
54
55 (define-module (gnu packages check)
56 #:use-module (gnu packages)
57 #:use-module (gnu packages autotools)
58 #:use-module (gnu packages base)
59 #:use-module (gnu packages bash)
60 #:use-module (gnu packages compression)
61 #:use-module (gnu packages linux)
62 #:use-module (gnu packages llvm)
63 #:use-module (gnu packages glib)
64 #:use-module (gnu packages gnome)
65 #:use-module (gnu packages golang)
66 #:use-module (gnu packages gtk)
67 #:use-module (gnu packages perl)
68 #:use-module (gnu packages pkg-config)
69 #:use-module (gnu packages python)
70 #:use-module (gnu packages python-build)
71 #:use-module (gnu packages python-web)
72 #:use-module (gnu packages python-xyz)
73 #:use-module (gnu packages time)
74 #:use-module (gnu packages xml)
75 #:use-module (guix utils)
76 #:use-module ((guix licenses) #:prefix license:)
77 #:use-module (guix packages)
78 #:use-module (guix download)
79 #:use-module (guix git-download)
80 #:use-module (guix build-system cmake)
81 #:use-module (guix build-system glib-or-gtk)
82 #:use-module (guix build-system gnu)
83 #:use-module (guix build-system go)
84 #:use-module (guix build-system meson)
85 #:use-module (guix build-system python)
86 #:use-module (guix build-system trivial)
87 #:use-module (srfi srfi-1))
88
89 (define-public pedansee
90 (package
91 (name "pedansee")
92 (version "0.0.3")
93 (source
94 (origin
95 (method url-fetch)
96 (uri
97 (string-append "https://www.flyn.org/projects/"
98 name "/" name "-" version ".tar.gz"))
99 (sha256
100 (base32 "0lsg791x6n95pxg6vif8qfc46nqcamhjq3g0dl5xqf6imy7n3acd"))))
101 (build-system glib-or-gtk-build-system)
102 (native-inputs
103 `(("clang" ,clang)
104 ("pkg-config" ,pkg-config)
105 ("python" ,python-wrapper)))
106 (inputs
107 `(("glib" ,glib)))
108 (synopsis "Code checker for C")
109 (description "Pedansee checks C source files for compliance with a particular
110 programming style. The style is currently defined by the pedansee source code
111 in the form of functions which walk each source file’s syntax tree. You can
112 modify some aspects of this style through the use of regular expressions.")
113 (home-page "https://www.flyn.org/projects/pedansee/")
114 (license license:gpl3+)))
115
116 (define-public mutest
117 (package
118 (name "mutest")
119 (version "0.0.0")
120 (source
121 (origin
122 (method git-fetch)
123 (uri
124 (git-reference
125 (url "https://github.com/ebassi/mutest")
126 (commit "e6246c9")))
127 (file-name (git-file-name name version))
128 (sha256
129 (base32 "0gdqwq6fvk06wld4rhnw5752hahrvhd69zrci045x25rwx90x26q"))))
130 (build-system meson-build-system)
131 (synopsis "Small C testing library")
132 (description "Mutest aims to be a small unit testing library for C projects,
133 with an API heavily modelled on high level Behavior-Driver Development frameworks
134 like Jasmine or Mocha.")
135 (home-page "https://ebassi.github.io/mutest/mutest.md.html")
136 (license license:expat)))
137
138 (define-public check
139 (package
140 (name "check")
141 (version "0.15.2")
142 (source
143 (origin
144 (method url-fetch)
145 (uri (string-append "https://github.com/libcheck/check/releases/download/"
146 version "/check-" version ".tar.gz"))
147 (sha256
148 (base32
149 "02m25y9m46pb6n46s51av62kpd936lkfv3b13kfpckgvmh5lxpm8"))))
150 (build-system gnu-build-system)
151 (home-page "https://libcheck.github.io/check/")
152 (synopsis "Unit test framework for C")
153 (description
154 "Check is a unit testing framework for C. It features a simple
155 interface for defining unit tests, putting little in the way of the
156 developer. Tests are run in a separate address space, so Check can
157 catch both assertion failures and code errors that cause segmentation
158 faults or other signals. The output from unit tests can be used within
159 source code editors and IDEs.")
160 (license license:lgpl2.1+)))
161
162 ;; Some packages require older versions. Removed once no longer needed.
163 (define-public check-0.14
164 (package
165 (inherit check)
166 (version "0.14.0")
167 (source (origin
168 (method url-fetch)
169 (uri (string-append "https://github.com/libcheck/check/releases"
170 "/download/" version "/check-" version ".tar.gz"))
171 (sha256
172 (base32
173 "02zkfiyklckmivrfvdsrlzvzphkdsgjrz3igncw05dv5pshhq3xx"))))))
174
175 (define-public check-0.12
176 (package
177 (inherit check)
178 (version "0.12.0")
179 (source (origin
180 (method url-fetch)
181 (uri (string-append "https://github.com/libcheck/check/releases"
182 "/download/" version "/check-" version ".tar.gz"))
183 (sha256
184 (base32
185 "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6"))))))
186
187 (define-public clitest
188 (package
189 (name "clitest")
190 (version "0.3.0")
191 (home-page "https://github.com/aureliojargas/clitest")
192 (source (origin
193 (method git-fetch)
194 (uri (git-reference
195 (url home-page)
196 (commit (string-append "v" version))))
197 (file-name (git-file-name name version))
198 (sha256
199 (base32
200 "0zw5wra9hc717srmcar1wm4i34kyj8c49ny4bb7y3nrvkjp2pdb5"))))
201 (build-system gnu-build-system)
202 (arguments
203 `(#:phases
204 (modify-phases %standard-phases
205 ;; This package is distributed as a single shell script and comes
206 ;; without a proper build system.
207 (delete 'configure)
208 (delete 'build)
209 (replace 'check
210 (lambda _
211 (substitute* "test.md"
212 ;; One test looks for an error from grep in the form "grep: foo",
213 ;; but our grep returns the absolute file name on errors. Adjust
214 ;; the test to cope with that.
215 (("sed 's/\\^e\\*grep: \\.\\*/")
216 "sed 's/.*e*grep: .*/"))
217
218 (setenv "HOME" "/tmp")
219 (invoke "./clitest" "test.md")))
220 (replace 'install
221 (lambda* (#:key outputs #:allow-other-keys)
222 (let ((out (assoc-ref outputs "out")))
223 (install-file "clitest" (string-append out "/bin"))
224 (install-file "README.md"
225 (string-append out "/share/doc/clitest-" ,version))
226 #t))))))
227 (native-inputs
228 `(("perl" ,perl))) ;for tests
229 (synopsis "Command line test tool")
230 (description
231 "@command{clitest} is a portable shell script that performs automatic
232 testing of Unix command lines.")
233 (license license:expat)))
234
235 (define-public cunit
236 (package
237 (name "cunit")
238 (version "2.1-3")
239 (source
240 (origin
241 (method url-fetch)
242 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
243 version "/CUnit-" version ".tar.bz2"))
244 (sha256
245 (base32
246 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
247 (build-system gnu-build-system)
248 (arguments '(#:phases
249 (modify-phases %standard-phases
250 ;; XXX: The "bootstrap" phase detects the "bootstrap"
251 ;; script, but fails to execute it, so we bootstrap
252 ;; manually.
253 (replace 'bootstrap
254 (lambda _ (invoke "autoreconf" "-vfi"))))))
255 (native-inputs
256 `(("automake" ,automake)
257 ("autoconf" ,autoconf)
258 ("libtool" ,libtool)))
259 (home-page "http://cunit.sourceforge.net/")
260 (synopsis "Automated testing framework for C")
261 (description
262 "CUnit is a lightweight system for writing, administering, and running
263 unit tests in C. It provides C programmers with basic testing functionality
264 with a flexible variety of user interfaces.")
265 (license license:gpl2+)))
266
267 (define-public cppunit
268 (package
269 (name "cppunit")
270 (version "1.15.1")
271 (source (origin
272 (method url-fetch)
273 (uri (string-append "http://dev-www.libreoffice.org/src/"
274 name "-" version ".tar.gz"))
275 (sha256
276 (base32
277 "19qpqzy66bq76wcyadmi3zahk5v1ll2kig1nvg96zx9padkcdic9"))))
278 ;; Explicitly link with libdl. This is expected to be done by packages
279 ;; relying on cppunit for their tests. However, not all of them do.
280 ;; If we added the linker flag to such packages, we would pollute all
281 ;; binaries, not only those used for testing.
282 (arguments
283 `(#:make-flags '("LDFLAGS=-ldl")))
284 (build-system gnu-build-system)
285 (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
286 (synopsis "Unit testing framework for C++")
287 (description "CppUnit is the C++ port of the famous JUnit framework for
288 unit testing. Test output is in XML for automatic testing and GUI based for
289 supervised tests.")
290 (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
291
292 (define-public shunit2
293 (package
294 (name "shunit2")
295 (version "2.1.8")
296 (source (origin
297 (method git-fetch)
298 (uri (git-reference
299 (url "https://github.com/kward/shunit2")
300 (commit (string-append "v" version))))
301 (file-name (git-file-name name version))
302 (sha256
303 (base32
304 "08vs0jjl3pfh100sjlw31x4638xj7fghr0j2g1zfikba8n1f9491"))))
305 (build-system gnu-build-system)
306 (arguments
307 `(#:phases
308 (modify-phases %standard-phases
309 (delete 'configure) ; no configure script
310 (delete 'build)
311 (add-after 'patch-source-shebangs 'patch-more-shebangs
312 (lambda _
313 (substitute* "shunit2"
314 (("#! /bin/sh") (string-append "#! " (which "sh")))
315 (("/usr/bin/od") (which "od")))
316 (substitute* "test_runner"
317 (("/bin/sh") (which "sh"))
318 (("/bin/bash") (which "bash")))
319 #t))
320 (replace 'check
321 (lambda* (#:key tests? #:allow-other-keys)
322 (when tests?
323 ;; This test is buggy in the build container.
324 (delete-file "shunit2_misc_test.sh")
325 (invoke "sh" "test_runner"))
326 #t))
327 (replace 'install
328 (lambda* (#:key outputs #:allow-other-keys)
329 (install-file "shunit2"
330 (string-append (assoc-ref outputs "out")
331 "/bin"))
332 #t)))))
333 (home-page "https://github.com/kward/shunit2")
334 (synopsis "@code{xUnit} based unit testing for Unix shell scripts")
335 (description "@code{shUnit2} was originally developed to provide a
336 consistent testing solution for @code{log4sh}, a shell based logging framework
337 similar to @code{log4j}. It is designed to work in a similar manner to JUnit,
338 PyUnit and others.")
339 (license license:asl2.0)))
340
341 ;; When dependent packages upgraded to use newer version of catch, this one should
342 ;; be removed.
343 (define-public catch-framework
344 (package
345 (name "catch")
346 (version "1.3.5") ;Sub-minor is the build number
347 (source (origin
348 (method git-fetch)
349 (uri (git-reference
350 (url "https://github.com/philsquared/Catch")
351 ;; Semi-arbitrary.
352 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
353 (file-name (string-append name "-" version))
354 (sha256
355 (base32
356 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
357 (build-system trivial-build-system)
358 (arguments
359 `(#:modules ((guix build utils))
360 #:builder (begin
361 (use-modules (guix build utils))
362 (let* ((source (assoc-ref %build-inputs "source"))
363 (output (assoc-ref %outputs "out"))
364 (incdir (string-append output "/include"))
365 (docdir (string-append output "/share/doc/catch-"
366 ,version)))
367 (for-each mkdir-p (list incdir docdir))
368 (install-file (string-append source
369 "/single_include/catch.hpp")
370 incdir)
371 (copy-recursively (string-append source "/docs")
372 docdir)
373 #t))))
374 (home-page "http://catch-lib.net/")
375 (synopsis "Automated test framework for C++ and Objective-C")
376 (description
377 "Catch stands for C++ Automated Test Cases in Headers and is a
378 multi-paradigm automated test framework for C++ and Objective-C.")
379 (license license:boost1.0)))
380
381 (define-public catch-framework2-1
382 (package
383 (name "catch2")
384 (version "1.12.2")
385 (home-page "https://github.com/catchorg/Catch2")
386 (source (origin
387 (method git-fetch)
388 (uri (git-reference
389 (url "https://github.com/catchorg/Catch2")
390 (commit (string-append "v" version))))
391 (file-name (git-file-name name version))
392 (sha256
393 (base32
394 "1gdp5wm8khn02g2miz381llw3191k7309qj8s3jd6sasj01rhf23"))))
395 (build-system cmake-build-system)
396 (synopsis "Automated test framework for C++ and Objective-C")
397 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
398 a multi-paradigm automated test framework for C++ and Objective-C.")
399 (license license:boost1.0)))
400
401 (define-public catch-framework2
402 (package
403 (name "catch2")
404 (version "2.13.2")
405 (home-page "https://github.com/catchorg/Catch2")
406 (source (origin
407 (method git-fetch)
408 (uri (git-reference
409 (url "https://github.com/catchorg/Catch2")
410 (commit (string-append "v" version))))
411 (file-name (git-file-name name version))
412 (sha256
413 (base32
414 "100r0kmra8jmra2hv92lzvwcmphpaiccwvq3lpdsa5b7hailhach"))))
415 (build-system cmake-build-system)
416 (inputs
417 `(("python" ,python-wrapper)))
418 (synopsis "Automated test framework for C++ and Objective-C")
419 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
420 a multi-paradigm automated test framework for C++ and Objective-C.")
421 (license license:boost1.0)))
422
423 (define-public cmdtest
424 (package
425 (name "cmdtest")
426 (version "0.32")
427 (source (origin
428 (method url-fetch)
429 (uri (string-append "http://git.liw.fi/cmdtest/snapshot/"
430 name "-" version ".tar.gz"))
431 (sha256
432 (base32
433 "1jmfiyrrqmpvwdb273bkb8hjaf4rwx9njblx29pmr7giyahskwi5"))))
434 (build-system python-build-system)
435 (arguments
436 `(#:python ,python-2
437 #:phases
438 (modify-phases %standard-phases
439 ;; check phase needs to be run before the build phase. If not, the
440 ;; coverage test runner looks for tests for the built source files,
441 ;; and fails.
442 (delete 'check)
443 (add-before 'build 'check
444 (lambda _
445 (substitute* "yarn"
446 (("/bin/sh") (which "sh")))
447 ;; yarn uses python2-ttystatus to print messages.
448 ;; python2-ttystatus requires /dev/tty which is not present in
449 ;; the build environment. Hence assuming-failure test fails.
450 (delete-file "yarn.tests/assuming-failure.script")
451 (delete-file "yarn.tests/assuming-failure.stdout")
452 (invoke "python" "setup.py" "check"))))))
453 (native-inputs
454 `(("python2-coverage-test-runner" ,python2-coverage-test-runner)))
455 (propagated-inputs
456 `(("python2-cliapp" ,python2-cliapp)
457 ("python2-markdown" ,python2-markdown)
458 ("python2-ttystatus" ,python2-ttystatus)))
459 (home-page "https://liw.fi/cmdtest/")
460 (synopsis "Black box Unix program tester")
461 (description
462 "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
463 given a command line and input files, and the expected output, and it verifies
464 that the command line produces the expected output. If not, it reports a
465 problem, and shows the differences.")
466 (license license:gpl3+)))
467
468 (define-public cmocka
469 (package
470 (name "cmocka")
471 (version "1.1.5")
472 (source (origin
473 (method url-fetch)
474 (uri (string-append "https://cmocka.org/files/"
475 (version-major+minor version) "/cmocka-"
476 version ".tar.xz"))
477 (sha256
478 (base32
479 "1dm8pdvkyfa8dsbz9bpq7wwgixjij4sii9bbn5sgvqjm5ljdik7h"))))
480 (build-system cmake-build-system)
481 (arguments
482 `(#:tests? #f)) ; no test target
483 (home-page "https://cmocka.org/")
484 (synopsis "Unit testing framework for C")
485 (description "Cmocka is a unit testing framework for C with support for
486 mock objects. It only requires the standard C library, and works with
487 different compilers. Cmocka supports several different message output formats
488 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
489 format.")
490 (license license:asl2.0)))
491
492 (define-public cppcheck
493 (package
494 (name "cppcheck")
495 (version "2.3")
496 (source (origin
497 (method git-fetch)
498 (uri (git-reference
499 (url "https://github.com/danmar/cppcheck")
500 (commit version)))
501 (file-name (git-file-name name version))
502 (sha256
503 (base32 "03ic5mig3ryzkf85r95ryagf84s7y5nd6sqr915l3zj30apnifvz"))))
504 (build-system cmake-build-system)
505 (arguments
506 '(#:configure-flags '("-DBUILD_TESTS=ON")))
507 (home-page "http://cppcheck.sourceforge.net")
508 (synopsis "Static C/C++ code analyzer")
509 (description "Cppcheck is a static code analyzer for C and C++. Unlike
510 C/C++ compilers and many other analysis tools it does not detect syntax errors
511 in the code. Cppcheck primarily detects the types of bugs that the compilers
512 normally do not detect. The goal is to detect only real errors in the code
513 (i.e. have zero false positives).")
514 (license license:gpl3+)))
515
516 (define-public cxxtest
517 (package
518 (name "cxxtest")
519 (version "4.4")
520 (source (origin
521 (method url-fetch)
522 (uri (string-append "mirror://sourceforge/cxxtest/cxxtest/"
523 version "/cxxtest-" version ".tar.gz"))
524 (sha256
525 (base32
526 "1n7pbj4z9ivx005hqvivj9ddhq8awynzg6jishfbypf6j7ply58w"))))
527 (build-system python-build-system)
528 (arguments
529 '(#:phases
530 (modify-phases %standard-phases
531 (add-after 'unpack 'chdir-to-source
532 (lambda _
533 (chdir "python")
534 #t))
535 (add-after 'install 'install-headers
536 (lambda* (#:key outputs #:allow-other-keys)
537 (let* ((out (assoc-ref outputs "out"))
538 (include-dir (string-append out "/include/cxxtest")))
539 (for-each (lambda (header-file)
540 (install-file header-file include-dir))
541 (find-files "../cxxtest"))
542 #t)))
543 (add-after 'install 'install-doc
544 (lambda* (#:key outputs #:allow-other-keys)
545 (let* ((out (assoc-ref outputs "out"))
546 (doc-dir (string-append out "/share/doc/cxxtest")))
547 (install-file "../README" doc-dir)
548 (install-file "../doc/guide.txt" doc-dir)
549 (copy-recursively "../sample" (string-append doc-dir "/sample"))
550 #t))))))
551 (propagated-inputs
552 `(("python-ply" ,python-ply)))
553 (home-page "https://cxxtest.com/")
554 (synopsis "Unit testing framework for C++")
555 (description "CxxTest is a unit testing framework for C++ that is similar
556 in spirit to JUnit, CppUnit, and xUnit. CxxTest does not require precompiling
557 a CxxTest testing library, it employs no advanced features of C++ (e.g. RTTI)
558 and it supports a very flexible form of test discovery.")
559 (license license:lgpl3+)))
560
561 (define-public doctest
562 (package
563 (name "doctest")
564 (version "2.4.4")
565 (home-page "https://github.com/onqtam/doctest")
566 (source (origin
567 (method git-fetch)
568 (uri (git-reference (url home-page) (commit version)))
569 (file-name (git-file-name name version))
570 (sha256
571 (base32
572 "0xldd6cr1w3bn33rdb7yc6p57w143cgnjb48ig1b99iwvvkw599n"))))
573 (build-system cmake-build-system)
574 (synopsis "C++ test framework")
575 (description
576 "doctest is a single-header testing framework for C++11 and later. It
577 has been designed to be fast, light and unintrusive.")
578 (license license:expat)))
579
580 (define-public go-gopkg.in-check.v1
581 (let ((commit "788fd78401277ebd861206a03c884797c6ec5541")
582 (revision "1"))
583 (package
584 (name "go-gopkg.in-check.v1")
585 (version (git-version "0.0.0" revision commit))
586 (source (origin
587 (method git-fetch)
588 (uri (git-reference
589 (url "https://github.com/go-check/check")
590 (commit commit)))
591 (file-name (git-file-name name version))
592 (sha256
593 (base32
594 "0v3bim0j375z81zrpr5qv42knqs0y2qv2vkjiqi5axvb78slki1a"))))
595 (build-system go-build-system)
596 (arguments
597 '(#:import-path "gopkg.in/check.v1"))
598 (propagated-inputs
599 `(("go-github-com-kr-pretty" ,go-github-com-kr-pretty)))
600 (synopsis "Rich testing extension for Go's testing package")
601 (description
602 "@code{check} is a rich testing extension for Go's testing package.")
603 (home-page "https://github.com/go-check/check")
604 (license license:bsd-2))))
605
606 (define-public go-github.com-smartystreets-gunit
607 (package
608 (name "go-github.com-smartystreets-gunit")
609 (version "1.0.0")
610 (source (origin
611 (method git-fetch)
612 (uri (git-reference
613 (url "https://github.com/smartystreets/gunit")
614 (commit version)))
615 (file-name (git-file-name name version))
616 (sha256
617 (base32
618 "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
619 (build-system go-build-system)
620 (arguments
621 '(;; TODO: This package depends on go-github.com-smartystreets-assertions
622 ;; for running the tests, but go-github.com-smartystreets-assertions
623 ;; depends on this package, so break this loop by not running the tests
624 ;; for this package.
625 #:tests? #f
626 #:import-path "github.com/smartystreets/gunit"))
627 (synopsis "Testing tool for Go, in the style of xUnit")
628 (description
629 "@code{gunit} allows the test author to use a struct as the scope for a
630 group of related test cases, in the style of xUnit fixtures. This makes
631 extraction of setup/teardown behavior (as well as invoking the system under
632 test) much simpler.")
633 (home-page "https://github.com/smartystreets/gunit")
634 (license license:expat)))
635
636 (define-public go-github.com-smartystreets-assertions
637 (package
638 (name "go-github.com-smartystreets-assertions")
639 (version "1.8.1")
640 (source (origin
641 (method git-fetch)
642 (uri (git-reference
643 (url "https://github.com/smartystreets/assertions")
644 (commit version)))
645 (file-name (git-file-name name version))
646 (sha256
647 (base32
648 "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
649 (build-system go-build-system)
650 (arguments
651 '(#:import-path "github.com/smartystreets/assertions"))
652 (native-inputs
653 `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
654 (synopsis "Assertions for testing with Go")
655 (description
656 "The @code{assertions} package provides convenient assertion functions
657 for writing tests in Go.")
658 (home-page "https://github.com/smartystreets/assertions")
659 (license license:expat)))
660
661 (define-public go-github.com-smartystreets-goconvey
662 (package
663 (name "go-github.com-smartystreets-goconvey")
664 (version "1.6.3")
665 (source (origin
666 (method git-fetch)
667 (uri (git-reference
668 (url "https://github.com/smartystreets/goconvey")
669 (commit version)))
670 (file-name (git-file-name name version))
671 (sha256
672 (base32
673 "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
674 (build-system go-build-system)
675 (arguments
676 '(#:import-path "github.com/smartystreets/goconvey"))
677 (propagated-inputs
678 `(("go-github.com-jtolds-gls" ,go-github.com-jtolds-gls)
679 ("go-github.com-smartystreets-assertions" ,go-github.com-smartystreets-assertions)))
680 (synopsis "Go testing tool with both a web and terminal user interface")
681 (description
682 "GoConvey is a testing tool for Go. It integrates with go test, can show
683 test coverage and has a web user interface that will refresh automatically.")
684 (home-page "https://github.com/smartystreets/goconvey")
685 (license license:expat)))
686
687 (define-public googletest
688 (package
689 (name "googletest")
690 (version "1.10.0")
691 (source
692 (origin
693 (method git-fetch)
694 (uri (git-reference
695 (url "https://github.com/google/googletest")
696 (commit (string-append "release-" version))))
697 (file-name (git-file-name name version))
698 (sha256
699 (base32 "1zbmab9295scgg4z2vclgfgjchfjailjnvzc6f5x9jvlsdi3dpwz"))))
700 (build-system cmake-build-system)
701 (arguments
702 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
703 (native-inputs
704 `(("python" ,python-wrapper)))
705 (home-page "https://github.com/google/googletest/")
706 (synopsis "Test discovery and XUnit test framework")
707 (description "Google Test features an XUnit test framework, automated test
708 discovery, death tests, assertions, parameterized tests and XML test report
709 generation.")
710 (license license:bsd-3)))
711
712 (define-public googletest-1.8
713 (package/inherit
714 googletest
715 (version "1.8.1")
716 (source (origin
717 (method git-fetch)
718 (uri (git-reference
719 (url "https://github.com/google/googletest")
720 (commit (string-append "release-" version))))
721 (file-name (git-file-name "googletest" version))
722 (sha256
723 (base32
724 "0270msj6n7mggh4xqqjp54kswbl7mkcc8px1p5dqdpmw5ngh9fzk"))))))
725
726 (define-public cpputest
727 (package
728 (name "cpputest")
729 (version "3.8")
730 (source
731 (origin
732 (method url-fetch)
733 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
734 version "/cpputest-" version ".tar.gz"))
735 (sha256
736 (base32
737 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
738 (build-system gnu-build-system)
739 (native-inputs
740 `(("googletest" ,googletest)))
741 (home-page "https://cpputest.github.io/")
742 (synopsis "Unit testing and mocking framework for C/C++")
743 (description
744 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
745 C++ but is used in C and C++ projects and frequently used in embedded systems
746 but it works for any C/C++ project.")
747 (license license:bsd-3)))
748
749 (define-public python-parameterized
750 (package
751 (name "python-parameterized")
752 (version "0.7.4")
753 (source
754 (origin
755 (method url-fetch)
756 (uri (pypi-uri "parameterized" version))
757 (sha256
758 (base32 "1444fdz5bj0k10nmhxv0bv2gfrfisi7hfzqdndb0pvhf4g3qq3qr"))))
759 (build-system python-build-system)
760 (arguments
761 '(#:phases (modify-phases %standard-phases
762 (replace 'check
763 (lambda* (#:key tests? #:allow-other-keys)
764 (if tests?
765 (invoke "nosetests" "-v")
766 (format #t "test suite not run~%"))
767 #t)))))
768 (native-inputs
769 `(("python-mock" ,python-mock)
770 ("python-nose" ,python-nose)))
771 (home-page "https://github.com/wolever/parameterized")
772 (synopsis "Parameterized testing with any Python test framework")
773 (description
774 "Parameterized is a Python library that aims to fix parameterized testing
775 for every Python test framework. It supports nose, py.test, and unittest.")
776 (properties `((python2-variant . ,(delay python2-parameterized))))
777 (license license:bsd-2)))
778
779 (define-public python2-parameterized
780 (let ((base (package-with-python2 (strip-python2-variant
781 python-parameterized))))
782 (package/inherit
783 base
784 (source
785 (origin
786 (inherit (package-source base))
787 (patches (search-patches "python2-parameterized-docstring-test.patch")))))))
788
789 (define-public python-minimock
790 (package
791 (name "python-minimock")
792 (version "1.2.8")
793 (source
794 (origin
795 (method url-fetch)
796 (uri (pypi-uri "MiniMock" version))
797 (sha256
798 (base32
799 "0k2sxb1ibnyg05iblz7zhbv825f1zk9906rab7883iqgvzmdzpsz"))))
800 (build-system python-build-system)
801 (home-page "https://pypi.org/project/MiniMock")
802 (synopsis "Simple Python library for using mock objects")
803 (description "MiniMock is a simple library for building mock objects with
804 doctest.")
805 (license license:expat)))
806
807 (define-public python2-minimock
808 (package-with-python2 python-minimock))
809
810 (define-public python-mock
811 (package
812 (name "python-mock")
813 (version "3.0.5")
814 (source
815 (origin
816 (method url-fetch)
817 (uri (pypi-uri "mock" version))
818 (sha256
819 (base32
820 "1hrp6j0yrx2xzylfv02qa8kph661m6yq4p0mc8fnimch9j4psrc3"))))
821 (propagated-inputs
822 `(("python-six" ,python-six)))
823 (build-system python-build-system)
824 (arguments
825 ;; FIXME: Tests require "pytest", which depends on this package.
826 '(#:tests? #f))
827 (home-page "https://github.com/testing-cabal/mock")
828 (synopsis "Python mocking and patching library for testing")
829 (description
830 "Mock is a library for testing in Python. It allows you to replace parts
831 of your system under test with mock objects and make assertions about how they
832 have been used.")
833 (properties `((python2-variant . ,(delay python2-mock))))
834 (license license:expat)))
835
836 (define-public python2-mock
837 (let ((base (package-with-python2
838 (strip-python2-variant python-mock))))
839 (package (inherit base)
840 (propagated-inputs
841 `(("python2-functools32" ,python2-functools32)
842 ("python2-funcsigs" ,python2-funcsigs)
843 ,@(package-propagated-inputs base))))))
844
845 (define-public python-nose
846 (package
847 (name "python-nose")
848 (version "1.3.7")
849 (source
850 (origin
851 (method url-fetch)
852 (uri (pypi-uri "nose" version))
853 (sha256
854 (base32
855 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
856 (build-system python-build-system)
857 (arguments
858 '(#:tests? #f)) ; FIXME: test suite fails
859 (home-page "http://readthedocs.org/docs/nose/")
860 (synopsis "Python testing library")
861 (description
862 "Nose extends the unittest library to make testing easier.")
863 (license license:lgpl2.0+)))
864
865 (define-public python2-nose
866 (package-with-python2 python-nose))
867
868 (define-public python-nose2
869 (package
870 (name "python-nose2")
871 (version "0.9.2")
872 (source
873 (origin
874 (method url-fetch)
875 (uri (pypi-uri "nose2" version))
876 (sha256
877 (base32
878 "0pmbb6nk31yhgh4zkcblzxsznml7f7pf5q1ihgrwvbxv4mwzfql7"))))
879 (build-system python-build-system)
880 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
881 (propagated-inputs
882 `(("python-cov-core" ,python-cov-core)
883 ("python-pytest-cov" ,python-pytest-cov)
884 ("python-six" ,python-six)))
885 (home-page "https://github.com/nose-devs/nose2")
886 (synopsis "Next generation of nicer testing for Python")
887 (description
888 "Nose2 is the next generation of nicer testing for Python, based on the
889 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
890 better plugin api, being easier for users to configure, and simplifying internal
891 interfaces and processes.")
892 (license license:bsd-2)))
893
894 (define-public python2-nose2
895 (package-with-python2 python-nose2))
896
897 (define-public python-unittest2
898 (package
899 (name "python-unittest2")
900 (version "1.1.0")
901 (source
902 (origin
903 (method url-fetch)
904 (uri (pypi-uri "unittest2" version))
905 (patches
906 (search-patches "python-unittest2-python3-compat.patch"
907 "python-unittest2-remove-argparse.patch"))
908 (sha256
909 (base32
910 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
911 (build-system python-build-system)
912 (arguments
913 '(#:phases
914 (modify-phases %standard-phases
915 (replace 'check
916 (lambda _
917 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
918 (propagated-inputs
919 `(("python-six" ,python-six)
920 ("python-traceback2" ,python-traceback2)))
921 (home-page "https://pypi.org/project/unittest2/")
922 (synopsis "Python unit testing library")
923 (description
924 "Unittest2 is a replacement for the unittest module in the Python
925 standard library.")
926 (license license:psfl)))
927
928 (define-public python2-unittest2
929 (package-with-python2 python-unittest2))
930
931 (define-public python-pytest
932 (package
933 (name "python-pytest")
934 (version "5.3.5")
935 (source
936 (origin
937 (method url-fetch)
938 (uri (pypi-uri "pytest" version))
939 (sha256
940 (base32
941 "139i9cjhrv5aici3skq8iihvfb3lq0d8xb5j7qycr2hlk8cfjpqd"))))
942 (build-system python-build-system)
943 (arguments
944 `(#:phases
945 (modify-phases %standard-phases
946 (replace 'check
947 (lambda* (#:key (tests? #t) #:allow-other-keys)
948 (if tests?
949 (invoke "pytest" "-vv" "-k"
950 (string-append
951 ;; These tests involve the /usr directory, and fails.
952 "not test_remove_dir_prefix"
953 " and not test_argcomplete"
954 ;; This test tries to override PYTHONPATH, and
955 ;; subsequently fails to locate the test libraries.
956 " and not test_collection"))
957 (format #t "test suite not run~%"))
958 #t)))))
959 (propagated-inputs
960 `(("python-atomicwrites" ,python-atomicwrites)
961 ("python-attrs" ,python-attrs-bootstrap)
962 ("python-more-itertools" ,python-more-itertools)
963 ("python-packaging" ,python-packaging-bootstrap)
964 ("python-pluggy" ,python-pluggy)
965 ("python-py" ,python-py)
966 ("python-six" ,python-six-bootstrap)
967 ("python-wcwidth" ,python-wcwidth)))
968 (native-inputs
969 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
970 ("bash" ,bash)
971 ("python-hypothesis" ,python-hypothesis)
972 ("python-nose" ,python-nose)
973 ("python-mock" ,python-mock)
974 ("python-pytest" ,python-pytest-bootstrap)
975 ("python-setuptools-scm" ,python-setuptools-scm)
976 ("python-xmlschema" ,python-xmlschema)))
977 (home-page "https://docs.pytest.org/en/latest/")
978 (synopsis "Python testing library")
979 (description
980 "Pytest is a testing tool that provides auto-discovery of test modules
981 and functions, detailed info on failing assert statements, modular fixtures,
982 and many external plugins.")
983 (license license:expat)
984 (properties `((python2-variant . ,(delay python2-pytest))))))
985
986 (define-public python-pytest-6
987 (package
988 (inherit (strip-python2-variant python-pytest))
989 (version "6.1.2")
990 (source
991 (origin
992 (method url-fetch)
993 (uri (pypi-uri "pytest" version))
994 (sha256
995 (base32
996 "0gl2sdm322vzmsh5k4f8kj9raiq2y7kdinnca4m45ifvii5fk9y0"))))
997 (arguments
998 `(#:phases
999 (modify-phases %standard-phases
1000 (replace 'check
1001 (lambda* (#:key (tests? #t) #:allow-other-keys)
1002 (setenv "TERM" "dumb") ;attempt disabling markup tests
1003 (if tests?
1004 (invoke "pytest" "-vv" "-k"
1005 (string-append
1006 ;; This test involve the /usr directory, and fails.
1007 " not test_argcomplete"
1008 ;; These test do not honor the isatty detection and
1009 ;; fail.
1010 " and not test_code_highlight"
1011 " and not test_color_yes"))
1012 (format #t "test suite not run~%"))
1013 #t)))))
1014 (propagated-inputs
1015 (append (alist-delete "python-py"
1016 (package-propagated-inputs python-pytest))
1017 `(("python-py" ,python-py-next))))
1018 (native-inputs
1019 (append (alist-delete "python-pytest"
1020 (package-native-inputs python-pytest))
1021 `(("python-pytest" ,python-pytest-6-bootstrap)
1022 ("python-toml" ,python-toml)
1023 ("python-iniconfig" ,python-iniconfig))))))
1024
1025 ;; Pytest 4.x are the last versions that support Python 2.
1026 (define-public python2-pytest
1027 (package
1028 (inherit (strip-python2-variant python-pytest))
1029 (name "python2-pytest")
1030 (version "4.6.11")
1031 (source (origin
1032 (method url-fetch)
1033 (uri (pypi-uri "pytest" version))
1034 (sha256
1035 (base32
1036 "0ls3pqr86xgif6bphsb6wrww9r2vc7p7a2naq8zcq8115wwq5yjh"))))
1037 (build-system python-build-system)
1038 (arguments
1039 `(#:python ,python-2
1040 ,@(package-arguments python-pytest)))
1041 (propagated-inputs
1042 `(("python-atomicwrites" ,python2-atomicwrites)
1043 ("python-attrs" ,python2-attrs-bootstrap)
1044 ("python-funcsigs" ,python2-funcsigs)
1045 ("python-importlib-metadata" ,python2-importlib-metadata-bootstrap)
1046 ("python-more-itertools" ,python2-more-itertools)
1047 ("python-packaging" ,python2-packaging-bootstrap)
1048 ("python-pathlib2" ,python2-pathlib2)
1049 ("python-pluggy" ,python2-pluggy)
1050 ("python-py" ,python2-py)
1051 ("python-six" ,python2-six-bootstrap)
1052 ("python-wcwidth" ,python2-wcwidth)))
1053 (native-inputs
1054 `(("bash" ,bash) ;tests require 'compgen'
1055 ("python-hypothesis" ,python2-hypothesis)
1056 ("python-nose" ,python2-nose)
1057 ("python-mock" ,python2-mock)
1058 ("python-pytest" ,python2-pytest-bootstrap)
1059 ("python-setuptools-scm" ,python2-setuptools-scm)))))
1060
1061 (define-public python-pytest-bootstrap
1062 (package
1063 (inherit (strip-python2-variant python-pytest))
1064 (name "python-pytest-bootstrap")
1065 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
1066 (arguments `(#:tests? #f))
1067 (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
1068
1069 (define-public python-pytest-6-bootstrap
1070 (package
1071 (inherit (strip-python2-variant python-pytest-6))
1072 (name "python-pytest-bootstrap")
1073 (arguments `(#:tests? #f))
1074 (native-inputs
1075 `(("python-setuptools-scm" ,python-setuptools-scm)
1076 ("python-toml" ,python-toml)))))
1077
1078 (define-public python2-pytest-bootstrap
1079 (hidden-package
1080 (package/inherit
1081 python2-pytest
1082 (name "python2-pytest-bootstrap")
1083 (arguments
1084 (substitute-keyword-arguments (package-arguments python2-pytest)
1085 ((#:tests? _ #f) #f)))
1086 (native-inputs
1087 `(("python-setuptools-scm" ,python2-setuptools-scm)))
1088 (propagated-inputs
1089 `(("python-atomicwrites" ,python2-atomicwrites)
1090 ("python-attrs" ,python2-attrs-bootstrap)
1091 ("python-funcsigs" ,python2-funcsigs-bootstrap)
1092 ("python-importlib-metadata" ,python2-importlib-metadata-bootstrap)
1093 ("python-more-itertools" ,python2-more-itertools)
1094 ("python-packaging" ,python2-packaging-bootstrap)
1095 ("python-pathlib2" ,python2-pathlib2-bootstrap)
1096 ("python-pluggy" ,python2-pluggy-bootstrap)
1097 ("python-py" ,python2-py)
1098 ("python-wcwidth" ,python2-wcwidth))))))
1099
1100 (define-public python-pytest-cov
1101 (package
1102 (name "python-pytest-cov")
1103 (version "2.8.1")
1104 (source
1105 (origin
1106 (method url-fetch)
1107 (uri (pypi-uri "pytest-cov" version))
1108 (sha256
1109 (base32 "0avzlk9p4nc44k7lpx9109dybq71xqnggxb9f4hp0l64pbc44ryc"))))
1110 (build-system python-build-system)
1111 (arguments
1112 `(#:phases
1113 (modify-phases %standard-phases
1114 (replace 'check
1115 (lambda _
1116 ;; Options taken from tox.ini.
1117 ;; TODO: make "--restructuredtext" tests pass. They currently fail
1118 ;; with "Duplicate implicit target name".
1119 (invoke "python" "./setup.py" "check"
1120 "--strict" "--metadata"))))))
1121 (propagated-inputs
1122 `(("python-coverage" ,python-coverage)
1123 ("python-pytest" ,python-pytest)))
1124 (home-page "https://github.com/pytest-dev/pytest-cov")
1125 (synopsis "Pytest plugin for measuring coverage")
1126 (description
1127 "Pytest-cov produces coverage reports. It supports centralised testing and
1128 distributed testing in both @code{load} and @code{each} modes. It also
1129 supports coverage of subprocesses.")
1130 (license license:expat)))
1131
1132 (define-public python2-pytest-cov
1133 (package-with-python2 python-pytest-cov))
1134
1135 (define-public python-pytest-runner
1136 (package
1137 (name "python-pytest-runner")
1138 (version "5.2")
1139 (source
1140 (origin
1141 (method url-fetch)
1142 (uri (pypi-uri "pytest-runner" version))
1143 (sha256
1144 (base32
1145 "0awll1bva5zy8cspsxcpv7pjcrdf5c6pf56nqn4f74vvmlzfgiwn"))))
1146 (build-system python-build-system)
1147 (arguments
1148 '(;; FIXME: The test suite requires 'python-flake8' and 'python-black',
1149 ;; but that introduces a circular dependency.
1150 #:tests? #f
1151 #:phases (modify-phases %standard-phases
1152 (replace 'check
1153 (lambda* (#:key tests? #:allow-other-keys)
1154 (if tests?
1155 (invoke "pytest" "-vv")
1156 (format #t "test suite not run~%"))
1157 #t)))))
1158 (native-inputs
1159 `(("python-setuptools-scm" ,python-setuptools-scm)))
1160 (home-page "https://github.com/pytest-dev/pytest-runner")
1161 (synopsis "Invoke py.test as a distutils command")
1162 (description
1163 "This package provides a @command{pytest-runner} command that
1164 @file{setup.py} files can use to run tests.")
1165 (license license:expat)))
1166
1167 (define-public python2-pytest-runner
1168 (package-with-python2 python-pytest-runner))
1169
1170 ;; python-bleach 3.1.0 requires this ancient version of pytest-runner.
1171 ;; Remove once no longer needed.
1172 (define-public python-pytest-runner-2
1173 (package/inherit
1174 python-pytest-runner
1175 (version "2.12.2")
1176 (source (origin
1177 (method url-fetch)
1178 (uri (pypi-uri "pytest-runner" version))
1179 (sha256
1180 (base32
1181 "11ivjj9hfphkv4yfb2g74av4yy86y8gcbf7gbif0p1hcdfnxg3w6"))))))
1182
1183 (define-public python2-pytest-runner-2
1184 (package-with-python2 python-pytest-runner-2))
1185
1186 (define-public python-pytest-lazy-fixture
1187 (package
1188 (name "python-pytest-lazy-fixture")
1189 (version "0.6.3")
1190 (source
1191 (origin
1192 (method url-fetch)
1193 (uri (pypi-uri "pytest-lazy-fixture" version))
1194 (sha256
1195 (base32 "1b0hmnsxw4s2wf9pks8dg6dfy5cx3zcbzs8517lfccxsfizhqz8f"))))
1196 (build-system python-build-system)
1197 (arguments
1198 '(#:phases
1199 (modify-phases %standard-phases
1200 (replace 'check
1201 (lambda* (#:key inputs outputs #:allow-other-keys)
1202 ;; Make the installed plugin discoverable by Pytest.
1203 (add-installed-pythonpath inputs outputs)
1204 (invoke "pytest" "-vv"))))))
1205 (propagated-inputs
1206 `(("python-pytest" ,python-pytest)))
1207 (home-page "https://github.com/tvorog/pytest-lazy-fixture")
1208 (synopsis "Use fixtures in @code{pytest.mark.parametrize}")
1209 (description "This plugin helps to use fixtures in
1210 @code{pytest.mark.parametrize}.")
1211 (license license:expat)))
1212
1213 (define-public python-pytest-mock
1214 (package
1215 (name "python-pytest-mock")
1216 (version "1.10.1")
1217 (source
1218 (origin
1219 (method url-fetch)
1220 (uri (pypi-uri "pytest-mock" version))
1221 (sha256
1222 (base32
1223 "1i5mg3ff1qk0wqfcxfz60hwy3q5dskdp36i10ckigkzffg8hc3ad"))))
1224 (build-system python-build-system)
1225 (native-inputs
1226 `(("python-setuptools-scm" ,python-setuptools-scm)))
1227 (propagated-inputs
1228 `(("python-pytest" ,python-pytest)))
1229 (home-page "https://github.com/pytest-dev/pytest-mock/")
1230 (synopsis "Thin-wrapper around the mock package for easier use with py.test")
1231 (description
1232 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
1233 around the patching API provided by the @code{mock} package, but with the
1234 benefit of not having to worry about undoing patches at the end of a test.
1235 The mocker fixture has the same API as @code{mock.patch}, supporting the
1236 same arguments.")
1237 (properties `((python2-variant . ,(delay python2-pytest-mock))))
1238 (license license:expat)))
1239
1240 (define-public python2-pytest-mock
1241 (let ((base (package-with-python2
1242 (strip-python2-variant python-pytest-mock))))
1243 (package (inherit base)
1244 (propagated-inputs
1245 `(("python2-mock" ,python2-mock)
1246 ,@(package-propagated-inputs base))))))
1247
1248 (define-public python-pytest-xdist
1249 (package
1250 (name "python-pytest-xdist")
1251 (version "2.1.0")
1252 (source
1253 (origin
1254 (method url-fetch)
1255 (uri (pypi-uri "pytest-xdist" version))
1256 (sha256
1257 (base32
1258 "0wh6pn66nncfs6ay0n863bgyriwsgppn8flx5l7551j1lbqkinc2"))
1259 (modules '((guix build utils)))
1260 (snippet
1261 '(begin
1262 ;; Remove pre-compiled .pyc files from source.
1263 (for-each delete-file-recursively
1264 (find-files "." "__pycache__" #:directories? #t))
1265 (for-each delete-file (find-files "." "\\.pyc$"))
1266 #t))))
1267 (build-system python-build-system)
1268 (arguments
1269 '(#:tests? #f)) ;FIXME: Some tests are failing.
1270 ;; #:phases
1271 ;; (modify-phases %standard-phases
1272 ;; (delete 'check)
1273 ;; (add-after 'install 'check
1274 ;; (lambda* (#:key inputs outputs #:allow-other-keys)
1275 ;; (add-installed-pythonpath inputs outputs)
1276 ;; (zero? (system* "py.test" "-v")))))
1277 (native-inputs
1278 `(("python-setuptools-scm" ,python-setuptools-scm)))
1279 (propagated-inputs
1280 `(("python-execnet" ,python-execnet)
1281 ("python-pytest" ,python-pytest)
1282 ("python-py" ,python-py)))
1283 (home-page
1284 "https://github.com/pytest-dev/pytest-xdist")
1285 (synopsis
1286 "Plugin for py.test with distributed testing and loop-on-failing modes")
1287 (description
1288 "The pytest-xdist plugin extends py.test with some unique test execution
1289 modes: parallelization, running tests in boxed subprocesses, the ability
1290 to run tests repeatedly when failed, and the ability to run tests on multiple
1291 Python interpreters or platforms. It uses rsync to copy the existing
1292 program code to a remote location, executes there, and then syncs the
1293 result back.")
1294 (license license:expat)))
1295
1296 (define-public python2-pytest-xdist
1297 (package-with-python2 python-pytest-xdist))
1298
1299 (define-public python-pytest-timeout
1300 (package
1301 (name "python-pytest-timeout")
1302 (version "1.3.4")
1303 (source
1304 (origin
1305 (method url-fetch)
1306 (uri (pypi-uri "pytest-timeout" version))
1307 (sha256
1308 (base32
1309 "13n42azbvs5slvy2n1a9nw17r4qdq10dd68nln3jp925safa3yl0"))))
1310 (build-system python-build-system)
1311 (arguments
1312 '(#:phases (modify-phases %standard-phases
1313 (replace 'check
1314 (lambda* (#:key inputs outputs #:allow-other-keys)
1315 ;; Make the installed plugin discoverable by Pytest.
1316 (add-installed-pythonpath inputs outputs)
1317 (invoke "pytest" "-vv"))))))
1318 (propagated-inputs
1319 `(("python-pytest" ,python-pytest)))
1320 (native-inputs
1321 `(("python-pexpect" ,python-pexpect)))
1322 (home-page "http://bitbucket.org/pytest-dev/pytest-timeout/")
1323 (synopsis "Plugin for py.test to abort hanging tests")
1324 (description
1325 "This package provides a py.test plugin that aborts hanging tests after a
1326 timeout has been exceeded.")
1327 (license license:expat)))
1328
1329 (define-public python-pytest-forked
1330 (package
1331 (name "python-pytest-forked")
1332 (version "1.1.3")
1333 (source
1334 (origin
1335 (method url-fetch)
1336 (uri (pypi-uri "pytest-forked" version))
1337 (sha256
1338 (base32
1339 "000i4q7my2fq4l49n8idx2c812dql97qv6qpm2vhrrn9v6g6j18q"))))
1340 (build-system python-build-system)
1341 (propagated-inputs
1342 `(("python-pytest" ,python-pytest)))
1343 (native-inputs
1344 `(("python-setuptools-scm" ,python-setuptools-scm)))
1345 (home-page
1346 "https://github.com/pytest-dev/pytest-forked")
1347 (synopsis
1348 "Run tests in isolated forked subprocesses")
1349 (description
1350 "Pytest plugin which will run each test in a subprocess and will report if
1351 a test crashed the process.")
1352 (license license:expat)))
1353
1354 (define-public python-scripttest
1355 (package
1356 (name "python-scripttest")
1357 (version "1.3")
1358 (source
1359 (origin
1360 (method url-fetch)
1361 (uri (pypi-uri "scripttest" version))
1362 (sha256
1363 (base32
1364 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
1365 (build-system python-build-system)
1366 (native-inputs
1367 `(("python-pytest" ,python-pytest)))
1368 (home-page (string-append "https://web.archive.org/web/20161029233413/"
1369 "http://pythonpaste.org/scripttest/"))
1370 (synopsis "Python library to test command-line scripts")
1371 (description "Scripttest is a Python helper library for testing
1372 interactive command-line applications. With it you can run a script in a
1373 subprocess and see the output as well as any file modifications.")
1374 (license license:expat)))
1375
1376 (define-public python2-scripttest
1377 (package-with-python2 python-scripttest))
1378
1379 (define-public python-testtools-bootstrap
1380 (package
1381 (name "python-testtools-bootstrap")
1382 (version "2.3.0")
1383 (source
1384 (origin
1385 (method url-fetch)
1386 (uri (pypi-uri "testtools" version))
1387 (sha256
1388 (base32
1389 "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
1390 (patches (search-patches "python-testtools.patch"))))
1391 (build-system python-build-system)
1392 (arguments '(#:tests? #f))
1393 (propagated-inputs
1394 `(("python-extras" ,python-extras)
1395 ("python-fixtures" ,python-fixtures-bootstrap)
1396 ("python-mimeparse" ,python-mimeparse)
1397 ("python-pbr" ,python-pbr-minimal)
1398 ("python-six" ,python-six)
1399 ("python-traceback2" ,python-traceback2)
1400 ("python-unittest2" ,python-unittest2)))
1401 (home-page "https://github.com/testing-cabal/testtools")
1402 (synopsis
1403 "Extensions to the Python standard library unit testing framework")
1404 (description
1405 "This package is only for bootstrapping. Do not use this.")
1406 (license license:psfl)))
1407
1408 (define-public python2-testtools-bootstrap
1409 (package-with-python2 python-testtools-bootstrap))
1410
1411 (define-public python-testtools
1412 (package
1413 (inherit python-testtools-bootstrap)
1414 (name "python-testtools")
1415 (arguments
1416 `(#:phases (modify-phases %standard-phases
1417 (replace 'check
1418 (lambda _
1419 (invoke "python" "-m" "testtools.run"
1420 "testtools.tests.test_suite"))))))
1421 (propagated-inputs
1422 `(("python-extras" ,python-extras)
1423 ("python-fixtures" ,python-fixtures)
1424 ("python-mimeparse" ,python-mimeparse)
1425 ("python-pbr" ,python-pbr)
1426 ("python-six" ,python-six)
1427 ("python-traceback2" ,python-traceback2)
1428 ("python-unittest2" ,python-unittest2)))
1429 (native-inputs
1430 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
1431 (description
1432 "Testtools extends the Python standard library unit testing framework to
1433 provide matchers, more debugging information, and cross-Python
1434 compatibility.")))
1435
1436 (define-public python2-testtools
1437 (package-with-python2 python-testtools))
1438
1439 (define-public python-testscenarios-bootstrap
1440 (package
1441 (name "python-testscenarios-bootstrap")
1442 (version "0.5.0")
1443 (source
1444 (origin
1445 (method url-fetch)
1446 (uri (pypi-uri "testscenarios" version))
1447 (sha256
1448 (base32
1449 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
1450 (build-system python-build-system)
1451 (arguments
1452 `(#:phases (modify-phases %standard-phases
1453 (replace 'check
1454 (lambda _
1455 (invoke "python" "-m" "testtools.run"
1456 "testscenarios.test_suite"))))))
1457 (propagated-inputs
1458 `(("python-pbr" ,python-pbr-minimal)
1459 ("python-testtools" ,python-testtools-bootstrap)))
1460 (home-page "https://launchpad.net/testscenarios")
1461 (synopsis "Pyunit extension for dependency injection")
1462 (description
1463 "This package is only for bootstrapping. Don't use this.")
1464 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1465
1466 (define-public python2-testscenarios-bootstrap
1467 (package-with-python2 python-testscenarios-bootstrap))
1468
1469 (define-public python-testscenarios
1470 (package
1471 (inherit python-testscenarios-bootstrap)
1472 (name "python-testscenarios")
1473 (propagated-inputs
1474 `(("python-pbr" ,python-pbr)
1475 ("python-testtools" ,python-testtools)))
1476 (description
1477 "Testscenarios provides clean dependency injection for Python unittest
1478 style tests.")))
1479
1480 (define-public python2-testscenarios
1481 (package-with-python2 python-testscenarios))
1482
1483 ;; Testresources requires python-pbr at runtime, but pbr needs it for its
1484 ;; own tests. Hence this bootstrap variant.
1485 (define-public python-testresources-bootstrap
1486 (package
1487 (name "python-testresources-bootstrap")
1488 (version "2.0.1")
1489 (source (origin
1490 (method url-fetch)
1491 (uri (pypi-uri "testresources" version))
1492 (sha256
1493 (base32
1494 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
1495 (build-system python-build-system)
1496 (arguments '(#:tests? #f))
1497 (propagated-inputs
1498 `(("python-pbr" ,python-pbr-minimal)))
1499 (home-page "https://launchpad.net/testresources")
1500 (synopsis
1501 "Pyunit extension for managing test resources")
1502 (description
1503 "This package is only here for bootstrapping purposes. Use the regular
1504 testresources package instead.")
1505 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1506
1507 (define-public python-testresources
1508 (package
1509 (inherit python-testresources-bootstrap)
1510 (name "python-testresources")
1511 (propagated-inputs
1512 `(("python-pbr" ,python-pbr)))
1513 (arguments '())
1514 (native-inputs
1515 `(("python-fixtures" ,python-fixtures)
1516 ("python-testtols" ,python-testtools)))
1517 (description
1518 "Testresources is an extension to Python's unittest to allow declarative
1519 use of resources by test cases.")))
1520
1521 (define-public python-subunit-bootstrap
1522 (package
1523 (name "python-subunit-bootstrap")
1524 (version "1.4.0")
1525 (source
1526 (origin
1527 (method url-fetch)
1528 (uri (pypi-uri "python-subunit" version))
1529 (sha256
1530 (base32
1531 "0j0ymmnc5nfxi1qzvy59j27viqca7l7xd0y9x29g7yr0h693j804"))))
1532 (build-system python-build-system)
1533 (propagated-inputs
1534 `(("python-extras" ,python-extras)
1535 ("python-testtools" ,python-testtools-bootstrap)))
1536 (native-inputs
1537 `(("python-fixtures" ,python-fixtures-bootstrap)
1538 ("python-hypothesis" ,python-hypothesis)
1539 ("python-testscenarios" ,python-testscenarios-bootstrap)))
1540 (home-page "https://launchpad.net/subunit")
1541 (synopsis "Python implementation of the subunit protocol")
1542 (description
1543 "This package is here for bootstrapping purposes only. Use the regular
1544 python-subunit package instead.")
1545 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1546
1547 (define-public python-subunit
1548 (package
1549 (inherit python-subunit-bootstrap)
1550 (name "python-subunit")
1551 (propagated-inputs
1552 `(("python-extras" ,python-extras)
1553 ("python-testtools" ,python-testtools)))
1554 (native-inputs
1555 `(("python-fixtures" ,python-fixtures)
1556 ("python-hypothesis" ,python-hypothesis)
1557 ("python-testscenarios" ,python-testscenarios)))
1558 (description
1559 "Python-subunit is a Python implementation of the subunit test streaming
1560 protocol.")))
1561
1562 ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
1563 ;; own tests. Hence this bootstrap variant.
1564 (define-public python-fixtures-bootstrap
1565 (package
1566 (name "python-fixtures-bootstrap")
1567 (version "3.0.0")
1568 (source (origin
1569 (method url-fetch)
1570 (uri (pypi-uri "fixtures" version))
1571 (sha256
1572 (base32
1573 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
1574 (build-system python-build-system)
1575 (arguments `(#:tests? #f))
1576 (propagated-inputs
1577 `(("python-pbr-minimal" ,python-pbr-minimal)
1578 ("python-six" ,python-six)))
1579 (home-page "https://launchpad.net/python-fixtures")
1580 (synopsis "Python test fixture library")
1581 (description
1582 "This package is only used for bootstrapping. Use the regular
1583 python-fixtures package instead.")
1584 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1585
1586 (define-public python2-fixtures-bootstrap
1587 (package-with-python2 python-fixtures-bootstrap))
1588
1589 (define-public python-fixtures
1590 (package
1591 (inherit python-fixtures-bootstrap)
1592 (name "python-fixtures")
1593 (arguments
1594 '(#:phases
1595 (modify-phases %standard-phases
1596 (replace 'check
1597 (lambda _
1598 (invoke "python" "-m" "testtools.run"
1599 "fixtures.test_suite"))))))
1600 (propagated-inputs
1601 ;; Fixtures uses pbr at runtime to check versions, etc.
1602 `(("python-pbr" ,python-pbr)
1603 ("python-six" ,python-six)))
1604 (native-inputs
1605 `(("python-mock" ,python-mock)
1606 ("python-testtools" ,python-testtools-bootstrap)))
1607 (description
1608 "Fixtures provides a way to create reusable state, useful when writing
1609 Python tests.")))
1610
1611 (define-public python2-fixtures
1612 (package-with-python2 python-fixtures))
1613
1614 (define-public python-testrepository-bootstrap
1615 (package
1616 (name "python-testrepository-bootstrap")
1617 (version "0.0.20")
1618 (source
1619 (origin
1620 (method url-fetch)
1621 (uri (pypi-uri "testrepository" version))
1622 (sha256
1623 (base32
1624 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1625 (build-system python-build-system)
1626 (arguments '(#:tests? #f))
1627 (propagated-inputs
1628 `(("python-fixtures" ,python-fixtures-bootstrap)
1629 ("python-subunit" ,python-subunit-bootstrap)
1630 ("python-testtools" ,python-testtools-bootstrap)))
1631 (native-inputs
1632 `(("python-mimeparse" ,python-mimeparse)))
1633 (home-page "https://launchpad.net/testrepository")
1634 (synopsis "Database for Python test results")
1635 (description
1636 "Bootstrap package for python-testrepository. Don't use this.")
1637 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1638
1639 (define-public python-testrepository
1640 (package
1641 (inherit python-testrepository-bootstrap)
1642 (name "python-testrepository")
1643 (arguments
1644 ;; FIXME: Many tests are failing.
1645 '(#:tests? #f))
1646 (propagated-inputs
1647 `(("python-fixtures" ,python-fixtures)
1648 ("python-subunit" ,python-subunit)
1649 ("python-testtools" ,python-testtools)))
1650 (native-inputs
1651 `(("python-mimeparse" ,python-mimeparse)))
1652 (description "Testrepository provides a database of test results which can
1653 be used as part of a developer's workflow to check things such as what tests
1654 have failed since the last commit or what tests are currently failing.")))
1655
1656 (define-public python-coverage
1657 (package
1658 (name "python-coverage")
1659 (version "5.2.1")
1660 (source
1661 (origin
1662 (method url-fetch)
1663 (uri (pypi-uri "coverage" version))
1664 (sha256
1665 (base32
1666 "16z8i18msgs8k74n73dj9x49wzkl0vk4vq8k5pl1bsj70y7b4k53"))))
1667 (build-system python-build-system)
1668 (arguments
1669 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1670 '(#:tests? #f))
1671 (home-page "https://coverage.readthedocs.io")
1672 (synopsis "Code coverage measurement for Python")
1673 (description
1674 "Coverage measures code coverage, typically during test execution. It
1675 uses the code analysis tools and tracing hooks provided in the Python standard
1676 library to determine which lines are executable, and which have been
1677 executed.")
1678 (license license:bsd-3)))
1679
1680 (define-public python2-coverage
1681 (package-with-python2 python-coverage))
1682
1683 (define-public python-pytest-asyncio
1684 (package
1685 (name "python-pytest-asyncio")
1686 (version "0.10.0")
1687 (source
1688 (origin
1689 (method url-fetch)
1690 (uri (pypi-uri "pytest-asyncio" version))
1691 (sha256
1692 (base32 "1bysy4nii13bm7h345wxf8fxcjhab7l374pqdv7vwv3izl053b4z"))))
1693 (build-system python-build-system)
1694 (native-inputs
1695 `(("python-coverage" ,python-coverage)
1696 ("python-async-generator" ,python-async-generator)
1697 ("python-hypothesis" ,python-hypothesis)
1698 ("python-pytest" ,python-pytest)))
1699 (home-page "https://github.com/pytest-dev/pytest-asyncio")
1700 (synopsis "Pytest support for asyncio")
1701 (description "Python asyncio code is usually written in the form of
1702 coroutines, which makes it slightly more difficult to test using normal
1703 testing tools. @code{pytest-asyncio} provides useful fixtures and markers
1704 to make testing async code easier.")
1705 (license license:asl2.0)))
1706
1707 (define-public python-cov-core
1708 (package
1709 (name "python-cov-core")
1710 (version "1.15.0")
1711 (source
1712 (origin
1713 (method url-fetch)
1714 (uri (pypi-uri "cov-core" version))
1715 (sha256
1716 (base32
1717 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1718 (build-system python-build-system)
1719 (propagated-inputs
1720 `(("python-coverage" ,python-coverage)))
1721 (home-page "https://github.com/schlamar/cov-core")
1722 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
1723 (description
1724 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1725 and @code{nose2-cov}. It is useful for developing coverage plugins for these
1726 testing frameworks.")
1727 (license license:expat)))
1728
1729 (define-public python2-cov-core
1730 (package-with-python2 python-cov-core))
1731
1732 (define-public python-codecov
1733 (package
1734 (name "python-codecov")
1735 (version "2.0.15")
1736 (source
1737 (origin
1738 (method url-fetch)
1739 (uri (pypi-uri "codecov" version))
1740 (sha256
1741 (base32
1742 "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1743 (build-system python-build-system)
1744 (native-inputs
1745 `(("python-unittest2" ,python-unittest2)))
1746 (propagated-inputs
1747 `(("python-coverage" ,python-coverage)
1748 ("python-requests" ,python-requests)))
1749 (home-page "https://github.com/codecov/codecov-python")
1750 (synopsis "Upload code coverage reports to @code{codecov.io}")
1751 (description
1752 "Codecov collects code coverage reports from code written in Python, Java,
1753 C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
1754 (license license:asl2.0)))
1755
1756 (define-public python-testpath
1757 (package
1758 (name "python-testpath")
1759 (version "0.2")
1760 (source
1761 (origin
1762 (method git-fetch)
1763 (uri (git-reference
1764 (url "https://github.com/jupyter/testpath")
1765 (commit version)))
1766 (file-name (git-file-name name version))
1767 (sha256
1768 (base32
1769 "0r4iiizjql6ny1ln7ciw7rrbjadz1s9zrf2hl0xkgnh3ypd8936f"))))
1770 (build-system python-build-system)
1771 (arguments
1772 `(#:tests? #f ; this package does not even have a setup.py
1773 #:modules ((guix build python-build-system)
1774 (guix build utils)
1775 (srfi srfi-1))
1776 #:phases
1777 (modify-phases %standard-phases
1778 (delete 'install)
1779 (replace 'build
1780 (lambda* (#:key inputs outputs #:allow-other-keys)
1781 (let* ((version (last
1782 (string-split (assoc-ref inputs "python") #\-)))
1783 (x.y (string-join (take (string-split version #\.) 2)
1784 "."))
1785 (dir (string-append
1786 (assoc-ref outputs "out")
1787 "/lib/python" x.y "/site-packages/testpath")))
1788 (mkdir-p dir)
1789 (copy-recursively "testpath" dir))
1790 #t)))))
1791 (home-page "https://github.com/takluyver/testpath")
1792 (synopsis "Test utilities for code working with files and commands")
1793 (description
1794 "Testpath is a collection of utilities for Python code working with files
1795 and commands. It contains functions to check things on the file system, and
1796 tools for mocking system commands and recording calls to those.")
1797 (license license:expat)))
1798
1799 (define-public python2-testpath
1800 (package-with-python2 python-testpath))
1801
1802 (define-public python-testlib
1803 (package
1804 (name "python-testlib")
1805 (version "0.6.5")
1806 (source
1807 (origin
1808 (method url-fetch)
1809 (uri (pypi-uri "testlib" version ".zip"))
1810 (sha256
1811 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1812 (build-system python-build-system)
1813 (native-inputs
1814 `(("unzip" ,unzip))) ; for unpacking the source
1815 (synopsis "Python micro test suite harness")
1816 (description "A micro unittest suite harness for Python.")
1817 (home-page "https://github.com/trentm/testlib")
1818 (license license:expat)))
1819
1820 (define-public python2-testlib
1821 (package-with-python2 python-testlib))
1822
1823 ;;; The software provided by this package was integrated into pytest 2.8.
1824 (define-public python-pytest-cache
1825 (package
1826 (name "python-pytest-cache")
1827 (version "1.0")
1828 (source (origin
1829 (method url-fetch)
1830 (uri (pypi-uri "pytest-cache" version))
1831 (sha256
1832 (base32
1833 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1834 (build-system python-build-system)
1835 (propagated-inputs
1836 `(("python-apipkg" ,python-apipkg)
1837 ("python-execnet" ,python-execnet)
1838 ("python-py" ,python-py)
1839 ("python-pytest" ,python-pytest)))
1840 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1841 (description "The pytest-cache plugin provides tools to rerun failures from
1842 the last py.test invocation.")
1843 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1844 (license license:expat)))
1845
1846 (define-public python2-pytest-cache
1847 (package-with-python2 python-pytest-cache))
1848
1849 (define-public python-pytest-localserver
1850 (package
1851 (name "python-pytest-localserver")
1852 (version "0.5.0")
1853 (source (origin
1854 (method url-fetch)
1855 (uri (pypi-uri "pytest-localserver" version))
1856 (sha256
1857 (base32
1858 "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
1859 (build-system python-build-system)
1860 (arguments
1861 '(#:phases
1862 (modify-phases %standard-phases
1863 (replace 'check
1864 (lambda _
1865 (invoke "py.test" "-v"))))))
1866 (native-inputs
1867 `(("python-pytest" ,python-pytest)
1868 ("python-requests" ,python-requests)
1869 ("python-six" ,python-six)))
1870 (propagated-inputs
1871 `(("python-werkzeug" ,python-werkzeug)))
1872 (synopsis "Py.test plugin to test server connections locally")
1873 (description "Pytest-localserver is a plugin for the pytest testing
1874 framework which enables you to test server connections locally.")
1875 (home-page "https://pypi.org/project/pytest-localserver/")
1876 (license license:expat)))
1877
1878 (define-public python-pytest-xprocess
1879 (package
1880 (name "python-pytest-xprocess")
1881 (version "0.9.1")
1882 (source (origin
1883 (method url-fetch)
1884 (uri (pypi-uri "pytest-xprocess" version))
1885 (sha256
1886 (base32
1887 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1888 (build-system python-build-system)
1889 (propagated-inputs
1890 `(("python-pytest" ,python-pytest)
1891 ("python-pytest-cache" ,python-pytest-cache)
1892 ("python-psutil" ,python-psutil)))
1893 (synopsis "Pytest plugin to manage external processes across test runs")
1894 (description "Pytest-xprocess is an experimental py.test plugin for managing
1895 processes across test runs.")
1896 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1897 (license license:expat)))
1898
1899 (define-public python-pytest-subtesthack
1900 (package
1901 (name "python-pytest-subtesthack")
1902 (version "0.1.1")
1903 (source (origin
1904 (method url-fetch)
1905 (uri (pypi-uri "pytest-subtesthack" version))
1906 (sha256
1907 (base32
1908 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1909 (build-system python-build-system)
1910 (propagated-inputs
1911 `(("python-pytest" ,python-pytest)))
1912 (synopsis "Set-up and tear-down fixtures for unit tests")
1913 (description "This plugin allows you to set up and tear down fixtures within
1914 unit test functions that use @code{py.test}. This is useful for using
1915 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1916 function multiple times, without setting up or tearing down fixture state as is
1917 normally the case.")
1918 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1919 (license license:unlicense)))
1920
1921 (define-public python2-pytest-subtesthack
1922 (package-with-python2 python-pytest-subtesthack))
1923
1924 (define-public python-pytest-sugar
1925 (package
1926 (name "python-pytest-sugar")
1927 (version "0.9.3")
1928 (source
1929 (origin
1930 (method url-fetch)
1931 (uri (pypi-uri "pytest-sugar" version))
1932 (sha256
1933 (base32 "1i0hv3h49zvl62jbiyjag84carbrp3zprqzxffdr291nxavvac0n"))))
1934 (build-system python-build-system)
1935 (propagated-inputs
1936 `(("python-packaging" ,python-packaging)
1937 ("python-pytest" ,python-pytest)
1938 ("python-termcolor" ,python-termcolor)))
1939 (home-page "https://pivotfinland.com/pytest-sugar/")
1940 (synopsis "Plugin for pytest that changes the default look and feel")
1941 (description
1942 "@code{pytest-sugar} is a plugin for py.test that changes the default
1943 look and feel of py.test, using a progress bar and showing failures and errors
1944 instantly.")
1945 (license license:bsd-3)))
1946
1947 (define-public python-hypothesis
1948 (package
1949 (name "python-hypothesis")
1950 (version "5.4.1")
1951 (source (origin
1952 (method url-fetch)
1953 (uri (pypi-uri "hypothesis" version))
1954 (sha256
1955 (base32
1956 "0zn09bn6hadk4vxl6jy8bkjr5fz8mrhin3z46w7pq5qgbaycr89p"))))
1957 (build-system python-build-system)
1958 (arguments
1959 ;; XXX: Tests are not distributed with the PyPI archive.
1960 '(#:tests? #f))
1961 (propagated-inputs
1962 `(("python-attrs" ,python-attrs-bootstrap)
1963 ("python-sortedcontainers" ,python-sortedcontainers)))
1964 (synopsis "Library for property based testing")
1965 (description "Hypothesis is a library for testing your Python code against a
1966 much larger range of examples than you would ever want to write by hand. It’s
1967 based on the Haskell library, Quickcheck, and is designed to integrate
1968 seamlessly into your existing Python unit testing work flow.")
1969 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
1970 (license license:mpl2.0)
1971 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1972
1973 (define-public python-hypothesis-5.23
1974 (package
1975 (inherit python-hypothesis)
1976 (version "5.23.0")
1977 (source (origin
1978 (method url-fetch)
1979 (uri (pypi-uri "hypothesis" version))
1980 (sha256
1981 (base32
1982 "0sy1v6nyxg4rjcf3rlr8nalb7wqd9nccpb2lzkchbj5an13ysf1h"))))
1983 (home-page "https://github.com/HypothesisWorks/hypothesis")))
1984
1985 ;; This is the last version of Hypothesis that supports Python 2.
1986 (define-public python2-hypothesis
1987 (let ((hypothesis (package-with-python2
1988 (strip-python2-variant python-hypothesis))))
1989 (package (inherit hypothesis)
1990 (version "4.57.1")
1991 (source (origin
1992 (method url-fetch)
1993 (uri (pypi-uri "hypothesis" version))
1994 (sha256
1995 (base32
1996 "183gpxbfcdhdqzlahkji5a71n6lmvgqsbkcb0ihqad51n2j6jhrw"))))
1997 (propagated-inputs
1998 `(("python2-enum34" ,python2-enum34)
1999 ,@(package-propagated-inputs hypothesis))))))
2000
2001 (define-public python-hypothesmith
2002 (package
2003 (name "python-hypothesmith")
2004 (version "0.1.2")
2005 (source
2006 (origin
2007 (method url-fetch)
2008 (uri (pypi-uri "hypothesmith" version))
2009 (sha256
2010 (base32
2011 "09331sspknv459xcyn1k0lx5flqlc6gmnwp9370pfvg4kg1zmss6"))))
2012 (build-system python-build-system)
2013 (propagated-inputs
2014 `(("python-hypothesis" ,python-hypothesis-5.23)
2015 ("python-lark-parser" ,python-lark-parser)
2016 ("python-libcst" ,python-libcst)))
2017 (home-page "https://github.com/Zac-HD/hypothesmith")
2018 (synopsis "Strategies for generating Python programs")
2019 (description
2020 "This package contains hypothesis strategies for generating Python
2021 programs, something like CSmith, a random generator of C programs.")
2022 (license license:mpl2.0)))
2023
2024 (define-public python-lit
2025 (package
2026 (name "python-lit")
2027 (version "0.5.1")
2028 (source
2029 (origin
2030 (method url-fetch)
2031 (uri (pypi-uri "lit" version))
2032 (sha256
2033 (base32
2034 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
2035 (build-system python-build-system)
2036 (arguments
2037 `(#:phases
2038 (modify-phases %standard-phases
2039 (replace 'check
2040 (lambda _
2041 (invoke "python" "lit.py" "tests"))))))
2042 (native-inputs
2043 `(("llvm" ,llvm)))
2044 (home-page "https://llvm.org/")
2045 (synopsis "LLVM Software Testing Tool")
2046 (description "@code{lit} is a portable tool for executing LLVM and Clang
2047 style test suites, summarizing their results, and providing indication of
2048 failures.")
2049 (license license:ncsa)))
2050
2051 (define-public python2-lit
2052 (package-with-python2 python-lit))
2053
2054 (define-public python-pytest-pep8
2055 (package
2056 (name "python-pytest-pep8")
2057 (version "1.0.6")
2058 (source (origin
2059 (method url-fetch)
2060 (uri (pypi-uri "pytest-pep8" version))
2061 (sha256
2062 (base32
2063 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
2064 (build-system python-build-system)
2065 (arguments
2066 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
2067 (native-inputs
2068 `(("python-pytest" ,python-pytest)))
2069 (propagated-inputs
2070 `(("python-pep8" ,python-pep8)))
2071 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
2072 (synopsis "Py.test plugin to check PEP8 requirements")
2073 (description "Pytest plugin for checking PEP8 compliance.")
2074 (license license:expat)))
2075
2076 (define-public python2-pytest-pep8
2077 (package-with-python2 python-pytest-pep8))
2078
2079 (define-public python-pytest-flakes
2080 (package
2081 (name "python-pytest-flakes")
2082 (version "4.0.1")
2083 (source (origin
2084 (method url-fetch)
2085 (uri (pypi-uri "pytest-flakes" version))
2086 (sha256
2087 (base32
2088 "0045h3hnrkn2jwr42jgy2j98npx4amwr6wxzi9j0nppaqz33l49p"))))
2089 (build-system python-build-system)
2090 (arguments
2091 `(#:phases
2092 (modify-phases %standard-phases
2093 (delete 'check)
2094 (add-after 'install 'check
2095 (lambda* (#:key outputs inputs #:allow-other-keys)
2096 ;; It's easier to run tests after install.
2097 ;; Make installed package available for running the tests
2098 (add-installed-pythonpath inputs outputs)
2099 (invoke "py.test" "-vv" "-k" "not test_syntax_error"))))))
2100 (native-inputs
2101 `(("python-coverage" ,python-coverage)
2102 ("python-pytest" ,python-pytest)
2103 ("python-pytest-cache" ,python-pytest-cache)
2104 ("python-pytest-pep8" ,python-pytest-pep8)))
2105 (propagated-inputs
2106 `(("python-pyflakes" ,python-pyflakes)))
2107 (home-page "https://github.com/fschulze/pytest-flakes")
2108 (synopsis "Py.test plugin to check source code with pyflakes")
2109 (description "Pytest plugin for checking Python source code with pyflakes.")
2110 (license license:expat)))
2111
2112 (define-public python2-pytest-flakes
2113 (package-with-python2 python-pytest-flakes))
2114
2115 (define-public python2-coverage-test-runner
2116 (package
2117 (name "python2-coverage-test-runner")
2118 (version "1.15")
2119 (source
2120 (origin
2121 (method url-fetch)
2122 (uri (string-append
2123 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
2124 "coverage-test-runner/snapshot/coverage-test-runner-"
2125 version ".tar.gz"))
2126 (sha256
2127 (base32
2128 "1kjjb9llckycnfxag8zcvqsn4z1s3dwyw6b1n0avxydihgf30rny"))))
2129 (build-system python-build-system)
2130 (arguments
2131 `(#:python ,python-2
2132 #:phases
2133 (modify-phases %standard-phases
2134 (replace 'check
2135 (lambda _
2136 (invoke "./testrun"))))))
2137 (propagated-inputs
2138 `(("python2-coverage" ,python2-coverage)))
2139 (home-page "https://liw.fi/coverage-test-runner/")
2140 (synopsis "Python module for running unit tests")
2141 (description "@code{CoverageTestRunner} is a python module for running
2142 unit tests and failing them if the unit test module does not exercise all
2143 statements in the module it tests.")
2144 (license license:gpl3+)))
2145
2146 (define-public python-pylint
2147 (package
2148 (name "python-pylint")
2149 (version "2.5.3")
2150 (source
2151 (origin
2152 (method git-fetch)
2153 (uri (git-reference
2154 (url "https://github.com/PyCQA/pylint")
2155 (commit (string-append "pylint-" version))))
2156 (file-name (git-file-name name version))
2157 (sha256
2158 (base32 "04cgbh2z1mygar63plzziyz34yg6bdr4i0g63jp256fgnqwb1bi3"))))
2159 (build-system python-build-system)
2160 ;; FIXME: Tests are failing since version 2.4.3, see:
2161 ;; https://github.com/PyCQA/pylint/issues/3198.
2162 (arguments '(#:tests? #f))
2163 (native-inputs
2164 `(("python-pytest" ,python-pytest)
2165 ("python-pytest-runner" ,python-pytest-runner)
2166 ("python-tox" ,python-tox)))
2167 (propagated-inputs
2168 `(("python-astroid" ,python-astroid)
2169 ("python-isort" ,python-isort)
2170 ("python-mccabe" ,python-mccabe)
2171 ("python-six" ,python-six)
2172 ("python-toml" ,python-toml)))
2173 (home-page "https://github.com/PyCQA/pylint")
2174 (synopsis "Python source code analyzer which looks for coding standard
2175 errors")
2176 (description "Pylint is a Python source code analyzer which looks
2177 for programming errors, helps enforcing a coding standard and sniffs
2178 for some code smells (as defined in Martin Fowler's Refactoring book).
2179
2180 Pylint has many rules enabled by default, way too much to silence them
2181 all on a minimally sized program. It's highly configurable and handle
2182 pragmas to control it from within your code. Additionally, it is
2183 possible to write plugins to add your own checks.")
2184 (license license:gpl2+)))
2185
2186 (define-public python-paramunittest
2187 (package
2188 (name "python-paramunittest")
2189 (version "0.2")
2190 (source
2191 (origin
2192 (method url-fetch)
2193 (uri (pypi-uri "ParamUnittest" version))
2194 (sha256
2195 (base32
2196 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
2197 (build-system python-build-system)
2198 (home-page
2199 "https://github.com/rik0/ParamUnittest")
2200 (synopsis
2201 "Simple extension to have parametrized unit tests")
2202 (description
2203 "This package creates parameterized unit-tests that work with the standard
2204 unittest package. A parameterized test case is automatically converted to multiple test
2205 cases. Since they are TestCase subclasses, they work with other test suites that
2206 recognize TestCases.")
2207 (license license:bsd-2)))
2208
2209 (define-public python2-python-paramunittest
2210 (package-with-python2 python-paramunittest))
2211
2212 (define-public python-pytest-warnings
2213 (package
2214 (name "python-pytest-warnings")
2215 (version "0.2.0")
2216 (source
2217 (origin
2218 (method url-fetch)
2219 (uri (pypi-uri "pytest-warnings" version))
2220 (sha256
2221 (base32
2222 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
2223 (build-system python-build-system)
2224 (propagated-inputs
2225 `(("pytest" ,python-pytest)))
2226 (home-page "https://github.com/fschulze/pytest-warnings")
2227 (synopsis "Pytest plugin to list Python warnings in pytest report")
2228 (description
2229 "Python-pytest-warnings is a pytest plugin to list Python warnings in
2230 pytest report.")
2231 (license license:expat)
2232 (properties `((python2-variant . ,(delay python2-pytest-warnings))
2233 ;; This package is part of pytest as of version 3.1.0.
2234 (superseded . ,python-pytest)))))
2235
2236 (define-public python2-pytest-warnings
2237 (package (inherit (package-with-python2
2238 (strip-python2-variant python-pytest-warnings)))
2239 (properties `((superseded . ,python2-pytest)))))
2240
2241 (define-public python-pytest-capturelog
2242 (package
2243 (name "python-pytest-capturelog")
2244 (version "0.7")
2245 (source
2246 (origin
2247 (method url-fetch)
2248 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
2249 (sha256
2250 (base32
2251 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
2252 (build-system python-build-system)
2253 (propagated-inputs
2254 `(("pytest" ,python-pytest)))
2255 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
2256 (synopsis "Pytest plugin to catch log messages")
2257 (description
2258 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
2259 (license license:expat)))
2260
2261 (define-public python2-pytest-capturelog
2262 (package-with-python2 python-pytest-capturelog))
2263
2264 (define-public python-pytest-catchlog
2265 (package
2266 (name "python-pytest-catchlog")
2267 (version "1.2.2")
2268 (source
2269 (origin
2270 (method url-fetch)
2271 (uri (pypi-uri "pytest-catchlog" version ".zip"))
2272 (sha256
2273 (base32
2274 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
2275 (build-system python-build-system)
2276 (native-inputs
2277 `(("unzip" ,unzip)))
2278 (propagated-inputs
2279 `(("pytest" ,python-pytest)))
2280 (home-page "https://github.com/eisensheng/pytest-catchlog")
2281 (synopsis "Pytest plugin to catch log messages")
2282 (description
2283 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
2284 a fork of pytest-capturelog.")
2285 (license license:expat)))
2286
2287 (define-public python2-pytest-catchlog
2288 (package-with-python2 python-pytest-catchlog))
2289
2290 (define-public python-nosexcover
2291 (package
2292 (name "python-nosexcover")
2293 (version "1.0.11")
2294 (source (origin
2295 (method url-fetch)
2296 (uri (pypi-uri "nosexcover" version))
2297 (sha256
2298 (base32
2299 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
2300 (build-system python-build-system)
2301 (propagated-inputs
2302 `(("python-coverage" ,python-coverage)
2303 ("python-nose" ,python-nose)))
2304 (home-page "https://github.com/cmheisel/nose-xcover")
2305 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
2306 (description "Nose-xcover is a companion to the built-in
2307 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
2308 to a file named coverage.xml.
2309
2310 It will honor all the options you pass to the Nose coverage plugin,
2311 especially -cover-package.")
2312 (license license:expat)))
2313
2314 (define-public python2-nosexcover
2315 (package-with-python2 python-nosexcover))
2316
2317 (define-public python-discover
2318 (package
2319 (name "python-discover")
2320 (version "0.4.0")
2321 (source
2322 (origin
2323 (method url-fetch)
2324 (uri (pypi-uri "discover" version))
2325 (sha256
2326 (base32
2327 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
2328 (build-system python-build-system)
2329 (home-page "https://pypi.org/project/discover/")
2330 (synopsis
2331 "Python test discovery for unittest")
2332 (description
2333 "Discover provides test discovery for unittest, a feature that has been
2334 backported from Python 2.7 for Python 2.4+.")
2335 (license license:bsd-3)))
2336
2337 (define-public python2-discover
2338 (package-with-python2 python-discover))
2339
2340 (define-public behave
2341 (package
2342 (name "behave")
2343 (version "1.2.6")
2344 (source (origin
2345 (method url-fetch)
2346 (uri (pypi-uri "behave" version))
2347 (sha256
2348 (base32
2349 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))
2350 (patches (search-patches
2351 "behave-skip-a-couple-of-tests.patch"))))
2352 (build-system python-build-system)
2353 (native-inputs
2354 `(("python-mock" ,python-mock)
2355 ("python-nose" ,python-nose)
2356 ("python-pathpy" ,python-pathpy)
2357 ("python-pyhamcrest" ,python-pyhamcrest)
2358 ("python-pytest" ,python-pytest)))
2359 (propagated-inputs
2360 `(("python-importlib-metadata" ,python-importlib-metadata)
2361 ("python-six" ,python-six)
2362 ("python-parse" ,python-parse)
2363 ("python-parse-type" ,python-parse-type)))
2364 (arguments
2365 '(#:test-target "behave_test"
2366 #:phases
2367 (modify-phases %standard-phases
2368 (add-before 'check 'fix-library-loading
2369 (lambda _
2370 ;; Otherwise, tests fail with no module named 'path'
2371 (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH") ":"
2372 (getcwd) "/tasks/_vendor"))
2373 #t)))))
2374 (home-page "https://github.com/behave/behave")
2375 (synopsis "Python behavior-driven development")
2376 (description
2377 "Behave is a tool for behavior-driven development in python.
2378 Behavior-driven development (or BDD) is an agile software development
2379 technique that encourages collaboration between developers, QA and
2380 non-technical or business participants in a software project. Behave uses
2381 tests written in a natural language style, backed up by Python code.")
2382 (license license:x11)))
2383
2384 (define-public python-behave-web-api
2385 (package
2386 (name "python-behave-web-api")
2387 (version "1.0.6")
2388 (source
2389 (origin
2390 (method url-fetch)
2391 (uri (pypi-uri "behave-web-api" version))
2392 (sha256
2393 (base32
2394 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
2395 (build-system python-build-system)
2396 (arguments
2397 `(#:phases
2398 (modify-phases %standard-phases
2399 (add-after 'unpack 'fix-dependencies
2400 (lambda _
2401 (substitute* "setup.py"
2402 (("'wheel'") "") ; We don't use it.
2403 (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
2404 #t)))))
2405 (propagated-inputs
2406 `(("behave" ,behave)
2407 ("python-requests" ,python-requests)))
2408 (home-page "https://github.com/jefersondaniel/behave-web-api")
2409 (synopsis "Provides testing for JSON APIs with Behave for Python")
2410 (description "This package provides testing utility modules for testing
2411 JSON APIs with Behave.")
2412 (license license:expat)))
2413
2414 (define-public python-rednose
2415 (package
2416 (name "python-rednose")
2417 (version "1.2.3")
2418 (source
2419 (origin
2420 (method url-fetch)
2421 (uri (pypi-uri "rednose" version))
2422 (sha256
2423 (base32
2424 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
2425 (build-system python-build-system)
2426 (arguments
2427 `(#:phases (modify-phases %standard-phases
2428 (add-after 'unpack 'patch-setup.py
2429 (lambda _
2430 ;; Six is only required for tests and later versions
2431 ;; work fine.
2432 (substitute* "setup.py"
2433 (("six==1.10.0") "six"))
2434 #t)))))
2435 (propagated-inputs
2436 `(("python-colorama" ,python-colorama)
2437 ("python-termstyle" ,python-termstyle)))
2438 (native-inputs
2439 `(("python-six" ,python-six)
2440 ("python-nose" ,python-nose)))
2441 (home-page "https://github.com/JBKahn/rednose")
2442 (synopsis "Colored output for Python nosetests")
2443 (description "This package provides colored output for the
2444 @command{nosetests} command of the Python Nose unit test framework.")
2445 (license license:bsd-3)))
2446
2447 (define-public python2-rednose
2448 (package-with-python2 python-rednose))
2449
2450 (define-public python-nose-random
2451 (package
2452 (name "python-nose-random")
2453 (version "1.0.0")
2454 (source
2455 (origin
2456 (method git-fetch)
2457 (uri (git-reference
2458 (url "https://github.com/fzumstein/nose-random")
2459 (commit version)))
2460 (file-name (git-file-name name version))
2461 (sha256
2462 (base32
2463 "1dvip61r2frjv35mv6mmfjc07402z73pjbndfp3mhxyjn2zhksw2"))))
2464 (build-system python-build-system)
2465 (native-inputs
2466 `(("python-nose" ,python-nose)))
2467 (home-page "https://github.com/fzumstein/nose-random")
2468 (synopsis "Nose plugin to facilitate randomized unit testing with
2469 Python")
2470 (description "Python nose-random is designed to facilitate
2471 Monte-Carlo style unit testing. The idea is to improve testing by
2472 running your code against a large number of randomly generated input
2473 scenarios.")
2474 (license license:expat)))
2475
2476 (define-public python-nose-randomly
2477 (package
2478 (name "python-nose-randomly")
2479 (version "1.2.6")
2480 (source
2481 (origin
2482 (method url-fetch)
2483 (uri (pypi-uri "nose-randomly" version))
2484 (sha256
2485 (base32 "0z662rqhfk4bjmg806mn4frb8nz4gbh7mrddsrhfffp1g4yklj3y"))))
2486 (build-system python-build-system)
2487 (native-inputs
2488 `(("python-nose" ,python-nose)
2489 ("python-numpy" ,python-numpy)))
2490 (home-page "https://github.com/adamchainz/nose-randomly")
2491 (synopsis
2492 "Nose plugin to randomly order tests and control random.seed")
2493 (description
2494 "This is a @code{Nose} plugin to randomly order tests which can be quite
2495 powerful in discovering hidden flaws in the tests themselves, while helping to
2496 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
2497 by resetting it to a repeatable number for each test, enabling the tests to
2498 create data based on random numbers and yet remain repeatable.")
2499 (license license:bsd-3)))
2500
2501 (define-public python2-nose-randomly
2502 (package-with-python2 python-nose-randomly))
2503
2504 (define-public python-nose-timer
2505 (package
2506 (name "python-nose-timer")
2507 (version "0.7.5")
2508 (source
2509 (origin
2510 (method url-fetch)
2511 (uri (pypi-uri "nose-timer" version))
2512 (sha256
2513 (base32 "05wzkc88vbzw62pqkvhl33211b90kns0lny70b7qw62rcg4flzk4"))))
2514 (build-system python-build-system)
2515 (propagated-inputs
2516 `(("python-nose" ,python-nose)
2517 ("python-termcolor" ,python-termcolor)))
2518 (home-page "https://github.com/mahmoudimus/nose-timer")
2519 (synopsis "Timer plugin for nosetests")
2520 (description "Shows how much time was needed to run individual tests.")
2521 (license license:expat)))
2522
2523 (define-public python2-nose-timer
2524 (package-with-python2 python-nose-timer))
2525
2526 (define-public python-freezegun
2527 (package
2528 (name "python-freezegun")
2529 (version "0.3.14")
2530 (source
2531 (origin
2532 (method url-fetch)
2533 (uri (pypi-uri "freezegun" version))
2534 (sha256
2535 (base32 "0al75mk829j1izxi760b7yjnknjihyfhp2mvi5qiyrxb9cpxwqk2"))))
2536 (build-system python-build-system)
2537 (native-inputs
2538 `(("python-mock" ,python-mock)
2539 ("python-pytest" ,python-pytest)))
2540 (propagated-inputs
2541 `(("python-six" ,python-six)
2542 ("python-dateutil" ,python-dateutil)))
2543 (arguments
2544 `(#:phases
2545 (modify-phases %standard-phases
2546 ;; The tests are normally executed via `make test`, but the PyPi
2547 ;; package does not include the Makefile.
2548 (replace 'check
2549 (lambda _
2550 (invoke "pytest" "-vv"))))))
2551 (home-page "https://github.com/spulec/freezegun")
2552 (synopsis "Test utility for mocking the datetime module")
2553 (description
2554 "FreezeGun is a library that allows your python tests to travel through
2555 time by mocking the datetime module.")
2556 (license license:asl2.0)))
2557
2558 (define-public python2-freezegun
2559 (package-with-python2 python-freezegun))
2560
2561 (define-public python-flexmock
2562 (package
2563 (name "python-flexmock")
2564 (version "0.10.4")
2565 (source (origin
2566 (method url-fetch)
2567 (uri (pypi-uri "flexmock" version))
2568 (sha256
2569 (base32
2570 "0b6qw3grhgx58kxlkj7mdma7xdvlj02zabvcf7w2qifnfjwwwcsh"))))
2571 (build-system python-build-system)
2572 (home-page "https://flexmock.readthedocs.org")
2573 (synopsis "Testing library for Python")
2574 (description
2575 "flexmock is a testing library for Python that makes it easy to create
2576 mocks, stubs and fakes.")
2577 (license license:bsd-3)))
2578
2579 (define-public python2-flexmock
2580 (package-with-python2 python-flexmock))
2581
2582 (define-public python-flaky
2583 (package
2584 (name "python-flaky")
2585 (version "3.5.3")
2586 (source (origin
2587 (method url-fetch)
2588 (uri (pypi-uri "flaky" version))
2589 (sha256
2590 (base32
2591 "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j"))))
2592 (build-system python-build-system)
2593 (arguments
2594 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2595 '(#:tests? #f))
2596 (home-page "https://github.com/box/flaky")
2597 (synopsis "Automatically rerun flaky tests")
2598 (description
2599 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2600 reruns flaky tests.
2601
2602 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2603 on components that aren't 100% reliable. With flaky, instead of removing
2604 those tests or marking them to @code{@@skip}, they can be automatically
2605 retried.")
2606 (license license:asl2.0)))
2607
2608 (define-public python2-flaky
2609 (package-with-python2 python-flaky))
2610
2611 (define-public python-pyhamcrest
2612 ;; The latest release was in 2016 and its test suite does not work with recent
2613 ;; versions of Pytest. Just take the master branch for now, which seems stable.
2614 (let ((commit "25fdc5f00bdf3084335353bc9247253098ec4cf2")
2615 (revision "0"))
2616 (package
2617 (name "python-pyhamcrest")
2618 (version (git-version "1.9.0" revision commit))
2619 (source (origin
2620 ;; Tests not distributed from pypi release.
2621 (method git-fetch)
2622 (uri (git-reference
2623 (url "https://github.com/hamcrest/PyHamcrest")
2624 (commit commit)))
2625 (file-name (git-file-name name version))
2626 (sha256
2627 (base32
2628 "1miqmhhi68vaix8sqc1lvpvbm27bacffxh5anm5cbfsvk7g9n6f3"))))
2629 (native-inputs ;all native inputs are for tests
2630 `(("python-pytest-cov" ,python-pytest-cov)
2631 ("python-mock" ,python-mock)
2632 ("python-pytest" ,python-pytest)
2633 ("python-hypothesis" ,python-hypothesis)))
2634 (propagated-inputs
2635 `(("python-six" ,python-six)))
2636 (build-system python-build-system)
2637 (arguments
2638 `(#:phases (modify-phases %standard-phases
2639 (replace 'check
2640 (lambda _
2641 (setenv "PYTHONPATH"
2642 (string-append "build/lib:"
2643 (getenv "PYTHONPATH")))
2644 (invoke "pytest" "-vv"))))))
2645 (home-page "http://hamcrest.org/")
2646 (synopsis "Hamcrest matchers for Python")
2647 (description
2648 "PyHamcrest is a framework for writing matcher objects,
2649 allowing you to declaratively define \"match\" rules.")
2650 (license license:bsd-3))))
2651
2652 (define-public python2-pyhamcrest
2653 (package-with-python2 python-pyhamcrest))
2654
2655 (define-public unittest-cpp
2656 (package
2657 (name "unittest-cpp")
2658 (version "2.0.0")
2659 (source (origin
2660 (method git-fetch)
2661 (uri (git-reference
2662 (url "https://github.com/unittest-cpp/unittest-cpp")
2663 (commit (string-append "v" version))))
2664 (file-name (git-file-name name version))
2665 (sha256
2666 (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
2667 (arguments
2668 `(#:tests? #f)) ; It's run after build automatically.
2669 (build-system cmake-build-system)
2670 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2671 (synopsis "Lightweight unit testing framework for C++")
2672 (description "UnitTest++ is a lightweight unit testing framework for C++.
2673 It was designed to do test-driven development on a wide variety of platforms.
2674 Simplicity, portability, speed, and small footprint are all very important
2675 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2676 of advanced library and language features, which means it should be easily
2677 portable to just about any platform.")
2678 (license license:expat)))
2679
2680 (define-public libfaketime
2681 (package
2682 (name "libfaketime")
2683 (version "0.9.8")
2684 (home-page "https://github.com/wolfcw/libfaketime")
2685 (source (origin
2686 (method git-fetch)
2687 (uri (git-reference
2688 (url home-page)
2689 (commit (string-append "v" version))))
2690 (sha256
2691 (base32
2692 "1mfdl82ppgbdvy1ny8mb7xii7p0g7awvn4bn36jb8v4r545slmjc"))
2693 (file-name (git-file-name name version))))
2694 (build-system gnu-build-system)
2695 (arguments
2696 '(#:phases (modify-phases %standard-phases
2697 (replace 'configure
2698 (lambda* (#:key outputs #:allow-other-keys)
2699 (let ((out (assoc-ref outputs "out")))
2700 (setenv "CC" "gcc")
2701 (setenv "PREFIX" out)
2702
2703 ;; XXX: Without this flag, the CLOCK_REALTIME test hangs
2704 ;; indefinitely. See README.packagers for more information.
2705 ;; Try removing this for future versions of libfaketime.
2706 (setenv "FAKETIME_COMPILE_CFLAGS" "-DFORCE_MONOTONIC_FIX")
2707
2708 #t)))
2709 (add-before 'check 'pre-check
2710 (lambda _
2711 (substitute* "test/functests/test_exclude_mono.sh"
2712 (("/bin/bash") (which "bash")))
2713
2714 ;; Do not fail due to use of 'ftime', which was deprecated in
2715 ;; glibc 2.31. Remove this for later versions of libfaketime.
2716 (setenv "FAKETIME_COMPILE_CFLAGS" "-Wno-deprecated-declarations")
2717 #t)))
2718 #:test-target "test"))
2719 (native-inputs
2720 `(("perl" ,perl))) ;for tests
2721 (synopsis "Fake the system time for single applications")
2722 (description
2723 "The libfaketime library allows users to modify the system time that an
2724 application \"sees\". It is meant to be loaded using the dynamic linker's
2725 @code{LD_PRELOAD} environment variable. The @command{faketime} command
2726 provides a simple way to achieve this.")
2727 (license license:gpl2)))
2728
2729 (define-public umockdev
2730 (package
2731 (name "umockdev")
2732 (version "0.14.4")
2733 (source (origin
2734 (method url-fetch)
2735 (uri (string-append "https://github.com/martinpitt/umockdev/"
2736 "releases/download/" version "/"
2737 "umockdev-" version ".tar.xz"))
2738 (sha256
2739 (base32
2740 "0xmi24ckpps32k7hc139psgbsnsf4g106sv4l9m445m46amkxggd"))))
2741 (build-system gnu-build-system)
2742 (arguments
2743 `(#:phases
2744 (modify-phases %standard-phases
2745 (add-after 'unpack 'fix-test
2746 (lambda _
2747 (substitute* "tests/test-umockdev.c"
2748 (("/run") "/tmp"))
2749 #t)))))
2750 (native-inputs
2751 `(("vala" ,vala)
2752 ("gobject-introspection" ,gobject-introspection)
2753 ("gtk-doc" ,gtk-doc)
2754 ("pkg-config" ,pkg-config)
2755
2756 ;; For tests.
2757 ("python" ,python)
2758 ("which" ,which)))
2759 (inputs
2760 `(("glib" ,glib)
2761 ("eudev" ,eudev)
2762 ("libgudev" ,libgudev)))
2763 (home-page "https://github.com/martinpitt/umockdev/")
2764 (synopsis "Mock hardware devices for creating unit tests")
2765 (description "umockdev mocks hardware devices for creating integration
2766 tests for hardware related libraries and programs. It also provides tools to
2767 record the properties and behaviour of particular devices, and to run a
2768 program or test suite under a test bed with the previously recorded devices
2769 loaded.")
2770 (license license:lgpl2.1+)))
2771
2772 (define-public virtest
2773 ;; No releases yet, so we take the commit that "vc" expects.
2774 (let ((commit "f7d03ef39fceba168745bd29e1b20af6e7971e04")
2775 (revision "0"))
2776 (package
2777 (name "virtest")
2778 (version (git-version "0.0" revision commit))
2779 (home-page "https://github.com/mattkretz/virtest")
2780 (source (origin
2781 (method git-fetch)
2782 (uri (git-reference (url home-page) (commit commit)))
2783 (file-name (git-file-name name version))
2784 (sha256
2785 (base32
2786 "07pjyb0mk7y2w1dg1bhl26nb7416xa1mw16ifj6mmps5y6aq054l"))))
2787 (build-system cmake-build-system)
2788 (arguments
2789 `(#:phases (modify-phases %standard-phases
2790 (add-after 'unpack 'adjust-install-directory
2791 (lambda _
2792 ;; Vc is the only consumer of this library, and expects
2793 ;; to find it in "virtest/vir/" instead of "vir/vir/".
2794 (substitute* "CMakeLists.txt"
2795 (("DESTINATION include/vir")
2796 "DESTINATION include/virtest"))
2797 #t)))))
2798 (synopsis "Header-only test framework")
2799 (description
2800 "@code{virtest} is a small header-only test framework for C++. It
2801 grew out of the @dfn{Vc} project.")
2802 (license license:bsd-3))))
2803
2804 (define-public python-pyfakefs
2805 (package
2806 (name "python-pyfakefs")
2807 (version "3.7.1")
2808 (source (origin
2809 (method url-fetch)
2810 ;; We use the PyPI URL because there is no proper release
2811 ;; available from GitHub. The GitHub project only provides
2812 ;; autogenerated tarballs, which are known to change in place.
2813 (uri (pypi-uri "pyfakefs" version))
2814 (sha256
2815 (base32
2816 "1cp2yw96fa2qkgi39xa3nlr3inf8wb5rgh9kdq53256ca2r8pdhy"))
2817 (patches (search-patches
2818 "python-pyfakefs-remove-bad-test.patch"))
2819 (file-name (string-append name "-" version ".tar.gz"))))
2820 (arguments
2821 `(#:phases
2822 (modify-phases %standard-phases
2823 ;; The default test suite does not run these extra tests.
2824 (add-after 'check 'check-pytest-plugin
2825 (lambda _
2826 (invoke
2827 "python" "-m" "pytest"
2828 "pyfakefs/pytest_tests/pytest_plugin_test.py")
2829 #t)))))
2830 (native-inputs
2831 `(("python-pytest" ,python-pytest)))
2832 (build-system python-build-system)
2833 ;; Guix lint doesn't like that this is a permanent redirect to the GitHub
2834 ;; page, but the pyfakefs documentation asks us to use this specific URL
2835 ;; when linking to the project. Honor their request.
2836 (home-page "http://pyfakefs.org/")
2837 ;; TRANSLATORS: In the synopsis, "Mock" is a verb.
2838 (synopsis "Mock file system interactions in tests")
2839 (description
2840 "This package provides a Python library intended for use in automated
2841 tests. One difficulty when testing software is that the code under test might
2842 need to read or write to files in the local file system. If the file system
2843 is not set up in just the right way, it might cause a spurious error during
2844 the test. The pyfakefs library provides a solution to problems like this by
2845 mocking file system interactions. In other words, it arranges for the code
2846 under test to interact with a fake file system instead of the real file
2847 system. The code under test requires no modification to work with pyfakefs.")
2848 (license license:asl2.0)))
2849
2850 (define-public python2-pyfakefs
2851 (package-with-python2 python-pyfakefs))
2852
2853 ;; This minimal variant is used to avoid a circular dependency between
2854 ;; python2-importlib-metadata, which requires pyfakefs for its tests, and
2855 ;; python2-pytest, which requires python2-importlib-metadata.
2856 (define-public python2-pyfakefs-bootstrap
2857 (hidden-package
2858 (package
2859 (inherit python2-pyfakefs)
2860 (name "python2-pyfakefs-bootstrap")
2861 (native-inputs '())
2862 (arguments
2863 `(#:python ,python-2
2864 #:tests? #f)))))
2865
2866 (define-public python-aiounittest
2867 (package
2868 (name "python-aiounittest")
2869 (version "1.3.1")
2870 (source
2871 (origin
2872 (method url-fetch)
2873 (uri (pypi-uri "aiounittest" version))
2874 (sha256
2875 (base32
2876 "1q4bhmi80smaa1lknvdna0sx3915naczlfna1fp435nf6cjyrjl1"))))
2877 (build-system python-build-system)
2878 (native-inputs
2879 `(("python-coverage" ,python-coverage)
2880 ("python-nose" ,python-nose)))
2881 (home-page
2882 "https://github.com/kwarunek/aiounittest")
2883 (synopsis "Test asyncio code more easily")
2884 (description "Aiounittest is a library that helps write tests using
2885 asynchronous code in Python (asyncio).")
2886 (license license:expat)))