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