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