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