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