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 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
40 ;;; This file is part of GNU Guix.
42 ;;; GNU Guix is free software; you can redistribute it and/or modify it
43 ;;; under the terms of the GNU General Public License as published by
44 ;;; the Free Software Foundation; either version 3 of the License, or (at
45 ;;; your option) any later version.
47 ;;; GNU Guix is distributed in the hope that it will be useful, but
48 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
49 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50 ;;; GNU General Public License for more details.
52 ;;; You should have received a copy of the GNU General Public License
53 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
55 (define-module (gnu packages check)
56 #:use-module (gnu packages)
57 #:use-module (gnu packages autotools)
58 #:use-module (gnu packages base)
59 #:use-module (gnu packages bash)
60 #:use-module (gnu packages compression)
61 #:use-module (gnu packages linux)
62 #:use-module (gnu packages llvm)
63 #:use-module (gnu packages glib)
64 #:use-module (gnu packages gnome)
65 #:use-module (gnu packages golang)
66 #:use-module (gnu packages gtk)
67 #:use-module (gnu packages perl)
68 #:use-module (gnu packages pkg-config)
69 #:use-module (gnu packages python)
70 #:use-module (gnu packages python-web)
71 #:use-module (gnu packages python-xyz)
72 #:use-module (gnu packages time)
73 #:use-module (gnu packages xml)
74 #:use-module (guix utils)
75 #:use-module ((guix licenses) #:prefix license:)
76 #:use-module (guix packages)
77 #:use-module (guix download)
78 #:use-module (guix git-download)
79 #:use-module (guix build-system cmake)
80 #:use-module (guix build-system glib-or-gtk)
81 #:use-module (guix build-system gnu)
82 #:use-module (guix build-system go)
83 #:use-module (guix build-system meson)
84 #:use-module (guix build-system python)
85 #:use-module (guix build-system trivial)
86 #:use-module (srfi srfi-1))
88 (define-public pedansee
96 (string-append "https://www.flyn.org/projects/"
97 name "/" name "-" version ".tar.gz"))
99 (base32 "0lsg791x6n95pxg6vif8qfc46nqcamhjq3g0dl5xqf6imy7n3acd"))))
100 (build-system glib-or-gtk-build-system)
103 ("pkg-config" ,pkg-config)
104 ("python" ,python-wrapper)))
107 (synopsis "Code checker for C")
108 (description "Pedansee checks C source files for compliance with a particular
109 programming style. The style is currently defined by the pedansee source code
110 in the form of functions which walk each source file’s syntax tree. You can
111 modify some aspects of this style through the use of regular expressions.")
112 (home-page "https://www.flyn.org/projects/pedansee/")
113 (license license:gpl3+)))
115 (define-public mutest
124 (url "https://github.com/ebassi/mutest")
126 (file-name (git-file-name name version))
128 (base32 "0gdqwq6fvk06wld4rhnw5752hahrvhd69zrci045x25rwx90x26q"))))
129 (build-system meson-build-system)
130 (synopsis "Small C testing library")
131 (description "Mutest aims to be a small unit testing library for C projects,
132 with an API heavily modelled on high level Behavior-Driver Development frameworks
133 like Jasmine or Mocha.")
134 (home-page "https://ebassi.github.io/mutest/mutest.md.html")
135 (license license:expat)))
144 (uri (string-append "https://github.com/libcheck/check/releases/download/"
145 version "/check-" version ".tar.gz"))
148 "02m25y9m46pb6n46s51av62kpd936lkfv3b13kfpckgvmh5lxpm8"))))
149 (build-system gnu-build-system)
150 (home-page "https://libcheck.github.io/check/")
151 (synopsis "Unit test framework for C")
153 "Check is a unit testing framework for C. It features a simple
154 interface for defining unit tests, putting little in the way of the
155 developer. Tests are run in a separate address space, so Check can
156 catch both assertion failures and code errors that cause segmentation
157 faults or other signals. The output from unit tests can be used within
158 source code editors and IDEs.")
159 (license license:lgpl2.1+)))
161 ;; Some packages require older versions. Removed once no longer needed.
162 (define-public check-0.14
168 (uri (string-append "https://github.com/libcheck/check/releases"
169 "/download/" version "/check-" version ".tar.gz"))
172 "02zkfiyklckmivrfvdsrlzvzphkdsgjrz3igncw05dv5pshhq3xx"))))))
174 (define-public check-0.12
180 (uri (string-append "https://github.com/libcheck/check/releases"
181 "/download/" version "/check-" version ".tar.gz"))
184 "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6"))))))
186 (define-public clitest
190 (home-page "https://github.com/aureliojargas/clitest")
195 (commit (string-append "v" version))))
196 (file-name (git-file-name name version))
199 "0zw5wra9hc717srmcar1wm4i34kyj8c49ny4bb7y3nrvkjp2pdb5"))))
200 (build-system gnu-build-system)
203 (modify-phases %standard-phases
204 ;; This package is distributed as a single shell script and comes
205 ;; without a proper build system.
210 (substitute* "test.md"
211 ;; One test looks for an error from grep in the form "grep: foo",
212 ;; but our grep returns the absolute file name on errors. Adjust
213 ;; the test to cope with that.
214 (("sed 's/\\^e\\*grep: \\.\\*/")
215 "sed 's/.*e*grep: .*/"))
217 (setenv "HOME" "/tmp")
218 (invoke "./clitest" "test.md")))
220 (lambda* (#:key outputs #:allow-other-keys)
221 (let ((out (assoc-ref outputs "out")))
222 (install-file "clitest" (string-append out "/bin"))
223 (install-file "README.md"
224 (string-append out "/share/doc/clitest-" ,version))
227 `(("perl" ,perl))) ;for tests
228 (synopsis "Command line test tool")
230 "@command{clitest} is a portable shell script that performs automatic
231 testing of Unix command lines.")
232 (license license:expat)))
241 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
242 version "/CUnit-" version ".tar.bz2"))
245 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
246 (build-system gnu-build-system)
247 (arguments '(#:phases
248 (modify-phases %standard-phases
249 ;; XXX: The "bootstrap" phase detects the "bootstrap"
250 ;; script, but fails to execute it, so we bootstrap
253 (lambda _ (invoke "autoreconf" "-vfi"))))))
255 `(("automake" ,automake)
256 ("autoconf" ,autoconf)
257 ("libtool" ,libtool)))
258 (home-page "http://cunit.sourceforge.net/")
259 (synopsis "Automated testing framework for C")
261 "CUnit is a lightweight system for writing, administering, and running
262 unit tests in C. It provides C programmers with basic testing functionality
263 with a flexible variety of user interfaces.")
264 (license license:gpl2+)))
266 (define-public cppunit
272 (uri (string-append "http://dev-www.libreoffice.org/src/"
273 name "-" version ".tar.gz"))
276 "19qpqzy66bq76wcyadmi3zahk5v1ll2kig1nvg96zx9padkcdic9"))))
277 ;; Explicitly link with libdl. This is expected to be done by packages
278 ;; relying on cppunit for their tests. However, not all of them do.
279 ;; If we added the linker flag to such packages, we would pollute all
280 ;; binaries, not only those used for testing.
282 `(#:make-flags '("LDFLAGS=-ldl")))
283 (build-system gnu-build-system)
284 (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
285 (synopsis "Unit testing framework for C++")
286 (description "CppUnit is the C++ port of the famous JUnit framework for
287 unit testing. Test output is in XML for automatic testing and GUI based for
289 (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
291 ;; When dependent packages upgraded to use newer version of catch, this one should
293 (define-public catch-framework
296 (version "1.3.5") ;Sub-minor is the build number
300 (url "https://github.com/philsquared/Catch")
302 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
303 (file-name (string-append name "-" version))
306 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
307 (build-system trivial-build-system)
309 `(#:modules ((guix build utils))
311 (use-modules (guix build utils))
312 (let* ((source (assoc-ref %build-inputs "source"))
313 (output (assoc-ref %outputs "out"))
314 (incdir (string-append output "/include"))
315 (docdir (string-append output "/share/doc/catch-"
317 (for-each mkdir-p (list incdir docdir))
318 (install-file (string-append source
319 "/single_include/catch.hpp")
321 (copy-recursively (string-append source "/docs")
324 (home-page "http://catch-lib.net/")
325 (synopsis "Automated test framework for C++ and Objective-C")
327 "Catch stands for C++ Automated Test Cases in Headers and is a
328 multi-paradigm automated test framework for C++ and Objective-C.")
329 (license license:boost1.0)))
331 (define-public catch-framework2-1
335 (home-page "https://github.com/catchorg/Catch2")
339 (url "https://github.com/catchorg/Catch2")
340 (commit (string-append "v" version))))
341 (file-name (git-file-name name version))
344 "1gdp5wm8khn02g2miz381llw3191k7309qj8s3jd6sasj01rhf23"))))
345 (build-system cmake-build-system)
346 (synopsis "Automated test framework for C++ and Objective-C")
347 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
348 a multi-paradigm automated test framework for C++ and Objective-C.")
349 (license license:boost1.0)))
351 (define-public catch-framework2
355 (home-page "https://github.com/catchorg/Catch2")
359 (url "https://github.com/catchorg/Catch2")
360 (commit (string-append "v" version))))
361 (file-name (git-file-name name version))
364 "100r0kmra8jmra2hv92lzvwcmphpaiccwvq3lpdsa5b7hailhach"))))
365 (build-system cmake-build-system)
367 `(("python" ,python-wrapper)))
368 (synopsis "Automated test framework for C++ and Objective-C")
369 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
370 a multi-paradigm automated test framework for C++ and Objective-C.")
371 (license license:boost1.0)))
373 (define-public cmdtest
379 (uri (string-append "http://git.liw.fi/cmdtest/snapshot/"
380 name "-" version ".tar.gz"))
383 "1jmfiyrrqmpvwdb273bkb8hjaf4rwx9njblx29pmr7giyahskwi5"))))
384 (build-system python-build-system)
388 (modify-phases %standard-phases
389 ;; check phase needs to be run before the build phase. If not, the
390 ;; coverage test runner looks for tests for the built source files,
393 (add-before 'build 'check
396 (("/bin/sh") (which "sh")))
397 ;; yarn uses python2-ttystatus to print messages.
398 ;; python2-ttystatus requires /dev/tty which is not present in
399 ;; the build environment. Hence assuming-failure test fails.
400 (delete-file "yarn.tests/assuming-failure.script")
401 (delete-file "yarn.tests/assuming-failure.stdout")
402 (invoke "python" "setup.py" "check"))))))
404 `(("python2-coverage-test-runner" ,python2-coverage-test-runner)))
406 `(("python2-cliapp" ,python2-cliapp)
407 ("python2-markdown" ,python2-markdown)
408 ("python2-ttystatus" ,python2-ttystatus)))
409 (home-page "https://liw.fi/cmdtest/")
410 (synopsis "Black box Unix program tester")
412 "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
413 given a command line and input files, and the expected output, and it verifies
414 that the command line produces the expected output. If not, it reports a
415 problem, and shows the differences.")
416 (license license:gpl3+)))
418 (define-public cmocka
424 (uri (string-append "https://cmocka.org/files/"
425 (version-major+minor version) "/cmocka-"
429 "1dm8pdvkyfa8dsbz9bpq7wwgixjij4sii9bbn5sgvqjm5ljdik7h"))))
430 (build-system cmake-build-system)
432 `(#:tests? #f)) ; no test target
433 (home-page "https://cmocka.org/")
434 (synopsis "Unit testing framework for C")
435 (description "Cmocka is a unit testing framework for C with support for
436 mock objects. It only requires the standard C library, and works with
437 different compilers. Cmocka supports several different message output formats
438 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
440 (license license:asl2.0)))
442 (define-public cppcheck
449 (url "https://github.com/danmar/cppcheck")
451 (file-name (git-file-name name version))
453 (base32 "03ic5mig3ryzkf85r95ryagf84s7y5nd6sqr915l3zj30apnifvz"))))
454 (build-system cmake-build-system)
456 '(#:configure-flags '("-DBUILD_TESTS=ON")))
457 (home-page "http://cppcheck.sourceforge.net")
458 (synopsis "Static C/C++ code analyzer")
459 (description "Cppcheck is a static code analyzer for C and C++. Unlike
460 C/C++ compilers and many other analysis tools it does not detect syntax errors
461 in the code. Cppcheck primarily detects the types of bugs that the compilers
462 normally do not detect. The goal is to detect only real errors in the code
463 (i.e. have zero false positives).")
464 (license license:gpl3+)))
466 (define-public cxxtest
472 (uri (string-append "mirror://sourceforge/cxxtest/cxxtest/"
473 version "/cxxtest-" version ".tar.gz"))
476 "1n7pbj4z9ivx005hqvivj9ddhq8awynzg6jishfbypf6j7ply58w"))))
477 (build-system python-build-system)
480 (modify-phases %standard-phases
481 (add-after 'unpack 'chdir-to-source
485 (add-after 'install 'install-headers
486 (lambda* (#:key outputs #:allow-other-keys)
487 (let* ((out (assoc-ref outputs "out"))
488 (include-dir (string-append out "/include/cxxtest")))
489 (for-each (lambda (header-file)
490 (install-file header-file include-dir))
491 (find-files "../cxxtest"))
493 (add-after 'install 'install-doc
494 (lambda* (#:key outputs #:allow-other-keys)
495 (let* ((out (assoc-ref outputs "out"))
496 (doc-dir (string-append out "/share/doc/cxxtest")))
497 (install-file "../README" doc-dir)
498 (install-file "../doc/guide.txt" doc-dir)
499 (copy-recursively "../sample" (string-append doc-dir "/sample"))
502 `(("python-ply" ,python-ply)))
503 (home-page "https://cxxtest.com/")
504 (synopsis "Unit testing framework for C++")
505 (description "CxxTest is a unit testing framework for C++ that is similar
506 in spirit to JUnit, CppUnit, and xUnit. CxxTest does not require precompiling
507 a CxxTest testing library, it employs no advanced features of C++ (e.g. RTTI)
508 and it supports a very flexible form of test discovery.")
509 (license license:lgpl3+)))
511 (define-public doctest
515 (home-page "https://github.com/onqtam/doctest")
518 (uri (git-reference (url home-page) (commit version)))
519 (file-name (git-file-name name version))
522 "0xldd6cr1w3bn33rdb7yc6p57w143cgnjb48ig1b99iwvvkw599n"))))
523 (build-system cmake-build-system)
524 (synopsis "C++ test framework")
526 "doctest is a single-header testing framework for C++11 and later. It
527 has been designed to be fast, light and unintrusive.")
528 (license license:expat)))
530 (define-public go-gopkg.in-check.v1
531 (let ((commit "788fd78401277ebd861206a03c884797c6ec5541")
534 (name "go-gopkg.in-check.v1")
535 (version (git-version "0.0.0" revision commit))
539 (url "https://github.com/go-check/check")
541 (file-name (git-file-name name version))
544 "0v3bim0j375z81zrpr5qv42knqs0y2qv2vkjiqi5axvb78slki1a"))))
545 (build-system go-build-system)
547 '(#:import-path "gopkg.in/check.v1"))
549 `(("go-github-com-kr-pretty" ,go-github-com-kr-pretty)))
550 (synopsis "Rich testing extension for Go's testing package")
552 "@code{check} is a rich testing extension for Go's testing package.")
553 (home-page "https://github.com/go-check/check")
554 (license license:bsd-2))))
556 (define-public go-github.com-smartystreets-gunit
558 (name "go-github.com-smartystreets-gunit")
563 (url "https://github.com/smartystreets/gunit")
565 (file-name (git-file-name name version))
568 "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
569 (build-system go-build-system)
571 '(;; TODO: This package depends on go-github.com-smartystreets-assertions
572 ;; for running the tests, but go-github.com-smartystreets-assertions
573 ;; depends on this package, so break this loop by not running the tests
576 #:import-path "github.com/smartystreets/gunit"))
577 (synopsis "Testing tool for Go, in the style of xUnit")
579 "@code{gunit} allows the test author to use a struct as the scope for a
580 group of related test cases, in the style of xUnit fixtures. This makes
581 extraction of setup/teardown behavior (as well as invoking the system under
582 test) much simpler.")
583 (home-page "https://github.com/smartystreets/gunit")
584 (license license:expat)))
586 (define-public go-github.com-smartystreets-assertions
588 (name "go-github.com-smartystreets-assertions")
593 (url "https://github.com/smartystreets/assertions")
595 (file-name (git-file-name name version))
598 "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
599 (build-system go-build-system)
601 '(#:import-path "github.com/smartystreets/assertions"))
603 `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
604 (synopsis "Assertions for testing with Go")
606 "The @code{assertions} package provides convenient assertion functions
607 for writing tests in Go.")
608 (home-page "https://github.com/smartystreets/assertions")
609 (license license:expat)))
611 (define-public go-github.com-smartystreets-goconvey
613 (name "go-github.com-smartystreets-goconvey")
618 (url "https://github.com/smartystreets/goconvey")
620 (file-name (git-file-name name version))
623 "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
624 (build-system go-build-system)
626 '(#:import-path "github.com/smartystreets/goconvey"))
628 `(("go-github.com-jtolds-gls" ,go-github.com-jtolds-gls)
629 ("go-github.com-smartystreets-assertions" ,go-github.com-smartystreets-assertions)))
630 (synopsis "Go testing tool with both a web and terminal user interface")
632 "GoConvey is a testing tool for Go. It integrates with go test, can show
633 test coverage and has a web user interface that will refresh automatically.")
634 (home-page "https://github.com/smartystreets/goconvey")
635 (license license:expat)))
637 (define-public googletest
645 (url "https://github.com/google/googletest")
646 (commit (string-append "release-" version))))
647 (file-name (git-file-name name version))
649 (base32 "1zbmab9295scgg4z2vclgfgjchfjailjnvzc6f5x9jvlsdi3dpwz"))))
650 (build-system cmake-build-system)
652 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
654 `(("python" ,python-wrapper)))
655 (home-page "https://github.com/google/googletest/")
656 (synopsis "Test discovery and XUnit test framework")
657 (description "Google Test features an XUnit test framework, automated test
658 discovery, death tests, assertions, parameterized tests and XML test report
660 (license license:bsd-3)))
662 (define-public googletest-1.8
669 (url "https://github.com/google/googletest")
670 (commit (string-append "release-" version))))
671 (file-name (git-file-name "googletest" version))
674 "0270msj6n7mggh4xqqjp54kswbl7mkcc8px1p5dqdpmw5ngh9fzk"))))))
676 (define-public cpputest
683 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
684 version "/cpputest-" version ".tar.gz"))
687 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
688 (build-system gnu-build-system)
690 `(("googletest" ,googletest)))
691 (home-page "https://cpputest.github.io/")
692 (synopsis "Unit testing and mocking framework for C/C++")
694 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
695 C++ but is used in C and C++ projects and frequently used in embedded systems
696 but it works for any C/C++ project.")
697 (license license:bsd-3)))
699 (define-public python-parameterized
701 (name "python-parameterized")
706 (uri (pypi-uri "parameterized" version))
708 (base32 "1444fdz5bj0k10nmhxv0bv2gfrfisi7hfzqdndb0pvhf4g3qq3qr"))))
709 (build-system python-build-system)
711 '(#:phases (modify-phases %standard-phases
713 (lambda* (#:key tests? #:allow-other-keys)
715 (invoke "nosetests" "-v")
716 (format #t "test suite not run~%"))
719 `(("python-mock" ,python-mock)
720 ("python-nose" ,python-nose)))
721 (home-page "https://github.com/wolever/parameterized")
722 (synopsis "Parameterized testing with any Python test framework")
724 "Parameterized is a Python library that aims to fix parameterized testing
725 for every Python test framework. It supports nose, py.test, and unittest.")
726 (properties `((python2-variant . ,(delay python2-parameterized))))
727 (license license:bsd-2)))
729 (define-public python2-parameterized
730 (let ((base (package-with-python2 (strip-python2-variant
731 python-parameterized))))
736 (inherit (package-source base))
737 (patches (search-patches "python2-parameterized-docstring-test.patch")))))))
739 (define-public python-minimock
741 (name "python-minimock")
746 (uri (pypi-uri "MiniMock" version))
749 "0k2sxb1ibnyg05iblz7zhbv825f1zk9906rab7883iqgvzmdzpsz"))))
750 (build-system python-build-system)
751 (home-page "https://pypi.org/project/MiniMock")
752 (synopsis "Simple Python library for using mock objects")
753 (description "MiniMock is a simple library for building mock objects with
755 (license license:expat)))
757 (define-public python2-minimock
758 (package-with-python2 python-minimock))
760 (define-public python-mock
767 (uri (pypi-uri "mock" version))
770 "1hrp6j0yrx2xzylfv02qa8kph661m6yq4p0mc8fnimch9j4psrc3"))))
772 `(("python-six" ,python-six)))
773 (build-system python-build-system)
775 ;; FIXME: Tests require "pytest", which depends on this package.
777 (home-page "https://github.com/testing-cabal/mock")
778 (synopsis "Python mocking and patching library for testing")
780 "Mock is a library for testing in Python. It allows you to replace parts
781 of your system under test with mock objects and make assertions about how they
783 (properties `((python2-variant . ,(delay python2-mock))))
784 (license license:expat)))
786 (define-public python2-mock
787 (let ((base (package-with-python2
788 (strip-python2-variant python-mock))))
789 (package (inherit base)
791 `(("python2-functools32" ,python2-functools32)
792 ("python2-funcsigs" ,python2-funcsigs)
793 ,@(package-propagated-inputs base))))))
795 (define-public python-nose
802 (uri (pypi-uri "nose" version))
805 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
806 (build-system python-build-system)
808 '(#:tests? #f)) ; FIXME: test suite fails
809 (home-page "http://readthedocs.org/docs/nose/")
810 (synopsis "Python testing library")
812 "Nose extends the unittest library to make testing easier.")
813 (license license:lgpl2.0+)))
815 (define-public python2-nose
816 (package-with-python2 python-nose))
818 (define-public python-nose2
820 (name "python-nose2")
825 (uri (pypi-uri "nose2" version))
828 "0pmbb6nk31yhgh4zkcblzxsznml7f7pf5q1ihgrwvbxv4mwzfql7"))))
829 (build-system python-build-system)
830 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
832 `(("python-cov-core" ,python-cov-core)
833 ("python-pytest-cov" ,python-pytest-cov)
834 ("python-six" ,python-six)))
835 (home-page "https://github.com/nose-devs/nose2")
836 (synopsis "Next generation of nicer testing for Python")
838 "Nose2 is the next generation of nicer testing for Python, based on the
839 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
840 better plugin api, being easier for users to configure, and simplifying internal
841 interfaces and processes.")
842 (license license:bsd-2)))
844 (define-public python2-nose2
845 (package-with-python2 python-nose2))
847 (define-public python-unittest2
849 (name "python-unittest2")
854 (uri (pypi-uri "unittest2" version))
856 (search-patches "python-unittest2-python3-compat.patch"
857 "python-unittest2-remove-argparse.patch"))
860 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
861 (build-system python-build-system)
864 (modify-phases %standard-phases
867 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
869 `(("python-six" ,python-six)
870 ("python-traceback2" ,python-traceback2)))
871 (home-page "https://pypi.org/project/unittest2/")
872 (synopsis "Python unit testing library")
874 "Unittest2 is a replacement for the unittest module in the Python
876 (license license:psfl)))
878 (define-public python2-unittest2
879 (package-with-python2 python-unittest2))
881 (define-public python-pytest
883 (name "python-pytest")
888 (uri (pypi-uri "pytest" version))
891 "139i9cjhrv5aici3skq8iihvfb3lq0d8xb5j7qycr2hlk8cfjpqd"))))
892 (build-system python-build-system)
895 (modify-phases %standard-phases
897 (lambda* (#:key (tests? #t) #:allow-other-keys)
899 (invoke "pytest" "-vv" "-k"
901 ;; These tests involve the /usr directory, and fails.
902 "not test_remove_dir_prefix"
903 " and not test_argcomplete"
904 ;; This test tries to override PYTHONPATH, and
905 ;; subsequently fails to locate the test libraries.
906 " and not test_collection"))
907 (format #t "test suite not run~%"))
910 `(("python-atomicwrites" ,python-atomicwrites)
911 ("python-attrs" ,python-attrs-bootstrap)
912 ("python-more-itertools" ,python-more-itertools)
913 ("python-packaging" ,python-packaging-bootstrap)
914 ("python-pluggy" ,python-pluggy)
915 ("python-py" ,python-py)
916 ("python-six" ,python-six-bootstrap)
917 ("python-wcwidth" ,python-wcwidth)))
919 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
921 ("python-hypothesis" ,python-hypothesis)
922 ("python-nose" ,python-nose)
923 ("python-mock" ,python-mock)
924 ("python-pytest" ,python-pytest-bootstrap)
925 ("python-setuptools-scm" ,python-setuptools-scm)
926 ("python-xmlschema" ,python-xmlschema)))
927 (home-page "https://docs.pytest.org/en/latest/")
928 (synopsis "Python testing library")
930 "Pytest is a testing tool that provides auto-discovery of test modules
931 and functions, detailed info on failing assert statements, modular fixtures,
932 and many external plugins.")
933 (license license:expat)
934 (properties `((python2-variant . ,(delay python2-pytest))))))
936 (define-public python-pytest-6
938 (inherit (strip-python2-variant python-pytest))
943 (uri (pypi-uri "pytest" version))
946 "0gl2sdm322vzmsh5k4f8kj9raiq2y7kdinnca4m45ifvii5fk9y0"))))
949 (modify-phases %standard-phases
951 (lambda* (#:key (tests? #t) #:allow-other-keys)
952 (setenv "TERM" "dumb") ;attempt disabling markup tests
954 (invoke "pytest" "-vv" "-k"
956 ;; This test involve the /usr directory, and fails.
957 " not test_argcomplete"
958 ;; These test do not honor the isatty detection and
960 " and not test_code_highlight"
961 " and not test_color_yes"))
962 (format #t "test suite not run~%"))
965 (append (alist-delete "python-py"
966 (package-propagated-inputs python-pytest))
967 `(("python-py" ,python-py-next))))
969 (append (alist-delete "python-pytest"
970 (package-native-inputs python-pytest))
971 `(("python-pytest" ,python-pytest-6-bootstrap)
972 ("python-toml" ,python-toml)
973 ("python-iniconfig" ,python-iniconfig))))))
975 ;; Pytest 4.x are the last versions that support Python 2.
976 (define-public python2-pytest
978 (inherit (strip-python2-variant python-pytest))
979 (name "python2-pytest")
983 (uri (pypi-uri "pytest" version))
986 "0ls3pqr86xgif6bphsb6wrww9r2vc7p7a2naq8zcq8115wwq5yjh"))))
987 (build-system python-build-system)
990 ,@(package-arguments python-pytest)))
992 `(("python-atomicwrites" ,python2-atomicwrites)
993 ("python-attrs" ,python2-attrs-bootstrap)
994 ("python-funcsigs" ,python2-funcsigs)
995 ("python-importlib-metadata" ,python2-importlib-metadata-bootstrap)
996 ("python-more-itertools" ,python2-more-itertools)
997 ("python-packaging" ,python2-packaging-bootstrap)
998 ("python-pathlib2" ,python2-pathlib2)
999 ("python-pluggy" ,python2-pluggy)
1000 ("python-py" ,python2-py)
1001 ("python-six" ,python2-six-bootstrap)
1002 ("python-wcwidth" ,python2-wcwidth)))
1004 `(("bash" ,bash) ;tests require 'compgen'
1005 ("python-hypothesis" ,python2-hypothesis)
1006 ("python-nose" ,python2-nose)
1007 ("python-mock" ,python2-mock)
1008 ("python-pytest" ,python2-pytest-bootstrap)
1009 ("python-setuptools-scm" ,python2-setuptools-scm)))))
1011 (define-public python-pytest-bootstrap
1013 (inherit (strip-python2-variant python-pytest))
1014 (name "python-pytest-bootstrap")
1015 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
1016 (arguments `(#:tests? #f))
1017 (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
1019 (define-public python-pytest-6-bootstrap
1021 (inherit (strip-python2-variant python-pytest-6))
1022 (name "python-pytest-bootstrap")
1023 (arguments `(#:tests? #f))
1025 `(("python-setuptools-scm" ,python-setuptools-scm)
1026 ("python-toml" ,python-toml)))))
1028 (define-public python2-pytest-bootstrap
1032 (name "python2-pytest-bootstrap")
1034 (substitute-keyword-arguments (package-arguments python2-pytest)
1035 ((#:tests? _ #f) #f)))
1037 `(("python-setuptools-scm" ,python2-setuptools-scm)))
1039 `(("python-atomicwrites" ,python2-atomicwrites)
1040 ("python-attrs" ,python2-attrs-bootstrap)
1041 ("python-funcsigs" ,python2-funcsigs-bootstrap)
1042 ("python-importlib-metadata" ,python2-importlib-metadata-bootstrap)
1043 ("python-more-itertools" ,python2-more-itertools)
1044 ("python-packaging" ,python2-packaging-bootstrap)
1045 ("python-pathlib2" ,python2-pathlib2-bootstrap)
1046 ("python-pluggy" ,python2-pluggy-bootstrap)
1047 ("python-py" ,python2-py)
1048 ("python-wcwidth" ,python2-wcwidth))))))
1050 (define-public python-pytest-cov
1052 (name "python-pytest-cov")
1057 (uri (pypi-uri "pytest-cov" version))
1059 (base32 "0avzlk9p4nc44k7lpx9109dybq71xqnggxb9f4hp0l64pbc44ryc"))))
1060 (build-system python-build-system)
1063 (modify-phases %standard-phases
1066 ;; Options taken from tox.ini.
1067 ;; TODO: make "--restructuredtext" tests pass. They currently fail
1068 ;; with "Duplicate implicit target name".
1069 (invoke "python" "./setup.py" "check"
1070 "--strict" "--metadata"))))))
1072 `(("python-coverage" ,python-coverage)
1073 ("python-pytest" ,python-pytest)))
1074 (home-page "https://github.com/pytest-dev/pytest-cov")
1075 (synopsis "Pytest plugin for measuring coverage")
1077 "Pytest-cov produces coverage reports. It supports centralised testing and
1078 distributed testing in both @code{load} and @code{each} modes. It also
1079 supports coverage of subprocesses.")
1080 (license license:expat)))
1082 (define-public python2-pytest-cov
1083 (package-with-python2 python-pytest-cov))
1085 (define-public python-pytest-runner
1087 (name "python-pytest-runner")
1092 (uri (pypi-uri "pytest-runner" version))
1095 "0awll1bva5zy8cspsxcpv7pjcrdf5c6pf56nqn4f74vvmlzfgiwn"))))
1096 (build-system python-build-system)
1098 '(;; FIXME: The test suite requires 'python-flake8' and 'python-black',
1099 ;; but that introduces a circular dependency.
1101 #:phases (modify-phases %standard-phases
1103 (lambda* (#:key tests? #:allow-other-keys)
1105 (invoke "pytest" "-vv")
1106 (format #t "test suite not run~%"))
1109 `(("python-setuptools-scm" ,python-setuptools-scm)))
1110 (home-page "https://github.com/pytest-dev/pytest-runner")
1111 (synopsis "Invoke py.test as a distutils command")
1113 "This package provides a @command{pytest-runner} command that
1114 @file{setup.py} files can use to run tests.")
1115 (license license:expat)))
1117 (define-public python2-pytest-runner
1118 (package-with-python2 python-pytest-runner))
1120 ;; python-bleach 3.1.0 requires this ancient version of pytest-runner.
1121 ;; Remove once no longer needed.
1122 (define-public python-pytest-runner-2
1124 python-pytest-runner
1128 (uri (pypi-uri "pytest-runner" version))
1131 "11ivjj9hfphkv4yfb2g74av4yy86y8gcbf7gbif0p1hcdfnxg3w6"))))))
1133 (define-public python2-pytest-runner-2
1134 (package-with-python2 python-pytest-runner-2))
1136 (define-public python-pytest-lazy-fixture
1138 (name "python-pytest-lazy-fixture")
1143 (uri (pypi-uri "pytest-lazy-fixture" version))
1145 (base32 "1b0hmnsxw4s2wf9pks8dg6dfy5cx3zcbzs8517lfccxsfizhqz8f"))))
1146 (build-system python-build-system)
1149 (modify-phases %standard-phases
1151 (lambda* (#:key inputs outputs #:allow-other-keys)
1152 ;; Make the installed plugin discoverable by Pytest.
1153 (add-installed-pythonpath inputs outputs)
1154 (invoke "pytest" "-vv"))))))
1156 `(("python-pytest" ,python-pytest)))
1157 (home-page "https://github.com/tvorog/pytest-lazy-fixture")
1158 (synopsis "Use fixtures in @code{pytest.mark.parametrize}")
1159 (description "This plugin helps to use fixtures in
1160 @code{pytest.mark.parametrize}.")
1161 (license license:expat)))
1163 (define-public python-pytest-mock
1165 (name "python-pytest-mock")
1170 (uri (pypi-uri "pytest-mock" version))
1173 "1i5mg3ff1qk0wqfcxfz60hwy3q5dskdp36i10ckigkzffg8hc3ad"))))
1174 (build-system python-build-system)
1176 `(("python-setuptools-scm" ,python-setuptools-scm)))
1178 `(("python-pytest" ,python-pytest)))
1179 (home-page "https://github.com/pytest-dev/pytest-mock/")
1180 (synopsis "Thin-wrapper around the mock package for easier use with py.test")
1182 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
1183 around the patching API provided by the @code{mock} package, but with the
1184 benefit of not having to worry about undoing patches at the end of a test.
1185 The mocker fixture has the same API as @code{mock.patch}, supporting the
1187 (properties `((python2-variant . ,(delay python2-pytest-mock))))
1188 (license license:expat)))
1190 (define-public python2-pytest-mock
1191 (let ((base (package-with-python2
1192 (strip-python2-variant python-pytest-mock))))
1193 (package (inherit base)
1195 `(("python2-mock" ,python2-mock)
1196 ,@(package-propagated-inputs base))))))
1198 (define-public python-pytest-xdist
1200 (name "python-pytest-xdist")
1205 (uri (pypi-uri "pytest-xdist" version))
1208 "0wh6pn66nncfs6ay0n863bgyriwsgppn8flx5l7551j1lbqkinc2"))
1209 (modules '((guix build utils)))
1212 ;; Remove pre-compiled .pyc files from source.
1213 (for-each delete-file-recursively
1214 (find-files "." "__pycache__" #:directories? #t))
1215 (for-each delete-file (find-files "." "\\.pyc$"))
1217 (build-system python-build-system)
1219 '(#:tests? #f)) ;FIXME: Some tests are failing.
1221 ;; (modify-phases %standard-phases
1223 ;; (add-after 'install 'check
1224 ;; (lambda* (#:key inputs outputs #:allow-other-keys)
1225 ;; (add-installed-pythonpath inputs outputs)
1226 ;; (zero? (system* "py.test" "-v")))))
1228 `(("python-setuptools-scm" ,python-setuptools-scm)))
1230 `(("python-execnet" ,python-execnet)
1231 ("python-pytest" ,python-pytest)
1232 ("python-py" ,python-py)))
1234 "https://github.com/pytest-dev/pytest-xdist")
1236 "Plugin for py.test with distributed testing and loop-on-failing modes")
1238 "The pytest-xdist plugin extends py.test with some unique test execution
1239 modes: parallelization, running tests in boxed subprocesses, the ability
1240 to run tests repeatedly when failed, and the ability to run tests on multiple
1241 Python interpreters or platforms. It uses rsync to copy the existing
1242 program code to a remote location, executes there, and then syncs the
1244 (license license:expat)))
1246 (define-public python2-pytest-xdist
1247 (package-with-python2 python-pytest-xdist))
1249 (define-public python-pytest-timeout
1251 (name "python-pytest-timeout")
1256 (uri (pypi-uri "pytest-timeout" version))
1259 "13n42azbvs5slvy2n1a9nw17r4qdq10dd68nln3jp925safa3yl0"))))
1260 (build-system python-build-system)
1262 '(#:phases (modify-phases %standard-phases
1264 (lambda* (#:key inputs outputs #:allow-other-keys)
1265 ;; Make the installed plugin discoverable by Pytest.
1266 (add-installed-pythonpath inputs outputs)
1267 (invoke "pytest" "-vv"))))))
1269 `(("python-pytest" ,python-pytest)))
1271 `(("python-pexpect" ,python-pexpect)))
1272 (home-page "http://bitbucket.org/pytest-dev/pytest-timeout/")
1273 (synopsis "Plugin for py.test to abort hanging tests")
1275 "This package provides a py.test plugin that aborts hanging tests after a
1276 timeout has been exceeded.")
1277 (license license:expat)))
1279 (define-public python-pytest-forked
1281 (name "python-pytest-forked")
1286 (uri (pypi-uri "pytest-forked" version))
1289 "000i4q7my2fq4l49n8idx2c812dql97qv6qpm2vhrrn9v6g6j18q"))))
1290 (build-system python-build-system)
1292 `(("python-pytest" ,python-pytest)))
1294 `(("python-setuptools-scm" ,python-setuptools-scm)))
1296 "https://github.com/pytest-dev/pytest-forked")
1298 "Run tests in isolated forked subprocesses")
1300 "Pytest plugin which will run each test in a subprocess and will report if
1301 a test crashed the process.")
1302 (license license:expat)))
1304 (define-public python-scripttest
1306 (name "python-scripttest")
1311 (uri (pypi-uri "scripttest" version))
1314 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
1315 (build-system python-build-system)
1317 `(("python-pytest" ,python-pytest)))
1318 (home-page (string-append "https://web.archive.org/web/20161029233413/"
1319 "http://pythonpaste.org/scripttest/"))
1320 (synopsis "Python library to test command-line scripts")
1321 (description "Scripttest is a Python helper library for testing
1322 interactive command-line applications. With it you can run a script in a
1323 subprocess and see the output as well as any file modifications.")
1324 (license license:expat)))
1326 (define-public python2-scripttest
1327 (package-with-python2 python-scripttest))
1329 (define-public python-testtools-bootstrap
1331 (name "python-testtools-bootstrap")
1336 (uri (pypi-uri "testtools" version))
1339 "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
1340 (patches (search-patches "python-testtools.patch"))))
1341 (build-system python-build-system)
1342 (arguments '(#:tests? #f))
1344 `(("python-extras" ,python-extras)
1345 ("python-fixtures" ,python-fixtures-bootstrap)
1346 ("python-mimeparse" ,python-mimeparse)
1347 ("python-pbr" ,python-pbr-minimal)
1348 ("python-six" ,python-six)
1349 ("python-traceback2" ,python-traceback2)
1350 ("python-unittest2" ,python-unittest2)))
1351 (home-page "https://github.com/testing-cabal/testtools")
1353 "Extensions to the Python standard library unit testing framework")
1355 "This package is only for bootstrapping. Do not use this.")
1356 (license license:psfl)))
1358 (define-public python2-testtools-bootstrap
1359 (package-with-python2 python-testtools-bootstrap))
1361 (define-public python-testtools
1363 (inherit python-testtools-bootstrap)
1364 (name "python-testtools")
1366 `(#:phases (modify-phases %standard-phases
1369 (invoke "python" "-m" "testtools.run"
1370 "testtools.tests.test_suite"))))))
1372 `(("python-extras" ,python-extras)
1373 ("python-fixtures" ,python-fixtures)
1374 ("python-mimeparse" ,python-mimeparse)
1375 ("python-pbr" ,python-pbr)
1376 ("python-six" ,python-six)
1377 ("python-traceback2" ,python-traceback2)
1378 ("python-unittest2" ,python-unittest2)))
1380 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
1382 "Testtools extends the Python standard library unit testing framework to
1383 provide matchers, more debugging information, and cross-Python
1386 (define-public python2-testtools
1387 (package-with-python2 python-testtools))
1389 (define-public python-testscenarios-bootstrap
1391 (name "python-testscenarios-bootstrap")
1396 (uri (pypi-uri "testscenarios" version))
1399 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
1400 (build-system python-build-system)
1402 `(#:phases (modify-phases %standard-phases
1405 (invoke "python" "-m" "testtools.run"
1406 "testscenarios.test_suite"))))))
1408 `(("python-pbr" ,python-pbr-minimal)
1409 ("python-testtools" ,python-testtools-bootstrap)))
1410 (home-page "https://launchpad.net/testscenarios")
1411 (synopsis "Pyunit extension for dependency injection")
1413 "This package is only for bootstrapping. Don't use this.")
1414 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1416 (define-public python2-testscenarios-bootstrap
1417 (package-with-python2 python-testscenarios-bootstrap))
1419 (define-public python-testscenarios
1421 (inherit python-testscenarios-bootstrap)
1422 (name "python-testscenarios")
1424 `(("python-pbr" ,python-pbr)
1425 ("python-testtools" ,python-testtools)))
1427 "Testscenarios provides clean dependency injection for Python unittest
1430 (define-public python2-testscenarios
1431 (package-with-python2 python-testscenarios))
1433 ;; Testresources requires python-pbr at runtime, but pbr needs it for its
1434 ;; own tests. Hence this bootstrap variant.
1435 (define-public python-testresources-bootstrap
1437 (name "python-testresources-bootstrap")
1441 (uri (pypi-uri "testresources" version))
1444 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
1445 (build-system python-build-system)
1446 (arguments '(#:tests? #f))
1448 `(("python-pbr" ,python-pbr-minimal)))
1449 (home-page "https://launchpad.net/testresources")
1451 "Pyunit extension for managing test resources")
1453 "This package is only here for bootstrapping purposes. Use the regular
1454 testresources package instead.")
1455 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1457 (define-public python2-testresources-bootstrap
1458 (package-with-python2 python-testresources-bootstrap))
1460 (define-public python-testresources
1462 (inherit python-testresources-bootstrap)
1463 (name "python-testresources")
1465 `(("python-pbr" ,python-pbr)))
1468 `(("python-fixtures" ,python-fixtures)
1469 ("python-testtols" ,python-testtools)))
1471 "Testresources is an extension to Python's unittest to allow declarative
1472 use of resources by test cases.")))
1474 (define-public python2-testresources
1475 (package-with-python2 python-testresources))
1477 (define-public python-subunit-bootstrap
1479 (name "python-subunit-bootstrap")
1484 (uri (pypi-uri "python-subunit" version))
1487 "0j0ymmnc5nfxi1qzvy59j27viqca7l7xd0y9x29g7yr0h693j804"))))
1488 (build-system python-build-system)
1490 `(("python-extras" ,python-extras)
1491 ("python-testtools" ,python-testtools-bootstrap)))
1493 `(("python-fixtures" ,python-fixtures-bootstrap)
1494 ("python-hypothesis" ,python-hypothesis)
1495 ("python-testscenarios" ,python-testscenarios-bootstrap)))
1496 (home-page "https://launchpad.net/subunit")
1497 (synopsis "Python implementation of the subunit protocol")
1499 "This package is here for bootstrapping purposes only. Use the regular
1500 python-subunit package instead.")
1501 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1503 (define-public python2-subunit-bootstrap
1504 (package-with-python2 python-subunit-bootstrap))
1506 (define-public python-subunit
1508 (inherit python-subunit-bootstrap)
1509 (name "python-subunit")
1511 `(("python-extras" ,python-extras)
1512 ("python-testtools" ,python-testtools)))
1514 `(("python-fixtures" ,python-fixtures)
1515 ("python-hypothesis" ,python-hypothesis)
1516 ("python-testscenarios" ,python-testscenarios)))
1518 "Python-subunit is a Python implementation of the subunit test streaming
1521 (define-public python2-subunit
1522 (package-with-python2 python-subunit))
1524 ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
1525 ;; own tests. Hence this bootstrap variant.
1526 (define-public python-fixtures-bootstrap
1528 (name "python-fixtures-bootstrap")
1532 (uri (pypi-uri "fixtures" version))
1535 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
1536 (build-system python-build-system)
1537 (arguments `(#:tests? #f))
1539 `(("python-pbr-minimal" ,python-pbr-minimal)
1540 ("python-six" ,python-six)))
1541 (home-page "https://launchpad.net/python-fixtures")
1542 (synopsis "Python test fixture library")
1544 "This package is only used for bootstrapping. Use the regular
1545 python-fixtures package instead.")
1546 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1548 (define-public python2-fixtures-bootstrap
1549 (package-with-python2 python-fixtures-bootstrap))
1551 (define-public python-fixtures
1553 (inherit python-fixtures-bootstrap)
1554 (name "python-fixtures")
1557 (modify-phases %standard-phases
1560 (invoke "python" "-m" "testtools.run"
1561 "fixtures.test_suite"))))))
1563 ;; Fixtures uses pbr at runtime to check versions, etc.
1564 `(("python-pbr" ,python-pbr)
1565 ("python-six" ,python-six)))
1567 `(("python-mock" ,python-mock)
1568 ("python-testtools" ,python-testtools-bootstrap)))
1570 "Fixtures provides a way to create reusable state, useful when writing
1573 (define-public python2-fixtures
1574 (package-with-python2 python-fixtures))
1576 (define-public python-testrepository-bootstrap
1578 (name "python-testrepository-bootstrap")
1583 (uri (pypi-uri "testrepository" version))
1586 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1587 (build-system python-build-system)
1588 (arguments '(#:tests? #f))
1590 `(("python-fixtures" ,python-fixtures-bootstrap)
1591 ("python-subunit" ,python-subunit-bootstrap)
1592 ("python-testtools" ,python-testtools-bootstrap)))
1594 `(("python-mimeparse" ,python-mimeparse)))
1595 (home-page "https://launchpad.net/testrepository")
1596 (synopsis "Database for Python test results")
1598 "Bootstrap package for python-testrepository. Don't use this.")
1599 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1601 (define-public python2-testrepository-bootstrap
1602 (package-with-python2 python-testrepository-bootstrap))
1604 (define-public python-testrepository
1606 (inherit python-testrepository-bootstrap)
1607 (name "python-testrepository")
1609 ;; FIXME: Many tests are failing.
1612 `(("python-fixtures" ,python-fixtures)
1613 ("python-subunit" ,python-subunit)
1614 ("python-testtools" ,python-testtools)))
1616 `(("python-mimeparse" ,python-mimeparse)))
1617 (description "Testrepository provides a database of test results which can
1618 be used as part of a developer's workflow to check things such as what tests
1619 have failed since the last commit or what tests are currently failing.")))
1621 (define-public python2-testrepository
1622 (package-with-python2 python-testrepository))
1624 (define-public python-coverage
1626 (name "python-coverage")
1631 (uri (pypi-uri "coverage" version))
1634 "16z8i18msgs8k74n73dj9x49wzkl0vk4vq8k5pl1bsj70y7b4k53"))))
1635 (build-system python-build-system)
1637 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1639 (home-page "https://coverage.readthedocs.io")
1640 (synopsis "Code coverage measurement for Python")
1642 "Coverage measures code coverage, typically during test execution. It
1643 uses the code analysis tools and tracing hooks provided in the Python standard
1644 library to determine which lines are executable, and which have been
1646 (license license:bsd-3)))
1648 (define-public python2-coverage
1649 (package-with-python2 python-coverage))
1651 (define-public python-pytest-asyncio
1653 (name "python-pytest-asyncio")
1658 (uri (pypi-uri "pytest-asyncio" version))
1660 (base32 "1bysy4nii13bm7h345wxf8fxcjhab7l374pqdv7vwv3izl053b4z"))))
1661 (build-system python-build-system)
1663 `(("python-coverage" ,python-coverage)
1664 ("python-async-generator" ,python-async-generator)
1665 ("python-hypothesis" ,python-hypothesis)
1666 ("python-pytest" ,python-pytest)))
1667 (home-page "https://github.com/pytest-dev/pytest-asyncio")
1668 (synopsis "Pytest support for asyncio")
1669 (description "Python asyncio code is usually written in the form of
1670 coroutines, which makes it slightly more difficult to test using normal
1671 testing tools. @code{pytest-asyncio} provides useful fixtures and markers
1672 to make testing async code easier.")
1673 (license license:asl2.0)))
1675 (define-public python-cov-core
1677 (name "python-cov-core")
1682 (uri (pypi-uri "cov-core" version))
1685 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1686 (build-system python-build-system)
1688 `(("python-coverage" ,python-coverage)))
1689 (home-page "https://github.com/schlamar/cov-core")
1690 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
1692 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1693 and @code{nose2-cov}. It is useful for developing coverage plugins for these
1694 testing frameworks.")
1695 (license license:expat)))
1697 (define-public python2-cov-core
1698 (package-with-python2 python-cov-core))
1700 (define-public python-codecov
1702 (name "python-codecov")
1707 (uri (pypi-uri "codecov" version))
1710 "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1711 (build-system python-build-system)
1713 `(("python-unittest2" ,python-unittest2)))
1715 `(("python-coverage" ,python-coverage)
1716 ("python-requests" ,python-requests)))
1717 (home-page "https://github.com/codecov/codecov-python")
1718 (synopsis "Upload code coverage reports to @code{codecov.io}")
1720 "Codecov collects code coverage reports from code written in Python, Java,
1721 C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
1722 (license license:asl2.0)))
1724 (define-public python-testpath
1726 (name "python-testpath")
1732 (url "https://github.com/jupyter/testpath")
1734 (file-name (git-file-name name version))
1737 "0r4iiizjql6ny1ln7ciw7rrbjadz1s9zrf2hl0xkgnh3ypd8936f"))))
1738 (build-system python-build-system)
1740 `(#:tests? #f ; this package does not even have a setup.py
1741 #:modules ((guix build python-build-system)
1745 (modify-phases %standard-phases
1748 (lambda* (#:key inputs outputs #:allow-other-keys)
1749 (let* ((version (last
1750 (string-split (assoc-ref inputs "python") #\-)))
1751 (x.y (string-join (take (string-split version #\.) 2)
1754 (assoc-ref outputs "out")
1755 "/lib/python" x.y "/site-packages/testpath")))
1757 (copy-recursively "testpath" dir))
1759 (home-page "https://github.com/takluyver/testpath")
1760 (synopsis "Test utilities for code working with files and commands")
1762 "Testpath is a collection of utilities for Python code working with files
1763 and commands. It contains functions to check things on the file system, and
1764 tools for mocking system commands and recording calls to those.")
1765 (license license:expat)))
1767 (define-public python2-testpath
1768 (package-with-python2 python-testpath))
1770 (define-public python-testlib
1772 (name "python-testlib")
1777 (uri (pypi-uri "testlib" version ".zip"))
1779 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1780 (build-system python-build-system)
1782 `(("unzip" ,unzip))) ; for unpacking the source
1783 (synopsis "Python micro test suite harness")
1784 (description "A micro unittest suite harness for Python.")
1785 (home-page "https://github.com/trentm/testlib")
1786 (license license:expat)))
1788 (define-public python2-testlib
1789 (package-with-python2 python-testlib))
1791 ;;; The software provided by this package was integrated into pytest 2.8.
1792 (define-public python-pytest-cache
1794 (name "python-pytest-cache")
1798 (uri (pypi-uri "pytest-cache" version))
1801 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1802 (build-system python-build-system)
1804 `(("python-apipkg" ,python-apipkg)
1805 ("python-execnet" ,python-execnet)
1806 ("python-py" ,python-py)
1807 ("python-pytest" ,python-pytest)))
1808 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1809 (description "The pytest-cache plugin provides tools to rerun failures from
1810 the last py.test invocation.")
1811 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1812 (license license:expat)))
1814 (define-public python2-pytest-cache
1815 (package-with-python2 python-pytest-cache))
1817 (define-public python-pytest-localserver
1819 (name "python-pytest-localserver")
1823 (uri (pypi-uri "pytest-localserver" version))
1826 "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
1827 (build-system python-build-system)
1830 (modify-phases %standard-phases
1833 (invoke "py.test" "-v"))))))
1835 `(("python-pytest" ,python-pytest)
1836 ("python-requests" ,python-requests)
1837 ("python-six" ,python-six)))
1839 `(("python-werkzeug" ,python-werkzeug)))
1840 (synopsis "Py.test plugin to test server connections locally")
1841 (description "Pytest-localserver is a plugin for the pytest testing
1842 framework which enables you to test server connections locally.")
1843 (home-page "https://pypi.org/project/pytest-localserver/")
1844 (license license:expat)))
1846 (define-public python-pytest-xprocess
1848 (name "python-pytest-xprocess")
1852 (uri (pypi-uri "pytest-xprocess" version))
1855 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1856 (build-system python-build-system)
1858 `(("python-pytest" ,python-pytest)
1859 ("python-pytest-cache" ,python-pytest-cache)
1860 ("python-psutil" ,python-psutil)))
1861 (synopsis "Pytest plugin to manage external processes across test runs")
1862 (description "Pytest-xprocess is an experimental py.test plugin for managing
1863 processes across test runs.")
1864 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1865 (license license:expat)))
1867 (define-public python-pytest-subtesthack
1869 (name "python-pytest-subtesthack")
1873 (uri (pypi-uri "pytest-subtesthack" version))
1876 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1877 (build-system python-build-system)
1879 `(("python-pytest" ,python-pytest)))
1880 (synopsis "Set-up and tear-down fixtures for unit tests")
1881 (description "This plugin allows you to set up and tear down fixtures within
1882 unit test functions that use @code{py.test}. This is useful for using
1883 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1884 function multiple times, without setting up or tearing down fixture state as is
1885 normally the case.")
1886 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1887 (license license:unlicense)))
1889 (define-public python2-pytest-subtesthack
1890 (package-with-python2 python-pytest-subtesthack))
1892 (define-public python-pytest-sugar
1894 (name "python-pytest-sugar")
1899 (uri (pypi-uri "pytest-sugar" version))
1901 (base32 "1i0hv3h49zvl62jbiyjag84carbrp3zprqzxffdr291nxavvac0n"))))
1902 (build-system python-build-system)
1904 `(("python-packaging" ,python-packaging)
1905 ("python-pytest" ,python-pytest)
1906 ("python-termcolor" ,python-termcolor)))
1907 (home-page "https://pivotfinland.com/pytest-sugar/")
1908 (synopsis "Plugin for pytest that changes the default look and feel")
1910 "@code{pytest-sugar} is a plugin for py.test that changes the default
1911 look and feel of py.test, using a progress bar and showing failures and errors
1913 (license license:bsd-3)))
1915 (define-public python-hypothesis
1917 (name "python-hypothesis")
1921 (uri (pypi-uri "hypothesis" version))
1924 "0zn09bn6hadk4vxl6jy8bkjr5fz8mrhin3z46w7pq5qgbaycr89p"))))
1925 (build-system python-build-system)
1927 ;; XXX: Tests are not distributed with the PyPI archive.
1930 `(("python-attrs" ,python-attrs-bootstrap)
1931 ("python-sortedcontainers" ,python-sortedcontainers)))
1932 (synopsis "Library for property based testing")
1933 (description "Hypothesis is a library for testing your Python code against a
1934 much larger range of examples than you would ever want to write by hand. It’s
1935 based on the Haskell library, Quickcheck, and is designed to integrate
1936 seamlessly into your existing Python unit testing work flow.")
1937 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
1938 (license license:mpl2.0)
1939 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1941 (define-public python-hypothesis-5.23
1943 (inherit python-hypothesis)
1947 (uri (pypi-uri "hypothesis" version))
1950 "0sy1v6nyxg4rjcf3rlr8nalb7wqd9nccpb2lzkchbj5an13ysf1h"))))
1951 (home-page "https://github.com/HypothesisWorks/hypothesis")))
1953 ;; This is the last version of Hypothesis that supports Python 2.
1954 (define-public python2-hypothesis
1955 (let ((hypothesis (package-with-python2
1956 (strip-python2-variant python-hypothesis))))
1957 (package (inherit hypothesis)
1961 (uri (pypi-uri "hypothesis" version))
1964 "183gpxbfcdhdqzlahkji5a71n6lmvgqsbkcb0ihqad51n2j6jhrw"))))
1966 `(("python2-enum34" ,python2-enum34)
1967 ,@(package-propagated-inputs hypothesis))))))
1969 (define-public python-hypothesmith
1971 (name "python-hypothesmith")
1976 (uri (pypi-uri "hypothesmith" version))
1979 "09331sspknv459xcyn1k0lx5flqlc6gmnwp9370pfvg4kg1zmss6"))))
1980 (build-system python-build-system)
1982 `(("python-hypothesis" ,python-hypothesis-5.23)
1983 ("python-lark-parser" ,python-lark-parser)
1984 ("python-libcst" ,python-libcst)))
1985 (home-page "https://github.com/Zac-HD/hypothesmith")
1986 (synopsis "Strategies for generating Python programs")
1988 "This package contains hypothesis strategies for generating Python
1989 programs, something like CSmith, a random generator of C programs.")
1990 (license license:mpl2.0)))
1992 (define-public python-lit
1999 (uri (pypi-uri "lit" version))
2002 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
2003 (build-system python-build-system)
2006 (modify-phases %standard-phases
2009 (invoke "python" "lit.py" "tests"))))))
2012 (home-page "https://llvm.org/")
2013 (synopsis "LLVM Software Testing Tool")
2014 (description "@code{lit} is a portable tool for executing LLVM and Clang
2015 style test suites, summarizing their results, and providing indication of
2017 (license license:ncsa)))
2019 (define-public python2-lit
2020 (package-with-python2 python-lit))
2022 (define-public python-pytest-pep8
2024 (name "python-pytest-pep8")
2028 (uri (pypi-uri "pytest-pep8" version))
2031 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
2032 (build-system python-build-system)
2034 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
2036 `(("python-pytest" ,python-pytest)))
2038 `(("python-pep8" ,python-pep8)))
2039 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
2040 (synopsis "Py.test plugin to check PEP8 requirements")
2041 (description "Pytest plugin for checking PEP8 compliance.")
2042 (license license:expat)))
2044 (define-public python2-pytest-pep8
2045 (package-with-python2 python-pytest-pep8))
2047 (define-public python-pytest-flakes
2049 (name "python-pytest-flakes")
2053 (uri (pypi-uri "pytest-flakes" version))
2056 "0045h3hnrkn2jwr42jgy2j98npx4amwr6wxzi9j0nppaqz33l49p"))))
2057 (build-system python-build-system)
2060 (modify-phases %standard-phases
2062 (add-after 'install 'check
2063 (lambda* (#:key outputs inputs #:allow-other-keys)
2064 ;; It's easier to run tests after install.
2065 ;; Make installed package available for running the tests
2066 (add-installed-pythonpath inputs outputs)
2067 (invoke "py.test" "-vv" "-k" "not test_syntax_error"))))))
2069 `(("python-coverage" ,python-coverage)
2070 ("python-pytest" ,python-pytest)
2071 ("python-pytest-cache" ,python-pytest-cache)
2072 ("python-pytest-pep8" ,python-pytest-pep8)))
2074 `(("python-pyflakes" ,python-pyflakes)))
2075 (home-page "https://github.com/fschulze/pytest-flakes")
2076 (synopsis "Py.test plugin to check source code with pyflakes")
2077 (description "Pytest plugin for checking Python source code with pyflakes.")
2078 (license license:expat)))
2080 (define-public python2-pytest-flakes
2081 (package-with-python2 python-pytest-flakes))
2083 (define-public python2-coverage-test-runner
2085 (name "python2-coverage-test-runner")
2091 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
2092 "coverage-test-runner/snapshot/coverage-test-runner-"
2096 "1kjjb9llckycnfxag8zcvqsn4z1s3dwyw6b1n0avxydihgf30rny"))))
2097 (build-system python-build-system)
2099 `(#:python ,python-2
2101 (modify-phases %standard-phases
2104 (invoke "./testrun"))))))
2106 `(("python2-coverage" ,python2-coverage)))
2107 (home-page "https://liw.fi/coverage-test-runner/")
2108 (synopsis "Python module for running unit tests")
2109 (description "@code{CoverageTestRunner} is a python module for running
2110 unit tests and failing them if the unit test module does not exercise all
2111 statements in the module it tests.")
2112 (license license:gpl3+)))
2114 (define-public python-pylint
2116 (name "python-pylint")
2122 (url "https://github.com/PyCQA/pylint")
2123 (commit (string-append "pylint-" version))))
2124 (file-name (git-file-name name version))
2126 (base32 "04cgbh2z1mygar63plzziyz34yg6bdr4i0g63jp256fgnqwb1bi3"))))
2127 (build-system python-build-system)
2128 ;; FIXME: Tests are failing since version 2.4.3, see:
2129 ;; https://github.com/PyCQA/pylint/issues/3198.
2130 (arguments '(#:tests? #f))
2132 `(("python-pytest" ,python-pytest)
2133 ("python-pytest-runner" ,python-pytest-runner)
2134 ("python-tox" ,python-tox)))
2136 `(("python-astroid" ,python-astroid)
2137 ("python-isort" ,python-isort)
2138 ("python-mccabe" ,python-mccabe)
2139 ("python-six" ,python-six)
2140 ("python-toml" ,python-toml)))
2141 (home-page "https://github.com/PyCQA/pylint")
2142 (synopsis "Python source code analyzer which looks for coding standard
2144 (description "Pylint is a Python source code analyzer which looks
2145 for programming errors, helps enforcing a coding standard and sniffs
2146 for some code smells (as defined in Martin Fowler's Refactoring book).
2148 Pylint has many rules enabled by default, way too much to silence them
2149 all on a minimally sized program. It's highly configurable and handle
2150 pragmas to control it from within your code. Additionally, it is
2151 possible to write plugins to add your own checks.")
2152 (properties `((python2-variant . ,(delay python2-pylint))))
2153 (license license:gpl2+)))
2155 ;; Python2 is not supported anymore by Pylint. See:
2156 ;; https://github.com/PyCQA/pylint/issues/1763.
2157 (define-public python2-pylint
2158 (let ((pylint (package-with-python2
2159 (strip-python2-variant python-pylint))))
2160 (package (inherit pylint)
2166 (url "https://github.com/PyCQA/pylint")
2167 (commit (string-append "pylint-" version))))
2168 (file-name (git-file-name (package-name pylint) version))
2171 "02a89d8a47s7nfiv1ady3j0sg2sbyja3np145brarfp5x9qxz9x2"))))
2173 `(,@(strip-keyword-arguments '(#:tests?) (package-arguments pylint))
2175 (modify-phases %standard-phases
2178 ;; Somehow, tests fail if run from the build directory.
2179 (let ((work "/tmp/work"))
2181 (setenv "PYTHONPATH"
2182 (string-append (getenv "PYTHONPATH") ":" work))
2183 (copy-recursively "." work)
2184 (with-directory-excursion "/tmp"
2185 (invoke "python" "-m" "unittest" "discover"
2186 "-s" (string-append work "/pylint/test")
2187 "-p" "*test_*.py"))))))))
2189 `(("python2-futures" ,python2-futures)
2190 ,@(package-native-inputs pylint)))
2192 `(("python2-backports-functools-lru-cache"
2193 ,python2-backports-functools-lru-cache)
2194 ("python2-configparser" ,python2-configparser)
2195 ,@(package-propagated-inputs pylint))))))
2197 (define-public python-paramunittest
2199 (name "python-paramunittest")
2204 (uri (pypi-uri "ParamUnittest" version))
2207 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
2208 (build-system python-build-system)
2210 "https://github.com/rik0/ParamUnittest")
2212 "Simple extension to have parametrized unit tests")
2214 "This package creates parameterized unit-tests that work with the standard
2215 unittest package. A parameterized test case is automatically converted to multiple test
2216 cases. Since they are TestCase subclasses, they work with other test suites that
2217 recognize TestCases.")
2218 (license license:bsd-2)))
2220 (define-public python2-python-paramunittest
2221 (package-with-python2 python-paramunittest))
2223 (define-public python-pytest-warnings
2225 (name "python-pytest-warnings")
2230 (uri (pypi-uri "pytest-warnings" version))
2233 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
2234 (build-system python-build-system)
2236 `(("pytest" ,python-pytest)))
2237 (home-page "https://github.com/fschulze/pytest-warnings")
2238 (synopsis "Pytest plugin to list Python warnings in pytest report")
2240 "Python-pytest-warnings is a pytest plugin to list Python warnings in
2242 (license license:expat)
2243 (properties `((python2-variant . ,(delay python2-pytest-warnings))
2244 ;; This package is part of pytest as of version 3.1.0.
2245 (superseded . ,python-pytest)))))
2247 (define-public python2-pytest-warnings
2248 (package (inherit (package-with-python2
2249 (strip-python2-variant python-pytest-warnings)))
2250 (properties `((superseded . ,python2-pytest)))))
2252 (define-public python-pytest-capturelog
2254 (name "python-pytest-capturelog")
2259 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
2262 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
2263 (build-system python-build-system)
2265 `(("pytest" ,python-pytest)))
2266 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
2267 (synopsis "Pytest plugin to catch log messages")
2269 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
2270 (license license:expat)))
2272 (define-public python2-pytest-capturelog
2273 (package-with-python2 python-pytest-capturelog))
2275 (define-public python-pytest-catchlog
2277 (name "python-pytest-catchlog")
2282 (uri (pypi-uri "pytest-catchlog" version ".zip"))
2285 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
2286 (build-system python-build-system)
2288 `(("unzip" ,unzip)))
2290 `(("pytest" ,python-pytest)))
2291 (home-page "https://github.com/eisensheng/pytest-catchlog")
2292 (synopsis "Pytest plugin to catch log messages")
2294 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
2295 a fork of pytest-capturelog.")
2296 (license license:expat)))
2298 (define-public python2-pytest-catchlog
2299 (package-with-python2 python-pytest-catchlog))
2301 (define-public python-nosexcover
2303 (name "python-nosexcover")
2307 (uri (pypi-uri "nosexcover" version))
2310 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
2311 (build-system python-build-system)
2313 `(("python-coverage" ,python-coverage)
2314 ("python-nose" ,python-nose)))
2315 (home-page "https://github.com/cmheisel/nose-xcover")
2316 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
2317 (description "Nose-xcover is a companion to the built-in
2318 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
2319 to a file named coverage.xml.
2321 It will honor all the options you pass to the Nose coverage plugin,
2322 especially -cover-package.")
2323 (license license:expat)))
2325 (define-public python2-nosexcover
2326 (package-with-python2 python-nosexcover))
2328 (define-public python-discover
2330 (name "python-discover")
2335 (uri (pypi-uri "discover" version))
2338 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
2339 (build-system python-build-system)
2340 (home-page "https://pypi.org/project/discover/")
2342 "Python test discovery for unittest")
2344 "Discover provides test discovery for unittest, a feature that has been
2345 backported from Python 2.7 for Python 2.4+.")
2346 (license license:bsd-3)))
2348 (define-public python2-discover
2349 (package-with-python2 python-discover))
2351 (define-public behave
2357 (uri (pypi-uri "behave" version))
2360 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))
2361 (patches (search-patches
2362 "behave-skip-a-couple-of-tests.patch"))))
2363 (build-system python-build-system)
2365 `(("python-mock" ,python-mock)
2366 ("python-nose" ,python-nose)
2367 ("python-pathpy" ,python-pathpy)
2368 ("python-pyhamcrest" ,python-pyhamcrest)
2369 ("python-pytest" ,python-pytest)))
2371 `(("python-importlib-metadata" ,python-importlib-metadata)
2372 ("python-six" ,python-six)
2373 ("python-parse" ,python-parse)
2374 ("python-parse-type" ,python-parse-type)))
2376 '(#:test-target "behave_test"
2378 (modify-phases %standard-phases
2379 (add-before 'check 'fix-library-loading
2381 ;; Otherwise, tests fail with no module named 'path'
2382 (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH") ":"
2383 (getcwd) "/tasks/_vendor"))
2385 (home-page "https://github.com/behave/behave")
2386 (synopsis "Python behavior-driven development")
2388 "Behave is a tool for behavior-driven development in python.
2389 Behavior-driven development (or BDD) is an agile software development
2390 technique that encourages collaboration between developers, QA and
2391 non-technical or business participants in a software project. Behave uses
2392 tests written in a natural language style, backed up by Python code.")
2393 (license license:x11)))
2395 (define-public python-behave-web-api
2397 (name "python-behave-web-api")
2402 (uri (pypi-uri "behave-web-api" version))
2405 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
2406 (build-system python-build-system)
2409 (modify-phases %standard-phases
2410 (add-after 'unpack 'fix-dependencies
2412 (substitute* "setup.py"
2413 (("'wheel'") "") ; We don't use it.
2414 (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
2417 `(("behave" ,behave)
2418 ("python-requests" ,python-requests)))
2419 (home-page "https://github.com/jefersondaniel/behave-web-api")
2420 (synopsis "Provides testing for JSON APIs with Behave for Python")
2421 (description "This package provides testing utility modules for testing
2422 JSON APIs with Behave.")
2423 (license license:expat)))
2425 (define-public python2-behave-web-api
2426 (package-with-python2 python-behave-web-api))
2428 (define-public python-rednose
2430 (name "python-rednose")
2435 (uri (pypi-uri "rednose" version))
2438 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
2439 (build-system python-build-system)
2441 `(#:phases (modify-phases %standard-phases
2442 (add-after 'unpack 'patch-setup.py
2444 ;; Six is only required for tests and later versions
2446 (substitute* "setup.py"
2447 (("six==1.10.0") "six"))
2450 `(("python-colorama" ,python-colorama)
2451 ("python-termstyle" ,python-termstyle)))
2453 `(("python-six" ,python-six)
2454 ("python-nose" ,python-nose)))
2455 (home-page "https://github.com/JBKahn/rednose")
2456 (synopsis "Colored output for Python nosetests")
2457 (description "This package provides colored output for the
2458 @command{nosetests} command of the Python Nose unit test framework.")
2459 (license license:bsd-3)))
2461 (define-public python2-rednose
2462 (package-with-python2 python-rednose))
2464 (define-public python-nose-random
2466 (name "python-nose-random")
2472 (url "https://github.com/fzumstein/nose-random")
2474 (file-name (git-file-name name version))
2477 "1dvip61r2frjv35mv6mmfjc07402z73pjbndfp3mhxyjn2zhksw2"))))
2478 (build-system python-build-system)
2480 `(("python-nose" ,python-nose)))
2481 (home-page "https://github.com/fzumstein/nose-random")
2482 (synopsis "Nose plugin to facilitate randomized unit testing with
2484 (description "Python nose-random is designed to facilitate
2485 Monte-Carlo style unit testing. The idea is to improve testing by
2486 running your code against a large number of randomly generated input
2488 (license license:expat)))
2490 (define-public python-nose-randomly
2492 (name "python-nose-randomly")
2497 (uri (pypi-uri "nose-randomly" version))
2499 (base32 "0z662rqhfk4bjmg806mn4frb8nz4gbh7mrddsrhfffp1g4yklj3y"))))
2500 (build-system python-build-system)
2502 `(("python-nose" ,python-nose)
2503 ("python-numpy" ,python-numpy)))
2504 (home-page "https://github.com/adamchainz/nose-randomly")
2506 "Nose plugin to randomly order tests and control random.seed")
2508 "This is a @code{Nose} plugin to randomly order tests which can be quite
2509 powerful in discovering hidden flaws in the tests themselves, while helping to
2510 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
2511 by resetting it to a repeatable number for each test, enabling the tests to
2512 create data based on random numbers and yet remain repeatable.")
2513 (license license:bsd-3)))
2515 (define-public python2-nose-randomly
2516 (package-with-python2 python-nose-randomly))
2518 (define-public python-nose-timer
2520 (name "python-nose-timer")
2525 (uri (pypi-uri "nose-timer" version))
2527 (base32 "05wzkc88vbzw62pqkvhl33211b90kns0lny70b7qw62rcg4flzk4"))))
2528 (build-system python-build-system)
2530 `(("python-nose" ,python-nose)
2531 ("python-termcolor" ,python-termcolor)))
2532 (home-page "https://github.com/mahmoudimus/nose-timer")
2533 (synopsis "Timer plugin for nosetests")
2534 (description "Shows how much time was needed to run individual tests.")
2535 (license license:expat)))
2537 (define-public python2-nose-timer
2538 (package-with-python2 python-nose-timer))
2540 (define-public python-freezegun
2542 (name "python-freezegun")
2547 (uri (pypi-uri "freezegun" version))
2549 (base32 "0al75mk829j1izxi760b7yjnknjihyfhp2mvi5qiyrxb9cpxwqk2"))))
2550 (build-system python-build-system)
2552 `(("python-mock" ,python-mock)
2553 ("python-pytest" ,python-pytest)))
2555 `(("python-six" ,python-six)
2556 ("python-dateutil" ,python-dateutil)))
2559 (modify-phases %standard-phases
2560 ;; The tests are normally executed via `make test`, but the PyPi
2561 ;; package does not include the Makefile.
2564 (invoke "pytest" "-vv"))))))
2565 (home-page "https://github.com/spulec/freezegun")
2566 (synopsis "Test utility for mocking the datetime module")
2568 "FreezeGun is a library that allows your python tests to travel through
2569 time by mocking the datetime module.")
2570 (license license:asl2.0)))
2572 (define-public python2-freezegun
2573 (package-with-python2 python-freezegun))
2575 (define-public python-flexmock
2577 (name "python-flexmock")
2581 (uri (pypi-uri "flexmock" version))
2584 "0b6qw3grhgx58kxlkj7mdma7xdvlj02zabvcf7w2qifnfjwwwcsh"))))
2585 (build-system python-build-system)
2586 (home-page "https://flexmock.readthedocs.org")
2587 (synopsis "Testing library for Python")
2589 "flexmock is a testing library for Python that makes it easy to create
2590 mocks, stubs and fakes.")
2591 (license license:bsd-3)))
2593 (define-public python2-flexmock
2594 (package-with-python2 python-flexmock))
2596 (define-public python-flaky
2598 (name "python-flaky")
2602 (uri (pypi-uri "flaky" version))
2605 "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j"))))
2606 (build-system python-build-system)
2608 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2610 (home-page "https://github.com/box/flaky")
2611 (synopsis "Automatically rerun flaky tests")
2613 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2616 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2617 on components that aren't 100% reliable. With flaky, instead of removing
2618 those tests or marking them to @code{@@skip}, they can be automatically
2620 (license license:asl2.0)))
2622 (define-public python2-flaky
2623 (package-with-python2 python-flaky))
2625 (define-public python-pyhamcrest
2626 ;; The latest release was in 2016 and its test suite does not work with recent
2627 ;; versions of Pytest. Just take the master branch for now, which seems stable.
2628 (let ((commit "25fdc5f00bdf3084335353bc9247253098ec4cf2")
2631 (name "python-pyhamcrest")
2632 (version (git-version "1.9.0" revision commit))
2634 ;; Tests not distributed from pypi release.
2637 (url "https://github.com/hamcrest/PyHamcrest")
2639 (file-name (git-file-name name version))
2642 "1miqmhhi68vaix8sqc1lvpvbm27bacffxh5anm5cbfsvk7g9n6f3"))))
2643 (native-inputs ;all native inputs are for tests
2644 `(("python-pytest-cov" ,python-pytest-cov)
2645 ("python-mock" ,python-mock)
2646 ("python-pytest" ,python-pytest)
2647 ("python-hypothesis" ,python-hypothesis)))
2649 `(("python-six" ,python-six)))
2650 (build-system python-build-system)
2652 `(#:phases (modify-phases %standard-phases
2655 (setenv "PYTHONPATH"
2656 (string-append "build/lib:"
2657 (getenv "PYTHONPATH")))
2658 (invoke "pytest" "-vv"))))))
2659 (home-page "http://hamcrest.org/")
2660 (synopsis "Hamcrest matchers for Python")
2662 "PyHamcrest is a framework for writing matcher objects,
2663 allowing you to declaratively define \"match\" rules.")
2664 (license license:bsd-3))))
2666 (define-public python2-pyhamcrest
2667 (package-with-python2 python-pyhamcrest))
2669 (define-public unittest-cpp
2671 (name "unittest-cpp")
2676 (url "https://github.com/unittest-cpp/unittest-cpp")
2677 (commit (string-append "v" version))))
2678 (file-name (git-file-name name version))
2680 (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
2682 `(#:tests? #f)) ; It's run after build automatically.
2683 (build-system cmake-build-system)
2684 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2685 (synopsis "Lightweight unit testing framework for C++")
2686 (description "UnitTest++ is a lightweight unit testing framework for C++.
2687 It was designed to do test-driven development on a wide variety of platforms.
2688 Simplicity, portability, speed, and small footprint are all very important
2689 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2690 of advanced library and language features, which means it should be easily
2691 portable to just about any platform.")
2692 (license license:expat)))
2694 (define-public libfaketime
2696 (name "libfaketime")
2698 (home-page "https://github.com/wolfcw/libfaketime")
2703 (commit (string-append "v" version))))
2706 "1mfdl82ppgbdvy1ny8mb7xii7p0g7awvn4bn36jb8v4r545slmjc"))
2707 (file-name (git-file-name name version))))
2708 (build-system gnu-build-system)
2710 '(#:phases (modify-phases %standard-phases
2712 (lambda* (#:key outputs #:allow-other-keys)
2713 (let ((out (assoc-ref outputs "out")))
2715 (setenv "PREFIX" out)
2717 ;; XXX: Without this flag, the CLOCK_REALTIME test hangs
2718 ;; indefinitely. See README.packagers for more information.
2719 ;; Try removing this for future versions of libfaketime.
2720 (setenv "FAKETIME_COMPILE_CFLAGS" "-DFORCE_MONOTONIC_FIX")
2723 (add-before 'check 'pre-check
2725 (substitute* "test/functests/test_exclude_mono.sh"
2726 (("/bin/bash") (which "bash")))
2728 ;; Do not fail due to use of 'ftime', which was deprecated in
2729 ;; glibc 2.31. Remove this for later versions of libfaketime.
2730 (setenv "FAKETIME_COMPILE_CFLAGS" "-Wno-deprecated-declarations")
2732 #:test-target "test"))
2734 `(("perl" ,perl))) ;for tests
2735 (synopsis "Fake the system time for single applications")
2737 "The libfaketime library allows users to modify the system time that an
2738 application \"sees\". It is meant to be loaded using the dynamic linker's
2739 @code{LD_PRELOAD} environment variable. The @command{faketime} command
2740 provides a simple way to achieve this.")
2741 (license license:gpl2)))
2743 (define-public umockdev
2749 (uri (string-append "https://github.com/martinpitt/umockdev/"
2750 "releases/download/" version "/"
2751 "umockdev-" version ".tar.xz"))
2754 "0xmi24ckpps32k7hc139psgbsnsf4g106sv4l9m445m46amkxggd"))))
2755 (build-system gnu-build-system)
2758 (modify-phases %standard-phases
2759 (add-after 'unpack 'fix-test
2761 (substitute* "tests/test-umockdev.c"
2766 ("gobject-introspection" ,gobject-introspection)
2767 ("gtk-doc" ,gtk-doc)
2768 ("pkg-config" ,pkg-config)
2776 ("libgudev" ,libgudev)))
2777 (home-page "https://github.com/martinpitt/umockdev/")
2778 (synopsis "Mock hardware devices for creating unit tests")
2779 (description "umockdev mocks hardware devices for creating integration
2780 tests for hardware related libraries and programs. It also provides tools to
2781 record the properties and behaviour of particular devices, and to run a
2782 program or test suite under a test bed with the previously recorded devices
2784 (license license:lgpl2.1+)))
2786 (define-public virtest
2787 ;; No releases yet, so we take the commit that "vc" expects.
2788 (let ((commit "f7d03ef39fceba168745bd29e1b20af6e7971e04")
2792 (version (git-version "0.0" revision commit))
2793 (home-page "https://github.com/mattkretz/virtest")
2796 (uri (git-reference (url home-page) (commit commit)))
2797 (file-name (git-file-name name version))
2800 "07pjyb0mk7y2w1dg1bhl26nb7416xa1mw16ifj6mmps5y6aq054l"))))
2801 (build-system cmake-build-system)
2803 `(#:phases (modify-phases %standard-phases
2804 (add-after 'unpack 'adjust-install-directory
2806 ;; Vc is the only consumer of this library, and expects
2807 ;; to find it in "virtest/vir/" instead of "vir/vir/".
2808 (substitute* "CMakeLists.txt"
2809 (("DESTINATION include/vir")
2810 "DESTINATION include/virtest"))
2812 (synopsis "Header-only test framework")
2814 "@code{virtest} is a small header-only test framework for C++. It
2815 grew out of the @dfn{Vc} project.")
2816 (license license:bsd-3))))
2818 (define-public python-pyfakefs
2820 (name "python-pyfakefs")
2824 ;; We use the PyPI URL because there is no proper release
2825 ;; available from GitHub. The GitHub project only provides
2826 ;; autogenerated tarballs, which are known to change in place.
2827 (uri (pypi-uri "pyfakefs" version))
2830 "1cp2yw96fa2qkgi39xa3nlr3inf8wb5rgh9kdq53256ca2r8pdhy"))
2831 (patches (search-patches
2832 "python-pyfakefs-remove-bad-test.patch"))
2833 (file-name (string-append name "-" version ".tar.gz"))))
2836 (modify-phases %standard-phases
2837 ;; The default test suite does not run these extra tests.
2838 (add-after 'check 'check-pytest-plugin
2841 "python" "-m" "pytest"
2842 "pyfakefs/pytest_tests/pytest_plugin_test.py")
2845 `(("python-pytest" ,python-pytest)))
2846 (build-system python-build-system)
2847 ;; Guix lint doesn't like that this is a permanent redirect to the GitHub
2848 ;; page, but the pyfakefs documentation asks us to use this specific URL
2849 ;; when linking to the project. Honor their request.
2850 (home-page "http://pyfakefs.org/")
2851 ;; TRANSLATORS: In the synopsis, "Mock" is a verb.
2852 (synopsis "Mock file system interactions in tests")
2854 "This package provides a Python library intended for use in automated
2855 tests. One difficulty when testing software is that the code under test might
2856 need to read or write to files in the local file system. If the file system
2857 is not set up in just the right way, it might cause a spurious error during
2858 the test. The pyfakefs library provides a solution to problems like this by
2859 mocking file system interactions. In other words, it arranges for the code
2860 under test to interact with a fake file system instead of the real file
2861 system. The code under test requires no modification to work with pyfakefs.")
2862 (license license:asl2.0)))
2864 (define-public python2-pyfakefs
2865 (package-with-python2 python-pyfakefs))
2867 ;; This minimal variant is used to avoid a circular dependency between
2868 ;; python2-importlib-metadata, which requires pyfakefs for its tests, and
2869 ;; python2-pytest, which requires python2-importlib-metadata.
2870 (define-public python2-pyfakefs-bootstrap
2873 (inherit python2-pyfakefs)
2874 (name "python2-pyfakefs-bootstrap")
2877 `(#:python ,python-2
2880 (define-public python-aiounittest
2882 (name "python-aiounittest")
2887 (uri (pypi-uri "aiounittest" version))
2890 "1q4bhmi80smaa1lknvdna0sx3915naczlfna1fp435nf6cjyrjl1"))))
2891 (build-system python-build-system)
2893 `(("python-coverage" ,python-coverage)
2894 ("python-nose" ,python-nose)))
2896 "https://github.com/kwarunek/aiounittest")
2897 (synopsis "Test asyncio code more easily")
2898 (description "Aiounittest is a library that helps write tests using
2899 asynchronous code in Python (asyncio).")
2900 (license license:expat)))