1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
3 ;;; Copyright © 2014 David Thompson <davet@gnu.org>
4 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
5 ;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
6 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
7 ;;; Copyright © 2015, 2017 Cyril Roelandt <tipecaml@gmail.com>
8 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
9 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
10 ;;; Copyright © 2015, 2016, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
11 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
12 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
13 ;;; Copyright © 2016, 2017 Danny Milosavljevic <dannym+a@scratchpost.org>
14 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
15 ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
16 ;;; Copyright © 2016 Troy Sankey <sankeytms@gmail.com>
17 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
18 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
19 ;;; Copyright © 2016–2021 Tobias Geerinckx-Rice <me@tobias.gr>
20 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
21 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
22 ;;; Copyright © 2017, 2018 Arun Isaac <arunisaac@systemreboot.net>
23 ;;; Copyright © 2017 Frederick M. Muriithi <fredmanglis@gmail.com>
24 ;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
25 ;;; Copyright © 2017, 2019 Kei Kebreau <kkebreau@posteo.net>
26 ;;; Copyright © 2017 Nikita <nikita@n0.is>
27 ;;; Copyright © 2015, 2017, 2018, 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
28 ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Marius Bakke <mbakke@fastmail.com>
29 ;;; Copyright © 2017, 2018, 2020 Ludovic Courtès <ludo@gnu.org>
30 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
31 ;;; Copyright © 2019, 2021 Pierre Langlois <pierre.langlois@gmx.com>
32 ;;; Copyright © 2019 Chris Marusich <cmmarusich@gmail.com>
33 ;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org>
34 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
35 ;;; Copyright © 2020 Josh Marshall <joshua.r.marshall.1991@gmail.com>
36 ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
37 ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
38 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
39 ;;; Copyright © 2021 Hugo Lecomte <hugo.lecomte@inria.fr>
41 ;;; This file is part of GNU Guix.
43 ;;; GNU Guix is free software; you can redistribute it and/or modify it
44 ;;; under the terms of the GNU General Public License as published by
45 ;;; the Free Software Foundation; either version 3 of the License, or (at
46 ;;; your option) any later version.
48 ;;; GNU Guix is distributed in the hope that it will be useful, but
49 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
50 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51 ;;; GNU General Public License for more details.
53 ;;; You should have received a copy of the GNU General Public License
54 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
56 (define-module (gnu packages check)
57 #:use-module (gnu packages)
58 #:use-module (gnu packages autotools)
59 #:use-module (gnu packages base)
60 #:use-module (gnu packages bash)
61 #:use-module (gnu packages compression)
62 #:use-module (gnu packages linux)
63 #:use-module (gnu packages llvm)
64 #:use-module (gnu packages glib)
65 #:use-module (gnu packages gnome)
66 #:use-module (gnu packages golang)
67 #:use-module (gnu packages gtk)
68 #:use-module (gnu packages perl)
69 #:use-module (gnu packages pkg-config)
70 #:use-module (gnu packages python)
71 #:use-module (gnu packages python-build)
72 #:use-module (gnu packages python-web)
73 #:use-module (gnu packages python-xyz)
74 #:use-module (gnu packages time)
75 #:use-module (gnu packages xml)
76 #:use-module (guix utils)
77 #:use-module ((guix licenses) #:prefix license:)
78 #:use-module (guix packages)
79 #:use-module (guix download)
80 #:use-module (guix git-download)
81 #:use-module (guix build-system cmake)
82 #:use-module (guix build-system glib-or-gtk)
83 #:use-module (guix build-system gnu)
84 #:use-module (guix build-system go)
85 #:use-module (guix build-system meson)
86 #:use-module (guix build-system python)
87 #:use-module (guix build-system trivial)
88 #:use-module (srfi srfi-1))
90 (define-public pedansee
98 (string-append "https://www.flyn.org/projects/"
99 name "/" name "-" version ".tar.gz"))
101 (base32 "0lsg791x6n95pxg6vif8qfc46nqcamhjq3g0dl5xqf6imy7n3acd"))))
102 (build-system glib-or-gtk-build-system)
105 ("pkg-config" ,pkg-config)
106 ("python" ,python-wrapper)))
109 (synopsis "Code checker for C")
110 (description "Pedansee checks C source files for compliance with a particular
111 programming style. The style is currently defined by the pedansee source code
112 in the form of functions which walk each source file’s syntax tree. You can
113 modify some aspects of this style through the use of regular expressions.")
114 (home-page "https://www.flyn.org/projects/pedansee/")
115 (license license:gpl3+)))
117 (define-public mutest
126 (url "https://github.com/ebassi/mutest")
128 (file-name (git-file-name name version))
130 (base32 "0gdqwq6fvk06wld4rhnw5752hahrvhd69zrci045x25rwx90x26q"))))
131 (build-system meson-build-system)
132 (synopsis "Small C testing library")
133 (description "Mutest aims to be a small unit testing library for C projects,
134 with an API heavily modelled on high level Behavior-Driver Development frameworks
135 like Jasmine or Mocha.")
136 (home-page "https://ebassi.github.io/mutest/mutest.md.html")
137 (license license:expat)))
146 (uri (string-append "https://github.com/libcheck/check/releases/download/"
147 version "/check-" version ".tar.gz"))
150 "02m25y9m46pb6n46s51av62kpd936lkfv3b13kfpckgvmh5lxpm8"))))
151 (build-system gnu-build-system)
152 (home-page "https://libcheck.github.io/check/")
153 (synopsis "Unit test framework for C")
155 "Check is a unit testing framework for C. It features a simple
156 interface for defining unit tests, putting little in the way of the
157 developer. Tests are run in a separate address space, so Check can
158 catch both assertion failures and code errors that cause segmentation
159 faults or other signals. The output from unit tests can be used within
160 source code editors and IDEs.")
161 (license license:lgpl2.1+)))
163 ;; Some packages require older versions. Removed once no longer needed.
164 (define-public check-0.14
170 (uri (string-append "https://github.com/libcheck/check/releases"
171 "/download/" version "/check-" version ".tar.gz"))
174 "02zkfiyklckmivrfvdsrlzvzphkdsgjrz3igncw05dv5pshhq3xx"))))))
176 (define-public check-0.12
182 (uri (string-append "https://github.com/libcheck/check/releases"
183 "/download/" version "/check-" version ".tar.gz"))
186 "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6"))))))
188 (define-public clitest
192 (home-page "https://github.com/aureliojargas/clitest")
197 (commit (string-append "v" version))))
198 (file-name (git-file-name name version))
201 "0zw5wra9hc717srmcar1wm4i34kyj8c49ny4bb7y3nrvkjp2pdb5"))))
202 (build-system gnu-build-system)
205 (modify-phases %standard-phases
206 ;; This package is distributed as a single shell script and comes
207 ;; without a proper build system.
212 (substitute* "test.md"
213 ;; One test looks for an error from grep in the form "grep: foo",
214 ;; but our grep returns the absolute file name on errors. Adjust
215 ;; the test to cope with that.
216 (("sed 's/\\^e\\*grep: \\.\\*/")
217 "sed 's/.*e*grep: .*/"))
219 (setenv "HOME" "/tmp")
220 (invoke "./clitest" "test.md")))
222 (lambda* (#:key outputs #:allow-other-keys)
223 (let ((out (assoc-ref outputs "out")))
224 (install-file "clitest" (string-append out "/bin"))
225 (install-file "README.md"
226 (string-append out "/share/doc/clitest-" ,version))
229 `(("perl" ,perl))) ;for tests
230 (synopsis "Command line test tool")
232 "@command{clitest} is a portable shell script that performs automatic
233 testing of Unix command lines.")
234 (license license:expat)))
243 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
244 version "/CUnit-" version ".tar.bz2"))
247 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
248 (build-system gnu-build-system)
249 (arguments '(#:phases
250 (modify-phases %standard-phases
251 ;; XXX: The "bootstrap" phase detects the "bootstrap"
252 ;; script, but fails to execute it, so we bootstrap
255 (lambda _ (invoke "autoreconf" "-vfi"))))))
257 `(("automake" ,automake)
258 ("autoconf" ,autoconf)
259 ("libtool" ,libtool)))
260 (home-page "http://cunit.sourceforge.net/")
261 (synopsis "Automated testing framework for C")
263 "CUnit is a lightweight system for writing, administering, and running
264 unit tests in C. It provides C programmers with basic testing functionality
265 with a flexible variety of user interfaces.")
266 (license license:gpl2+)))
268 (define-public cppunit
274 (uri (string-append "http://dev-www.libreoffice.org/src/"
275 name "-" version ".tar.gz"))
278 "19qpqzy66bq76wcyadmi3zahk5v1ll2kig1nvg96zx9padkcdic9"))))
279 ;; Explicitly link with libdl. This is expected to be done by packages
280 ;; relying on cppunit for their tests. However, not all of them do.
281 ;; If we added the linker flag to such packages, we would pollute all
282 ;; binaries, not only those used for testing.
284 `(#:make-flags '("LDFLAGS=-ldl")))
285 (build-system gnu-build-system)
286 (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
287 (synopsis "Unit testing framework for C++")
288 (description "CppUnit is the C++ port of the famous JUnit framework for
289 unit testing. Test output is in XML for automatic testing and GUI based for
291 (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
293 (define-public shunit2
300 (url "https://github.com/kward/shunit2")
301 (commit (string-append "v" version))))
302 (file-name (git-file-name name version))
305 "08vs0jjl3pfh100sjlw31x4638xj7fghr0j2g1zfikba8n1f9491"))))
306 (build-system gnu-build-system)
309 (modify-phases %standard-phases
310 (delete 'configure) ; no configure script
312 (add-after 'patch-source-shebangs 'patch-more-shebangs
314 (substitute* "shunit2"
315 (("#! /bin/sh") (string-append "#! " (which "sh")))
316 (("/usr/bin/od") (which "od")))
317 (substitute* "test_runner"
318 (("/bin/sh") (which "sh"))
319 (("/bin/bash") (which "bash")))
322 (lambda* (#:key tests? #:allow-other-keys)
324 ;; This test is buggy in the build container.
325 (delete-file "shunit2_misc_test.sh")
326 (invoke "sh" "test_runner"))
329 (lambda* (#:key outputs #:allow-other-keys)
330 (install-file "shunit2"
331 (string-append (assoc-ref outputs "out")
334 (home-page "https://github.com/kward/shunit2")
335 (synopsis "@code{xUnit} based unit testing for Unix shell scripts")
336 (description "@code{shUnit2} was originally developed to provide a
337 consistent testing solution for @code{log4sh}, a shell based logging framework
338 similar to @code{log4j}. It is designed to work in a similar manner to JUnit,
340 (license license:asl2.0)))
342 ;; When dependent packages upgraded to use newer version of catch, this one should
344 (define-public catch-framework
347 (version "1.3.5") ;Sub-minor is the build number
351 (url "https://github.com/philsquared/Catch")
353 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
354 (file-name (string-append name "-" version))
357 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
358 (build-system trivial-build-system)
360 `(#:modules ((guix build utils))
362 (use-modules (guix build utils))
363 (let* ((source (assoc-ref %build-inputs "source"))
364 (output (assoc-ref %outputs "out"))
365 (incdir (string-append output "/include"))
366 (docdir (string-append output "/share/doc/catch-"
368 (for-each mkdir-p (list incdir docdir))
369 (install-file (string-append source
370 "/single_include/catch.hpp")
372 (copy-recursively (string-append source "/docs")
375 (home-page "http://catch-lib.net/")
376 (synopsis "Automated test framework for C++ and Objective-C")
378 "Catch stands for C++ Automated Test Cases in Headers and is a
379 multi-paradigm automated test framework for C++ and Objective-C.")
380 (license license:boost1.0)))
382 (define-public catch-framework2-1
386 (home-page "https://github.com/catchorg/Catch2")
390 (url "https://github.com/catchorg/Catch2")
391 (commit (string-append "v" version))))
392 (file-name (git-file-name name version))
395 "1gdp5wm8khn02g2miz381llw3191k7309qj8s3jd6sasj01rhf23"))))
396 (build-system cmake-build-system)
397 (synopsis "Automated test framework for C++ and Objective-C")
398 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
399 a multi-paradigm automated test framework for C++ and Objective-C.")
400 (license license:boost1.0)))
402 (define-public catch-framework2
406 (home-page "https://github.com/catchorg/Catch2")
410 (url "https://github.com/catchorg/Catch2")
411 (commit (string-append "v" version))))
412 (file-name (git-file-name name version))
415 "100r0kmra8jmra2hv92lzvwcmphpaiccwvq3lpdsa5b7hailhach"))))
416 (build-system cmake-build-system)
418 `(("python" ,python-wrapper)))
419 (synopsis "Automated test framework for C++ and Objective-C")
420 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
421 a multi-paradigm automated test framework for C++ and Objective-C.")
422 (license license:boost1.0)))
424 (define-public cmdtest
427 ;; Use the latest commit (from 2019) in order to get Python 3 support.
428 (version "0.32-14-gcdfe14e")
432 (url "git://git.liw.fi/cmdtest/")
434 (file-name (git-file-name name version))
437 "1yhcwsqcpckkq5kw3h07k0xg6infyiyzq9ni3nqphrzxis7hxjf1"))))
438 (build-system python-build-system)
439 (arguments `(#:tests? #f)) ;requires Python 2!
441 `(("python-coverage-test-runner" ,python-coverage-test-runner)
444 `(("python-cliapp" ,python-cliapp)
445 ("python-markdown" ,python-markdown)
446 ("python-ttystatus" ,python-ttystatus)))
447 (home-page "https://liw.fi/cmdtest/")
448 (synopsis "Black box Unix program tester")
450 "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
451 given a command line and input files, and the expected output, and it verifies
452 that the command line produces the expected output. If not, it reports a
453 problem, and shows the differences.")
454 (license license:gpl3+)))
456 (define-public cmocka
462 (uri (string-append "https://cmocka.org/files/"
463 (version-major+minor version) "/cmocka-"
467 "1dm8pdvkyfa8dsbz9bpq7wwgixjij4sii9bbn5sgvqjm5ljdik7h"))))
468 (build-system cmake-build-system)
470 `(#:tests? #f)) ; no test target
471 (home-page "https://cmocka.org/")
472 (synopsis "Unit testing framework for C")
473 (description "Cmocka is a unit testing framework for C with support for
474 mock objects. It only requires the standard C library, and works with
475 different compilers. Cmocka supports several different message output formats
476 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
478 (license license:asl2.0)))
480 (define-public cppcheck
487 (url "https://github.com/danmar/cppcheck")
489 (file-name (git-file-name name version))
491 (base32 "03ic5mig3ryzkf85r95ryagf84s7y5nd6sqr915l3zj30apnifvz"))))
492 (build-system cmake-build-system)
494 '(#:configure-flags '("-DBUILD_TESTS=ON")))
495 (home-page "http://cppcheck.sourceforge.net")
496 (synopsis "Static C/C++ code analyzer")
497 (description "Cppcheck is a static code analyzer for C and C++. Unlike
498 C/C++ compilers and many other analysis tools it does not detect syntax errors
499 in the code. Cppcheck primarily detects the types of bugs that the compilers
500 normally do not detect. The goal is to detect only real errors in the code
501 (i.e. have zero false positives).")
502 (license license:gpl3+)))
504 (define-public cxxtest
510 (uri (string-append "mirror://sourceforge/cxxtest/cxxtest/"
511 version "/cxxtest-" version ".tar.gz"))
514 "1n7pbj4z9ivx005hqvivj9ddhq8awynzg6jishfbypf6j7ply58w"))))
515 (build-system python-build-system)
518 (modify-phases %standard-phases
519 (add-after 'unpack 'chdir-to-source
523 (add-after 'install 'install-headers
524 (lambda* (#:key outputs #:allow-other-keys)
525 (let* ((out (assoc-ref outputs "out"))
526 (include-dir (string-append out "/include/cxxtest")))
527 (for-each (lambda (header-file)
528 (install-file header-file include-dir))
529 (find-files "../cxxtest"))
531 (add-after 'install 'install-doc
532 (lambda* (#:key outputs #:allow-other-keys)
533 (let* ((out (assoc-ref outputs "out"))
534 (doc-dir (string-append out "/share/doc/cxxtest")))
535 (install-file "../README" doc-dir)
536 (install-file "../doc/guide.txt" doc-dir)
537 (copy-recursively "../sample" (string-append doc-dir "/sample"))
540 `(("python-ply" ,python-ply)))
541 (home-page "https://cxxtest.com/")
542 (synopsis "Unit testing framework for C++")
543 (description "CxxTest is a unit testing framework for C++ that is similar
544 in spirit to JUnit, CppUnit, and xUnit. CxxTest does not require precompiling
545 a CxxTest testing library, it employs no advanced features of C++ (e.g. RTTI)
546 and it supports a very flexible form of test discovery.")
547 (license license:lgpl3+)))
549 (define-public doctest
553 (home-page "https://github.com/onqtam/doctest")
556 (uri (git-reference (url home-page) (commit version)))
557 (file-name (git-file-name name version))
560 "14m3q6d96zg6d99x1152jkly50gdjrn5ylrbhax53pfgfzzc5yqx"))))
561 (build-system cmake-build-system)
562 (synopsis "C++ test framework")
564 "doctest is a single-header testing framework for C++11 and later. It
565 has been designed to be fast, light and unintrusive.")
566 (license license:expat)))
568 (define-public go-gopkg.in-check.v1
569 (let ((commit "788fd78401277ebd861206a03c884797c6ec5541")
572 (name "go-gopkg.in-check.v1")
573 (version (git-version "0.0.0" revision commit))
577 (url "https://github.com/go-check/check")
579 (file-name (git-file-name name version))
582 "0v3bim0j375z81zrpr5qv42knqs0y2qv2vkjiqi5axvb78slki1a"))))
583 (build-system go-build-system)
585 '(#:import-path "gopkg.in/check.v1"))
587 `(("go-github-com-kr-pretty" ,go-github-com-kr-pretty)))
588 (synopsis "Rich testing extension for Go's testing package")
590 "@code{check} is a rich testing extension for Go's testing package.")
591 (home-page "https://github.com/go-check/check")
592 (license license:bsd-2))))
594 (define-public go-github.com-smartystreets-gunit
596 (name "go-github.com-smartystreets-gunit")
601 (url "https://github.com/smartystreets/gunit")
603 (file-name (git-file-name name version))
606 "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
607 (build-system go-build-system)
609 '(;; TODO: This package depends on go-github.com-smartystreets-assertions
610 ;; for running the tests, but go-github.com-smartystreets-assertions
611 ;; depends on this package, so break this loop by not running the tests
614 #:import-path "github.com/smartystreets/gunit"))
615 (synopsis "Testing tool for Go, in the style of xUnit")
617 "@code{gunit} allows the test author to use a struct as the scope for a
618 group of related test cases, in the style of xUnit fixtures. This makes
619 extraction of setup/teardown behavior (as well as invoking the system under
620 test) much simpler.")
621 (home-page "https://github.com/smartystreets/gunit")
622 (license license:expat)))
624 (define-public go-github.com-smartystreets-assertions
626 (name "go-github.com-smartystreets-assertions")
631 (url "https://github.com/smartystreets/assertions")
633 (file-name (git-file-name name version))
636 "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
637 (build-system go-build-system)
639 '(#:import-path "github.com/smartystreets/assertions"))
641 `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
642 (synopsis "Assertions for testing with Go")
644 "The @code{assertions} package provides convenient assertion functions
645 for writing tests in Go.")
646 (home-page "https://github.com/smartystreets/assertions")
647 (license license:expat)))
649 (define-public go-github.com-smartystreets-goconvey
651 (name "go-github.com-smartystreets-goconvey")
656 (url "https://github.com/smartystreets/goconvey")
658 (file-name (git-file-name name version))
661 "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
662 (build-system go-build-system)
664 '(#:import-path "github.com/smartystreets/goconvey"))
666 `(("go-github.com-jtolds-gls" ,go-github.com-jtolds-gls)
667 ("go-github.com-smartystreets-assertions" ,go-github.com-smartystreets-assertions)))
668 (synopsis "Go testing tool with both a web and terminal user interface")
670 "GoConvey is a testing tool for Go. It integrates with go test, can show
671 test coverage and has a web user interface that will refresh automatically.")
672 (home-page "https://github.com/smartystreets/goconvey")
673 (license license:expat)))
675 (define-public googletest
683 (url "https://github.com/google/googletest")
684 (commit (string-append "release-" version))))
685 (file-name (git-file-name name version))
687 (base32 "1zbmab9295scgg4z2vclgfgjchfjailjnvzc6f5x9jvlsdi3dpwz"))))
688 (build-system cmake-build-system)
690 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
692 `(("python" ,python-wrapper)))
693 (home-page "https://github.com/google/googletest/")
694 (synopsis "Test discovery and XUnit test framework")
695 (description "Google Test features an XUnit test framework, automated test
696 discovery, death tests, assertions, parameterized tests and XML test report
698 (license license:bsd-3)))
700 (define-public googletest-1.8
707 (url "https://github.com/google/googletest")
708 (commit (string-append "release-" version))))
709 (file-name (git-file-name "googletest" version))
712 "0270msj6n7mggh4xqqjp54kswbl7mkcc8px1p5dqdpmw5ngh9fzk"))))))
714 (define-public cpputest
721 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
722 version "/cpputest-" version ".tar.gz"))
725 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
726 (build-system gnu-build-system)
728 `(("googletest" ,googletest)))
729 (home-page "https://cpputest.github.io/")
730 (synopsis "Unit testing and mocking framework for C/C++")
732 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
733 C++ but is used in C and C++ projects and frequently used in embedded systems
734 but it works for any C/C++ project.")
735 (license license:bsd-3)))
737 (define-public python-parameterized
739 (name "python-parameterized")
744 (uri (pypi-uri "parameterized" version))
746 (base32 "1444fdz5bj0k10nmhxv0bv2gfrfisi7hfzqdndb0pvhf4g3qq3qr"))))
747 (build-system python-build-system)
749 '(#:phases (modify-phases %standard-phases
751 (lambda* (#:key tests? #:allow-other-keys)
753 (invoke "nosetests" "-v")
754 (format #t "test suite not run~%"))
757 `(("python-mock" ,python-mock)
758 ("python-nose" ,python-nose)))
759 (home-page "https://github.com/wolever/parameterized")
760 (synopsis "Parameterized testing with any Python test framework")
762 "Parameterized is a Python library that aims to fix parameterized testing
763 for every Python test framework. It supports nose, py.test, and unittest.")
764 (properties `((python2-variant . ,(delay python2-parameterized))))
765 (license license:bsd-2)))
767 (define-public python2-parameterized
768 (let ((base (package-with-python2 (strip-python2-variant
769 python-parameterized))))
774 (inherit (package-source base))
775 (patches (search-patches "python2-parameterized-docstring-test.patch")))))))
777 (define-public python-minimock
779 (name "python-minimock")
784 (uri (pypi-uri "MiniMock" version))
787 "0k2sxb1ibnyg05iblz7zhbv825f1zk9906rab7883iqgvzmdzpsz"))))
788 (build-system python-build-system)
789 (home-page "https://pypi.org/project/MiniMock")
790 (synopsis "Simple Python library for using mock objects")
791 (description "MiniMock is a simple library for building mock objects with
793 (license license:expat)))
795 (define-public python2-minimock
796 (package-with-python2 python-minimock))
798 (define-public python-mock
805 (uri (pypi-uri "mock" version))
808 "1hrp6j0yrx2xzylfv02qa8kph661m6yq4p0mc8fnimch9j4psrc3"))))
810 `(("python-six" ,python-six)))
811 (build-system python-build-system)
813 ;; FIXME: Tests require "pytest", which depends on this package.
815 (home-page "https://github.com/testing-cabal/mock")
816 (synopsis "Python mocking and patching library for testing")
818 "Mock is a library for testing in Python. It allows you to replace parts
819 of your system under test with mock objects and make assertions about how they
821 (properties `((python2-variant . ,(delay python2-mock))))
822 (license license:expat)))
824 (define-public python2-mock
825 (let ((base (package-with-python2
826 (strip-python2-variant python-mock))))
827 (package/inherit base
829 `(("python2-functools32" ,python2-functools32)
830 ("python2-funcsigs" ,python2-funcsigs)
831 ,@(package-propagated-inputs base))))))
833 (define-public python-nose
840 (uri (pypi-uri "nose" version))
843 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
844 (build-system python-build-system)
846 '(#:tests? #f)) ; FIXME: test suite fails
847 (home-page "http://readthedocs.org/docs/nose/")
848 (synopsis "Python testing library")
850 "Nose extends the unittest library to make testing easier.")
851 (license license:lgpl2.0+)))
853 (define-public python2-nose
854 (package-with-python2 python-nose))
856 (define-public python-nose2
858 (name "python-nose2")
863 (uri (pypi-uri "nose2" version))
866 "0pmbb6nk31yhgh4zkcblzxsznml7f7pf5q1ihgrwvbxv4mwzfql7"))))
867 (build-system python-build-system)
868 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
870 `(("python-cov-core" ,python-cov-core)
871 ("python-pytest-cov" ,python-pytest-cov)
872 ("python-six" ,python-six)))
873 (home-page "https://github.com/nose-devs/nose2")
874 (synopsis "Next generation of nicer testing for Python")
876 "Nose2 is the next generation of nicer testing for Python, based on the
877 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
878 better plugin api, being easier for users to configure, and simplifying internal
879 interfaces and processes.")
880 (license license:bsd-2)))
882 (define-public python2-nose2
883 (package-with-python2 python-nose2))
885 (define-public python-unittest2
887 (name "python-unittest2")
892 (uri (pypi-uri "unittest2" version))
894 (search-patches "python-unittest2-python3-compat.patch"
895 "python-unittest2-remove-argparse.patch"))
898 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
899 (build-system python-build-system)
902 (modify-phases %standard-phases
905 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
907 `(("python-six" ,python-six)
908 ("python-traceback2" ,python-traceback2)))
909 (home-page "https://pypi.org/project/unittest2/")
910 (synopsis "Python unit testing library")
912 "Unittest2 is a replacement for the unittest module in the Python
914 (license license:psfl)))
916 (define-public python2-unittest2
917 (package-with-python2 python-unittest2))
919 (define-public python-pytest
921 (name "python-pytest")
926 (uri (pypi-uri "pytest" version))
929 "139i9cjhrv5aici3skq8iihvfb3lq0d8xb5j7qycr2hlk8cfjpqd"))))
930 (build-system python-build-system)
933 (modify-phases %standard-phases
935 (lambda* (#:key (tests? #t) #:allow-other-keys)
937 (invoke "pytest" "-vv" "-k"
939 ;; These tests involve the /usr directory, and fails.
940 "not test_remove_dir_prefix"
941 " and not test_argcomplete"
942 ;; This test tries to override PYTHONPATH, and
943 ;; subsequently fails to locate the test libraries.
944 " and not test_collection"))
945 (format #t "test suite not run~%"))
948 `(("python-atomicwrites" ,python-atomicwrites)
949 ("python-attrs" ,python-attrs-bootstrap)
950 ("python-more-itertools" ,python-more-itertools)
951 ("python-packaging" ,python-packaging-bootstrap)
952 ("python-pluggy" ,python-pluggy)
953 ("python-py" ,python-py)
954 ("python-six" ,python-six-bootstrap)
955 ("python-wcwidth" ,python-wcwidth)))
957 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
959 ("python-hypothesis" ,python-hypothesis)
960 ("python-nose" ,python-nose)
961 ("python-mock" ,python-mock)
962 ("python-pytest" ,python-pytest-bootstrap)
963 ("python-setuptools-scm" ,python-setuptools-scm)
964 ("python-xmlschema" ,python-xmlschema)))
965 (home-page "https://docs.pytest.org/en/latest/")
966 (synopsis "Python testing library")
968 "Pytest is a testing tool that provides auto-discovery of test modules
969 and functions, detailed info on failing assert statements, modular fixtures,
970 and many external plugins.")
971 (license license:expat)
972 (properties `((python2-variant . ,(delay python2-pytest))))))
974 (define-public python-pytest-6
976 (inherit (strip-python2-variant python-pytest))
981 (uri (pypi-uri "pytest" version))
984 "0gl2sdm322vzmsh5k4f8kj9raiq2y7kdinnca4m45ifvii5fk9y0"))))
987 (modify-phases %standard-phases
989 (lambda* (#:key (tests? #t) #:allow-other-keys)
990 (setenv "TERM" "dumb") ;attempt disabling markup tests
992 (invoke "pytest" "-vv" "-k"
994 ;; This test involve the /usr directory, and fails.
995 " not test_argcomplete"
996 ;; These test do not honor the isatty detection and
998 " and not test_code_highlight"
999 " and not test_color_yes"))
1000 (format #t "test suite not run~%"))
1003 (append (alist-delete "python-py"
1004 (package-propagated-inputs python-pytest))
1005 `(("python-py" ,python-py-next))))
1007 (append (alist-delete "python-pytest"
1008 (package-native-inputs python-pytest))
1009 `(("python-pytest" ,python-pytest-6-bootstrap)
1010 ("python-toml" ,python-toml)
1011 ("python-iniconfig" ,python-iniconfig))))))
1013 ;; Pytest 4.x are the last versions that support Python 2.
1014 (define-public python2-pytest
1016 (inherit (strip-python2-variant python-pytest))
1017 (name "python2-pytest")
1021 (uri (pypi-uri "pytest" version))
1024 "0ls3pqr86xgif6bphsb6wrww9r2vc7p7a2naq8zcq8115wwq5yjh"))))
1025 (build-system python-build-system)
1027 `(#:python ,python-2
1028 ,@(package-arguments python-pytest)))
1030 `(("python-atomicwrites" ,python2-atomicwrites)
1031 ("python-attrs" ,python2-attrs-bootstrap)
1032 ("python-funcsigs" ,python2-funcsigs)
1033 ("python-importlib-metadata" ,python2-importlib-metadata-bootstrap)
1034 ("python-more-itertools" ,python2-more-itertools)
1035 ("python-packaging" ,python2-packaging-bootstrap)
1036 ("python-pathlib2" ,python2-pathlib2)
1037 ("python-pluggy" ,python2-pluggy)
1038 ("python-py" ,python2-py)
1039 ("python-six" ,python2-six-bootstrap)
1040 ("python-wcwidth" ,python2-wcwidth)))
1042 `(("bash" ,bash) ;tests require 'compgen'
1043 ("python-hypothesis" ,python2-hypothesis)
1044 ("python-nose" ,python2-nose)
1045 ("python-mock" ,python2-mock)
1046 ("python-pytest" ,python2-pytest-bootstrap)
1047 ("python-setuptools-scm" ,python2-setuptools-scm)))))
1049 (define-public python-pytest-bootstrap
1051 (inherit (strip-python2-variant python-pytest))
1052 (name "python-pytest-bootstrap")
1053 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
1054 (arguments `(#:tests? #f))
1055 (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
1057 (define-public python-pytest-6-bootstrap
1059 (inherit (strip-python2-variant python-pytest-6))
1060 (name "python-pytest-bootstrap")
1061 (arguments `(#:tests? #f))
1063 `(("python-setuptools-scm" ,python-setuptools-scm)
1064 ("python-toml" ,python-toml)))))
1066 (define-public python2-pytest-bootstrap
1070 (name "python2-pytest-bootstrap")
1072 (substitute-keyword-arguments (package-arguments python2-pytest)
1073 ((#:tests? _ #f) #f)))
1075 `(("python-setuptools-scm" ,python2-setuptools-scm)))
1077 `(("python-atomicwrites" ,python2-atomicwrites)
1078 ("python-attrs" ,python2-attrs-bootstrap)
1079 ("python-funcsigs" ,python2-funcsigs-bootstrap)
1080 ("python-importlib-metadata" ,python2-importlib-metadata-bootstrap)
1081 ("python-more-itertools" ,python2-more-itertools)
1082 ("python-packaging" ,python2-packaging-bootstrap)
1083 ("python-pathlib2" ,python2-pathlib2-bootstrap)
1084 ("python-pluggy" ,python2-pluggy-bootstrap)
1085 ("python-py" ,python2-py)
1086 ("python-wcwidth" ,python2-wcwidth))))))
1088 (define-public python-pytest-cov
1090 (name "python-pytest-cov")
1095 (uri (pypi-uri "pytest-cov" version))
1097 (base32 "0avzlk9p4nc44k7lpx9109dybq71xqnggxb9f4hp0l64pbc44ryc"))))
1098 (build-system python-build-system)
1101 (modify-phases %standard-phases
1104 ;; Options taken from tox.ini.
1105 ;; TODO: make "--restructuredtext" tests pass. They currently fail
1106 ;; with "Duplicate implicit target name".
1107 (invoke "python" "./setup.py" "check"
1108 "--strict" "--metadata"))))))
1110 `(("python-coverage" ,python-coverage)
1111 ("python-pytest" ,python-pytest)))
1112 (home-page "https://github.com/pytest-dev/pytest-cov")
1113 (synopsis "Pytest plugin for measuring coverage")
1115 "Pytest-cov produces coverage reports. It supports centralised testing and
1116 distributed testing in both @code{load} and @code{each} modes. It also
1117 supports coverage of subprocesses.")
1118 (license license:expat)))
1120 (define-public python2-pytest-cov
1121 (package-with-python2 python-pytest-cov))
1123 (define-public python-pytest-httpserver
1125 (name "python-pytest-httpserver")
1129 (uri (pypi-uri "pytest_httpserver" version))
1132 "0vbls0j570l5my83j4jnk5blmnir44i0w511azlh41nl6k8rac5f"))))
1133 (build-system python-build-system)
1135 `(("python-pytest" ,python-pytest)))
1137 `(("python-werkzeug" ,python-werkzeug)))
1140 (modify-phases %standard-phases
1141 (add-before 'check 'fix-library-loading
1143 (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH") ":."))))
1146 (invoke "pytest" "tests" "-vv")
1147 (invoke "pytest" "tests" "-vv" "--ssl"))))))
1148 (home-page "https://github.com/csernazs/pytest-httpserver")
1149 (synopsis "HTTP server for pytest")
1150 (description "Pytest plugin library to test http clients without
1151 contacting the real http server.")
1152 (license license:expat)))
1154 (define-public python-pytest-runner
1156 (name "python-pytest-runner")
1161 (uri (pypi-uri "pytest-runner" version))
1164 "0awll1bva5zy8cspsxcpv7pjcrdf5c6pf56nqn4f74vvmlzfgiwn"))))
1165 (build-system python-build-system)
1167 '(;; FIXME: The test suite requires 'python-flake8' and 'python-black',
1168 ;; but that introduces a circular dependency.
1170 #:phases (modify-phases %standard-phases
1172 (lambda* (#:key tests? #:allow-other-keys)
1174 (invoke "pytest" "-vv")
1175 (format #t "test suite not run~%"))
1178 `(("python-setuptools-scm" ,python-setuptools-scm)))
1179 (home-page "https://github.com/pytest-dev/pytest-runner")
1180 (synopsis "Invoke py.test as a distutils command")
1182 "This package provides a @command{pytest-runner} command that
1183 @file{setup.py} files can use to run tests.")
1184 (license license:expat)))
1186 (define-public python2-pytest-runner
1187 (package-with-python2 python-pytest-runner))
1189 ;; python-bleach 3.1.0 requires this ancient version of pytest-runner.
1190 ;; Remove once no longer needed.
1191 (define-public python-pytest-runner-2
1193 (inherit python-pytest-runner)
1197 (uri (pypi-uri "pytest-runner" version))
1200 "11ivjj9hfphkv4yfb2g74av4yy86y8gcbf7gbif0p1hcdfnxg3w6"))))))
1202 (define-public python2-pytest-runner-2
1203 (package-with-python2 python-pytest-runner-2))
1205 (define-public python-pytest-lazy-fixture
1207 (name "python-pytest-lazy-fixture")
1212 (uri (pypi-uri "pytest-lazy-fixture" version))
1214 (base32 "1b0hmnsxw4s2wf9pks8dg6dfy5cx3zcbzs8517lfccxsfizhqz8f"))))
1215 (build-system python-build-system)
1218 (modify-phases %standard-phases
1220 (lambda* (#:key inputs outputs #:allow-other-keys)
1221 ;; Make the installed plugin discoverable by Pytest.
1222 (add-installed-pythonpath inputs outputs)
1223 (invoke "pytest" "-vv"))))))
1225 `(("python-pytest" ,python-pytest)))
1226 (home-page "https://github.com/tvorog/pytest-lazy-fixture")
1227 (synopsis "Use fixtures in @code{pytest.mark.parametrize}")
1228 (description "This plugin helps to use fixtures in
1229 @code{pytest.mark.parametrize}.")
1230 (license license:expat)))
1232 (define-public python-pytest-mock
1234 (name "python-pytest-mock")
1239 (uri (pypi-uri "pytest-mock" version))
1242 "1i5mg3ff1qk0wqfcxfz60hwy3q5dskdp36i10ckigkzffg8hc3ad"))))
1243 (build-system python-build-system)
1245 `(("python-setuptools-scm" ,python-setuptools-scm)))
1247 `(("python-pytest" ,python-pytest)))
1248 (home-page "https://github.com/pytest-dev/pytest-mock/")
1249 (synopsis "Thin-wrapper around the mock package for easier use with py.test")
1251 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
1252 around the patching API provided by the @code{mock} package, but with the
1253 benefit of not having to worry about undoing patches at the end of a test.
1254 The mocker fixture has the same API as @code{mock.patch}, supporting the
1256 (properties `((python2-variant . ,(delay python2-pytest-mock))))
1257 (license license:expat)))
1259 (define-public python2-pytest-mock
1260 (let ((base (package-with-python2
1261 (strip-python2-variant python-pytest-mock))))
1262 (package/inherit base
1264 `(("python2-mock" ,python2-mock)
1265 ,@(package-propagated-inputs base))))))
1267 (define-public python-pytest-xdist
1269 (name "python-pytest-xdist")
1274 (uri (pypi-uri "pytest-xdist" version))
1277 "0wh6pn66nncfs6ay0n863bgyriwsgppn8flx5l7551j1lbqkinc2"))
1278 (modules '((guix build utils)))
1281 ;; Remove pre-compiled .pyc files from source.
1282 (for-each delete-file-recursively
1283 (find-files "." "__pycache__" #:directories? #t))
1284 (for-each delete-file (find-files "." "\\.pyc$"))
1286 (build-system python-build-system)
1288 '(#:tests? #f)) ;FIXME: Some tests are failing.
1290 ;; (modify-phases %standard-phases
1292 ;; (add-after 'install 'check
1293 ;; (lambda* (#:key inputs outputs #:allow-other-keys)
1294 ;; (add-installed-pythonpath inputs outputs)
1295 ;; (zero? (system* "py.test" "-v")))))
1297 `(("python-setuptools-scm" ,python-setuptools-scm)))
1299 `(("python-execnet" ,python-execnet)
1300 ("python-pytest" ,python-pytest)
1301 ("python-py" ,python-py)))
1303 "https://github.com/pytest-dev/pytest-xdist")
1305 "Plugin for py.test with distributed testing and loop-on-failing modes")
1307 "The pytest-xdist plugin extends py.test with some unique test execution
1308 modes: parallelization, running tests in boxed subprocesses, the ability
1309 to run tests repeatedly when failed, and the ability to run tests on multiple
1310 Python interpreters or platforms. It uses rsync to copy the existing
1311 program code to a remote location, executes there, and then syncs the
1313 (license license:expat)))
1315 (define-public python2-pytest-xdist
1316 (package-with-python2 python-pytest-xdist))
1318 (define-public python-pytest-timeout
1320 (name "python-pytest-timeout")
1325 (uri (pypi-uri "pytest-timeout" version))
1328 "13n42azbvs5slvy2n1a9nw17r4qdq10dd68nln3jp925safa3yl0"))))
1329 (build-system python-build-system)
1331 '(#:phases (modify-phases %standard-phases
1333 (lambda* (#:key inputs outputs #:allow-other-keys)
1334 ;; Make the installed plugin discoverable by Pytest.
1335 (add-installed-pythonpath inputs outputs)
1336 (invoke "pytest" "-vv"))))))
1338 `(("python-pytest" ,python-pytest)))
1340 `(("python-pexpect" ,python-pexpect)))
1341 (home-page "https://github.com/pytest-dev/pytest-timeout")
1342 (synopsis "Plugin for py.test to abort hanging tests")
1344 "This package provides a py.test plugin that aborts hanging tests after a
1345 timeout has been exceeded.")
1346 (license license:expat)))
1348 (define-public python-pytest-forked
1350 (name "python-pytest-forked")
1355 (uri (pypi-uri "pytest-forked" version))
1358 "000i4q7my2fq4l49n8idx2c812dql97qv6qpm2vhrrn9v6g6j18q"))))
1359 (build-system python-build-system)
1361 `(("python-pytest" ,python-pytest)))
1363 `(("python-setuptools-scm" ,python-setuptools-scm)))
1365 "https://github.com/pytest-dev/pytest-forked")
1367 "Run tests in isolated forked subprocesses")
1369 "Pytest plugin which will run each test in a subprocess and will report if
1370 a test crashed the process.")
1371 (license license:expat)))
1373 (define-public python-scripttest
1375 (name "python-scripttest")
1380 (uri (pypi-uri "scripttest" version))
1383 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
1384 (build-system python-build-system)
1386 `(("python-pytest" ,python-pytest)))
1387 (home-page (string-append "https://web.archive.org/web/20161029233413/"
1388 "http://pythonpaste.org/scripttest/"))
1389 (synopsis "Python library to test command-line scripts")
1390 (description "Scripttest is a Python helper library for testing
1391 interactive command-line applications. With it you can run a script in a
1392 subprocess and see the output as well as any file modifications.")
1393 (license license:expat)))
1395 (define-public python-testtools-bootstrap
1397 (name "python-testtools-bootstrap")
1402 (uri (pypi-uri "testtools" version))
1405 "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
1406 (patches (search-patches "python-testtools.patch"))))
1407 (build-system python-build-system)
1408 (arguments '(#:tests? #f))
1410 `(("python-extras" ,python-extras)
1411 ("python-fixtures" ,python-fixtures-bootstrap)
1412 ("python-mimeparse" ,python-mimeparse)
1413 ("python-pbr" ,python-pbr-minimal)
1414 ("python-six" ,python-six)
1415 ("python-traceback2" ,python-traceback2)
1416 ("python-unittest2" ,python-unittest2)))
1417 (home-page "https://github.com/testing-cabal/testtools")
1419 "Extensions to the Python standard library unit testing framework")
1421 "This package is only for bootstrapping. Do not use this.")
1422 (license license:psfl)))
1424 (define-public python-testtools
1426 (inherit python-testtools-bootstrap)
1427 (name "python-testtools")
1429 `(#:phases (modify-phases %standard-phases
1432 (invoke "python" "-m" "testtools.run"
1433 "testtools.tests.test_suite"))))))
1435 `(("python-extras" ,python-extras)
1436 ("python-fixtures" ,python-fixtures)
1437 ("python-mimeparse" ,python-mimeparse)
1438 ("python-pbr" ,python-pbr)
1439 ("python-six" ,python-six)
1440 ("python-traceback2" ,python-traceback2)
1441 ("python-unittest2" ,python-unittest2)))
1443 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
1445 "Testtools extends the Python standard library unit testing framework to
1446 provide matchers, more debugging information, and cross-Python
1449 (define-public python-testscenarios-bootstrap
1451 (name "python-testscenarios-bootstrap")
1456 (uri (pypi-uri "testscenarios" version))
1459 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
1460 (build-system python-build-system)
1462 `(#:phases (modify-phases %standard-phases
1465 (invoke "python" "-m" "testtools.run"
1466 "testscenarios.test_suite"))))))
1468 `(("python-pbr" ,python-pbr-minimal)
1469 ("python-testtools" ,python-testtools-bootstrap)))
1470 (home-page "https://launchpad.net/testscenarios")
1471 (synopsis "Pyunit extension for dependency injection")
1473 "This package is only for bootstrapping. Don't use this.")
1474 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1476 (define-public python-testscenarios
1478 (inherit python-testscenarios-bootstrap)
1479 (name "python-testscenarios")
1481 `(("python-pbr" ,python-pbr)
1482 ("python-testtools" ,python-testtools)))
1484 "Testscenarios provides clean dependency injection for Python unittest
1487 ;; Testresources requires python-pbr at runtime, but pbr needs it for its
1488 ;; own tests. Hence this bootstrap variant.
1489 (define-public python-testresources-bootstrap
1491 (name "python-testresources-bootstrap")
1495 (uri (pypi-uri "testresources" version))
1498 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
1499 (build-system python-build-system)
1500 (arguments '(#:tests? #f))
1502 `(("python-pbr" ,python-pbr-minimal)))
1503 (home-page "https://launchpad.net/testresources")
1505 "Pyunit extension for managing test resources")
1507 "This package is only here for bootstrapping purposes. Use the regular
1508 testresources package instead.")
1509 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1511 (define-public python-testresources
1513 (inherit python-testresources-bootstrap)
1514 (name "python-testresources")
1516 `(("python-pbr" ,python-pbr)))
1519 `(("python-fixtures" ,python-fixtures)
1520 ("python-testtols" ,python-testtools)))
1522 "Testresources is an extension to Python's unittest to allow declarative
1523 use of resources by test cases.")))
1525 (define-public python-subunit-bootstrap
1527 (name "python-subunit-bootstrap")
1532 (uri (pypi-uri "python-subunit" version))
1535 "0j0ymmnc5nfxi1qzvy59j27viqca7l7xd0y9x29g7yr0h693j804"))))
1536 (build-system python-build-system)
1538 `(("python-extras" ,python-extras)
1539 ("python-testtools" ,python-testtools-bootstrap)))
1541 `(("python-fixtures" ,python-fixtures-bootstrap)
1542 ("python-hypothesis" ,python-hypothesis)
1543 ("python-testscenarios" ,python-testscenarios-bootstrap)))
1544 (home-page "https://launchpad.net/subunit")
1545 (synopsis "Python implementation of the subunit protocol")
1547 "This package is here for bootstrapping purposes only. Use the regular
1548 python-subunit package instead.")
1549 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1551 (define-public python-subunit
1553 (inherit python-subunit-bootstrap)
1554 (name "python-subunit")
1556 `(("python-extras" ,python-extras)
1557 ("python-testtools" ,python-testtools)))
1559 `(("python-fixtures" ,python-fixtures)
1560 ("python-hypothesis" ,python-hypothesis)
1561 ("python-testscenarios" ,python-testscenarios)))
1563 "Python-subunit is a Python implementation of the subunit test streaming
1566 ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
1567 ;; own tests. Hence this bootstrap variant.
1568 (define-public python-fixtures-bootstrap
1570 (name "python-fixtures-bootstrap")
1574 (uri (pypi-uri "fixtures" version))
1577 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
1578 (build-system python-build-system)
1579 (arguments `(#:tests? #f))
1581 `(("python-pbr-minimal" ,python-pbr-minimal)
1582 ("python-six" ,python-six)))
1583 (home-page "https://launchpad.net/python-fixtures")
1584 (synopsis "Python test fixture library")
1586 "This package is only used for bootstrapping. Use the regular
1587 python-fixtures package instead.")
1588 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1590 (define-public python-fixtures
1592 (inherit python-fixtures-bootstrap)
1593 (name "python-fixtures")
1596 (modify-phases %standard-phases
1599 (invoke "python" "-m" "testtools.run"
1600 "fixtures.test_suite"))))))
1602 ;; Fixtures uses pbr at runtime to check versions, etc.
1603 `(("python-pbr" ,python-pbr)
1604 ("python-six" ,python-six)))
1606 `(("python-mock" ,python-mock)
1607 ("python-testtools" ,python-testtools-bootstrap)))
1609 "Fixtures provides a way to create reusable state, useful when writing
1612 (define-public python-testrepository-bootstrap
1614 (name "python-testrepository-bootstrap")
1619 (uri (pypi-uri "testrepository" version))
1622 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1623 (build-system python-build-system)
1624 (arguments '(#:tests? #f))
1626 `(("python-fixtures" ,python-fixtures-bootstrap)
1627 ("python-subunit" ,python-subunit-bootstrap)
1628 ("python-testtools" ,python-testtools-bootstrap)))
1630 `(("python-mimeparse" ,python-mimeparse)))
1631 (home-page "https://launchpad.net/testrepository")
1632 (synopsis "Database for Python test results")
1634 "Bootstrap package for python-testrepository. Don't use this.")
1635 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1637 (define-public python-testrepository
1639 (inherit python-testrepository-bootstrap)
1640 (name "python-testrepository")
1642 ;; FIXME: Many tests are failing.
1645 `(("python-fixtures" ,python-fixtures)
1646 ("python-subunit" ,python-subunit)
1647 ("python-testtools" ,python-testtools)))
1649 `(("python-mimeparse" ,python-mimeparse)))
1650 (description "Testrepository provides a database of test results which can
1651 be used as part of a developer's workflow to check things such as what tests
1652 have failed since the last commit or what tests are currently failing.")))
1654 (define-public python-coverage
1656 (name "python-coverage")
1661 (uri (pypi-uri "coverage" version))
1664 "16z8i18msgs8k74n73dj9x49wzkl0vk4vq8k5pl1bsj70y7b4k53"))))
1665 (build-system python-build-system)
1667 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1669 (home-page "https://coverage.readthedocs.io")
1670 (synopsis "Code coverage measurement for Python")
1672 "Coverage measures code coverage, typically during test execution. It
1673 uses the code analysis tools and tracing hooks provided in the Python standard
1674 library to determine which lines are executable, and which have been
1676 (license license:bsd-3)))
1678 (define-public python2-coverage
1679 (package-with-python2 python-coverage))
1681 (define-public python-pytest-asyncio
1683 (name "python-pytest-asyncio")
1688 (uri (pypi-uri "pytest-asyncio" version))
1690 (base32 "1bysy4nii13bm7h345wxf8fxcjhab7l374pqdv7vwv3izl053b4z"))))
1691 (build-system python-build-system)
1693 `(("python-coverage" ,python-coverage)
1694 ("python-async-generator" ,python-async-generator)
1695 ("python-hypothesis" ,python-hypothesis)
1696 ("python-pytest" ,python-pytest)))
1697 (home-page "https://github.com/pytest-dev/pytest-asyncio")
1698 (synopsis "Pytest support for asyncio")
1699 (description "Python asyncio code is usually written in the form of
1700 coroutines, which makes it slightly more difficult to test using normal
1701 testing tools. @code{pytest-asyncio} provides useful fixtures and markers
1702 to make testing async code easier.")
1703 (license license:asl2.0)))
1705 (define-public python-cov-core
1707 (name "python-cov-core")
1712 (uri (pypi-uri "cov-core" version))
1715 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1716 (build-system python-build-system)
1718 `(("python-coverage" ,python-coverage)))
1719 (home-page "https://github.com/schlamar/cov-core")
1720 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
1722 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1723 and @code{nose2-cov}. It is useful for developing coverage plugins for these
1724 testing frameworks.")
1725 (license license:expat)))
1727 (define-public python2-cov-core
1728 (package-with-python2 python-cov-core))
1730 (define-public python-codecov
1732 (name "python-codecov")
1737 (uri (pypi-uri "codecov" version))
1740 "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1741 (build-system python-build-system)
1743 `(("python-unittest2" ,python-unittest2)))
1745 `(("python-coverage" ,python-coverage)
1746 ("python-requests" ,python-requests)))
1747 (home-page "https://github.com/codecov/codecov-python")
1748 (synopsis "Upload code coverage reports to @code{codecov.io}")
1750 "Codecov collects code coverage reports from code written in Python, Java,
1751 C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
1752 (license license:asl2.0)))
1754 (define-public python-testpath
1756 (name "python-testpath")
1762 (url "https://github.com/jupyter/testpath")
1764 (file-name (git-file-name name version))
1767 "1fwv4d3p54xx1x942s104irr35lszvv6jnr4nn1scsfvc0m1qmbk"))))
1768 (build-system python-build-system)
1770 `(#:tests? #f ; this package does not even have a setup.py
1771 #:modules ((guix build python-build-system)
1775 (modify-phases %standard-phases
1778 ;; A ZIP archive should be generated, but it fails with "ZIP does
1779 ;; not support timestamps before 1980". Luckily,
1780 ;; SOURCE_DATE_EPOCH is respected, which we set to some time in
1782 (setenv "SOURCE_DATE_EPOCH" "315532800")
1783 (invoke "flit" "build")))
1785 (lambda* (#:key inputs outputs #:allow-other-keys)
1786 (add-installed-pythonpath inputs outputs)
1787 (let ((out (assoc-ref outputs "out")))
1788 (for-each (lambda (wheel)
1789 (format #true wheel)
1790 (invoke "python" "-m" "pip" "install"
1791 wheel (string-append "--prefix=" out)))
1792 (find-files "dist" "\\.whl$"))))))))
1794 `(("python-flit" ,python-flit)))
1795 (home-page "https://github.com/takluyver/testpath")
1796 (synopsis "Test utilities for code working with files and commands")
1798 "Testpath is a collection of utilities for Python code working with files
1799 and commands. It contains functions to check things on the file system, and
1800 tools for mocking system commands and recording calls to those.")
1801 (license license:expat)))
1803 (define-public python-testlib
1805 (name "python-testlib")
1810 (uri (pypi-uri "testlib" version ".zip"))
1812 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1813 (build-system python-build-system)
1815 `(("unzip" ,unzip))) ; for unpacking the source
1816 (synopsis "Python micro test suite harness")
1817 (description "A micro unittest suite harness for Python.")
1818 (home-page "https://github.com/trentm/testlib")
1819 (license license:expat)))
1821 (define-public python2-testlib
1822 (package-with-python2 python-testlib))
1824 ;;; The software provided by this package was integrated into pytest 2.8.
1825 (define-public python-pytest-cache
1827 (name "python-pytest-cache")
1831 (uri (pypi-uri "pytest-cache" version))
1834 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1835 (build-system python-build-system)
1837 `(("python-apipkg" ,python-apipkg)
1838 ("python-execnet" ,python-execnet)
1839 ("python-py" ,python-py)
1840 ("python-pytest" ,python-pytest)))
1841 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1842 (description "The pytest-cache plugin provides tools to rerun failures from
1843 the last py.test invocation.")
1844 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1845 (license license:expat)))
1847 (define-public python2-pytest-cache
1848 (package-with-python2 python-pytest-cache))
1850 (define-public python-pytest-localserver
1852 (name "python-pytest-localserver")
1856 (uri (pypi-uri "pytest-localserver" version))
1859 "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
1860 (build-system python-build-system)
1863 (modify-phases %standard-phases
1866 (invoke "py.test" "-v"))))))
1868 `(("python-pytest" ,python-pytest)
1869 ("python-requests" ,python-requests)
1870 ("python-six" ,python-six)))
1872 `(("python-werkzeug" ,python-werkzeug)))
1873 (synopsis "Py.test plugin to test server connections locally")
1874 (description "Pytest-localserver is a plugin for the pytest testing
1875 framework which enables you to test server connections locally.")
1876 (home-page "https://pypi.org/project/pytest-localserver/")
1877 (license license:expat)))
1879 (define-public python-pytest-xprocess
1881 (name "python-pytest-xprocess")
1885 (uri (pypi-uri "pytest-xprocess" version))
1888 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1889 (build-system python-build-system)
1891 `(("python-pytest" ,python-pytest)
1892 ("python-pytest-cache" ,python-pytest-cache)
1893 ("python-psutil" ,python-psutil)))
1894 (synopsis "Pytest plugin to manage external processes across test runs")
1895 (description "Pytest-xprocess is an experimental py.test plugin for managing
1896 processes across test runs.")
1897 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1898 (license license:expat)))
1900 (define-public python-pytest-subtesthack
1902 (name "python-pytest-subtesthack")
1906 (uri (pypi-uri "pytest-subtesthack" version))
1909 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1910 (build-system python-build-system)
1912 `(("python-pytest" ,python-pytest)))
1913 (synopsis "Set-up and tear-down fixtures for unit tests")
1914 (description "This plugin allows you to set up and tear down fixtures within
1915 unit test functions that use @code{py.test}. This is useful for using
1916 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1917 function multiple times, without setting up or tearing down fixture state as is
1918 normally the case.")
1919 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1920 (license license:unlicense)))
1922 (define-public python2-pytest-subtesthack
1923 (package-with-python2 python-pytest-subtesthack))
1925 (define-public python-pytest-sugar
1927 (name "python-pytest-sugar")
1932 (uri (pypi-uri "pytest-sugar" version))
1934 (base32 "1i0hv3h49zvl62jbiyjag84carbrp3zprqzxffdr291nxavvac0n"))))
1935 (build-system python-build-system)
1937 `(("python-packaging" ,python-packaging)
1938 ("python-pytest" ,python-pytest)
1939 ("python-termcolor" ,python-termcolor)))
1940 (home-page "https://pivotfinland.com/pytest-sugar/")
1941 (synopsis "Plugin for pytest that changes the default look and feel")
1943 "@code{pytest-sugar} is a plugin for py.test that changes the default
1944 look and feel of py.test, using a progress bar and showing failures and errors
1946 (license license:bsd-3)))
1948 (define-public python-hypothesis
1950 (name "python-hypothesis")
1954 (uri (pypi-uri "hypothesis" version))
1957 "0zn09bn6hadk4vxl6jy8bkjr5fz8mrhin3z46w7pq5qgbaycr89p"))))
1958 (build-system python-build-system)
1960 ;; XXX: Tests are not distributed with the PyPI archive.
1963 `(("python-attrs" ,python-attrs-bootstrap)
1964 ("python-sortedcontainers" ,python-sortedcontainers)))
1965 (synopsis "Library for property based testing")
1966 (description "Hypothesis is a library for testing your Python code against a
1967 much larger range of examples than you would ever want to write by hand. It’s
1968 based on the Haskell library, Quickcheck, and is designed to integrate
1969 seamlessly into your existing Python unit testing work flow.")
1970 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
1971 (license license:mpl2.0)
1972 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1974 (define-public python-hypothesis-5.23
1976 (inherit python-hypothesis)
1980 (uri (pypi-uri "hypothesis" version))
1983 "0sy1v6nyxg4rjcf3rlr8nalb7wqd9nccpb2lzkchbj5an13ysf1h"))))
1984 (home-page "https://github.com/HypothesisWorks/hypothesis")))
1986 ;; This is the last version of Hypothesis that supports Python 2.
1987 (define-public python2-hypothesis
1988 (let ((hypothesis (package-with-python2
1989 (strip-python2-variant python-hypothesis))))
1990 (package (inherit hypothesis)
1994 (uri (pypi-uri "hypothesis" version))
1997 "183gpxbfcdhdqzlahkji5a71n6lmvgqsbkcb0ihqad51n2j6jhrw"))))
1999 `(("python2-enum34" ,python2-enum34)
2000 ,@(package-propagated-inputs hypothesis))))))
2002 (define-public python-hypothesmith
2004 (name "python-hypothesmith")
2009 (uri (pypi-uri "hypothesmith" version))
2012 "09331sspknv459xcyn1k0lx5flqlc6gmnwp9370pfvg4kg1zmss6"))))
2013 (build-system python-build-system)
2015 `(("python-hypothesis" ,python-hypothesis-5.23)
2016 ("python-lark-parser" ,python-lark-parser)
2017 ("python-libcst" ,python-libcst)))
2018 (home-page "https://github.com/Zac-HD/hypothesmith")
2019 (synopsis "Strategies for generating Python programs")
2021 "This package contains hypothesis strategies for generating Python
2022 programs, something like CSmith, a random generator of C programs.")
2023 (license license:mpl2.0)))
2025 (define-public python-lit
2032 (uri (pypi-uri "lit" version))
2035 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
2036 (build-system python-build-system)
2039 (modify-phases %standard-phases
2042 (invoke "python" "lit.py" "tests"))))))
2045 (home-page "https://llvm.org/")
2046 (synopsis "LLVM Software Testing Tool")
2047 (description "@code{lit} is a portable tool for executing LLVM and Clang
2048 style test suites, summarizing their results, and providing indication of
2050 (license license:ncsa)))
2052 (define-public python2-lit
2053 (package-with-python2 python-lit))
2055 (define-public python-pytest-pep8
2057 (name "python-pytest-pep8")
2061 (uri (pypi-uri "pytest-pep8" version))
2064 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
2065 (build-system python-build-system)
2067 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
2069 `(("python-pytest" ,python-pytest)))
2071 `(("python-pep8" ,python-pep8)))
2072 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
2073 (synopsis "Py.test plugin to check PEP8 requirements")
2074 (description "Pytest plugin for checking PEP8 compliance.")
2075 (license license:expat)))
2077 (define-public python2-pytest-pep8
2078 (package-with-python2 python-pytest-pep8))
2080 (define-public python-pytest-flakes
2082 (name "python-pytest-flakes")
2086 (uri (pypi-uri "pytest-flakes" version))
2089 "0045h3hnrkn2jwr42jgy2j98npx4amwr6wxzi9j0nppaqz33l49p"))))
2090 (build-system python-build-system)
2093 (modify-phases %standard-phases
2095 (add-after 'install 'check
2096 (lambda* (#:key outputs inputs #:allow-other-keys)
2097 ;; It's easier to run tests after install.
2098 ;; Make installed package available for running the tests
2099 (add-installed-pythonpath inputs outputs)
2100 (invoke "py.test" "-vv" "-k" "not test_syntax_error"))))))
2102 `(("python-coverage" ,python-coverage)
2103 ("python-pytest" ,python-pytest)
2104 ("python-pytest-cache" ,python-pytest-cache)
2105 ("python-pytest-pep8" ,python-pytest-pep8)))
2107 `(("python-pyflakes" ,python-pyflakes)))
2108 (home-page "https://github.com/fschulze/pytest-flakes")
2109 (synopsis "Py.test plugin to check source code with pyflakes")
2110 (description "Pytest plugin for checking Python source code with pyflakes.")
2111 (license license:expat)))
2113 (define-public python2-pytest-flakes
2114 (package-with-python2 python-pytest-flakes))
2116 (define-public python-coverage-test-runner
2118 (name "python-coverage-test-runner")
2124 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
2125 "coverage-test-runner/snapshot/coverage-test-runner-"
2129 "1kjjb9llckycnfxag8zcvqsn4z1s3dwyw6b1n0avxydihgf30rny"))))
2130 (build-system python-build-system)
2133 (modify-phases %standard-phases
2136 (invoke "./testrun"))))))
2138 `(("python-coverage" ,python-coverage)))
2139 (home-page "https://liw.fi/coverage-test-runner/")
2140 (synopsis "Python module for running unit tests")
2141 (description "@code{CoverageTestRunner} is a python module for running
2142 unit tests and failing them if the unit test module does not exercise all
2143 statements in the module it tests.")
2144 (license license:gpl3+)))
2146 (define-public python2-coverage-test-runner
2147 (package-with-python2 python-coverage-test-runner))
2149 (define-public python-pylint
2151 (name "python-pylint")
2157 (url "https://github.com/PyCQA/pylint")
2158 (commit (string-append "pylint-" version))))
2159 (file-name (git-file-name name version))
2161 (base32 "04cgbh2z1mygar63plzziyz34yg6bdr4i0g63jp256fgnqwb1bi3"))))
2162 (build-system python-build-system)
2163 ;; FIXME: Tests are failing since version 2.4.3, see:
2164 ;; https://github.com/PyCQA/pylint/issues/3198.
2165 (arguments '(#:tests? #f))
2167 `(("python-pytest" ,python-pytest)
2168 ("python-pytest-runner" ,python-pytest-runner)
2169 ("python-tox" ,python-tox)))
2171 `(("python-astroid" ,python-astroid)
2172 ("python-isort" ,python-isort)
2173 ("python-mccabe" ,python-mccabe)
2174 ("python-six" ,python-six)
2175 ("python-toml" ,python-toml)))
2176 (home-page "https://github.com/PyCQA/pylint")
2177 (synopsis "Python source code analyzer which looks for coding standard
2179 (description "Pylint is a Python source code analyzer which looks
2180 for programming errors, helps enforcing a coding standard and sniffs
2181 for some code smells (as defined in Martin Fowler's Refactoring book).
2183 Pylint has many rules enabled by default, way too much to silence them
2184 all on a minimally sized program. It's highly configurable and handle
2185 pragmas to control it from within your code. Additionally, it is
2186 possible to write plugins to add your own checks.")
2187 (license license:gpl2+)))
2189 (define-public python-paramunittest
2191 (name "python-paramunittest")
2196 (uri (pypi-uri "ParamUnittest" version))
2199 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
2200 (build-system python-build-system)
2202 "https://github.com/rik0/ParamUnittest")
2204 "Simple extension to have parametrized unit tests")
2206 "This package creates parameterized unit-tests that work with the standard
2207 unittest package. A parameterized test case is automatically converted to multiple test
2208 cases. Since they are TestCase subclasses, they work with other test suites that
2209 recognize TestCases.")
2210 (license license:bsd-2)))
2212 (define-public python2-python-paramunittest
2213 (package-with-python2 python-paramunittest))
2215 (define-public python-pytest-warnings
2217 (name "python-pytest-warnings")
2222 (uri (pypi-uri "pytest-warnings" version))
2225 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
2226 (build-system python-build-system)
2228 `(("pytest" ,python-pytest)))
2229 (home-page "https://github.com/fschulze/pytest-warnings")
2230 (synopsis "Pytest plugin to list Python warnings in pytest report")
2232 "Python-pytest-warnings is a pytest plugin to list Python warnings in
2234 (license license:expat)
2235 (properties `((python2-variant . ,(delay python2-pytest-warnings))
2236 ;; This package is part of pytest as of version 3.1.0.
2237 (superseded . ,python-pytest)))))
2239 (define-public python2-pytest-warnings
2240 (package (inherit (package-with-python2
2241 (strip-python2-variant python-pytest-warnings)))
2242 (properties `((superseded . ,python2-pytest)))))
2244 (define-public python-pytest-capturelog
2246 (name "python-pytest-capturelog")
2251 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
2254 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
2255 (build-system python-build-system)
2257 `(("pytest" ,python-pytest)))
2258 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
2259 (synopsis "Pytest plugin to catch log messages")
2261 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
2262 (license license:expat)))
2264 (define-public python2-pytest-capturelog
2265 (package-with-python2 python-pytest-capturelog))
2267 (define-public python-pytest-catchlog
2269 (name "python-pytest-catchlog")
2274 (uri (pypi-uri "pytest-catchlog" version ".zip"))
2277 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
2278 (build-system python-build-system)
2280 `(("unzip" ,unzip)))
2282 `(("pytest" ,python-pytest)))
2283 (home-page "https://github.com/eisensheng/pytest-catchlog")
2284 (synopsis "Pytest plugin to catch log messages")
2286 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
2287 a fork of pytest-capturelog.")
2288 (license license:expat)))
2290 (define-public python2-pytest-catchlog
2291 (package-with-python2 python-pytest-catchlog))
2293 (define-public python-nosexcover
2295 (name "python-nosexcover")
2299 (uri (pypi-uri "nosexcover" version))
2302 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
2303 (build-system python-build-system)
2305 `(("python-coverage" ,python-coverage)
2306 ("python-nose" ,python-nose)))
2307 (home-page "https://github.com/cmheisel/nose-xcover")
2308 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
2309 (description "Nose-xcover is a companion to the built-in
2310 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
2311 to a file named coverage.xml.
2313 It will honor all the options you pass to the Nose coverage plugin,
2314 especially -cover-package.")
2315 (license license:expat)))
2317 (define-public python2-nosexcover
2318 (package-with-python2 python-nosexcover))
2320 (define-public python-discover
2322 (name "python-discover")
2327 (uri (pypi-uri "discover" version))
2330 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
2331 (build-system python-build-system)
2332 (home-page "https://pypi.org/project/discover/")
2334 "Python test discovery for unittest")
2336 "Discover provides test discovery for unittest, a feature that has been
2337 backported from Python 2.7 for Python 2.4+.")
2338 (license license:bsd-3)))
2340 (define-public python2-discover
2341 (package-with-python2 python-discover))
2343 (define-public behave
2349 (uri (pypi-uri "behave" version))
2352 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))
2353 (patches (search-patches
2354 "behave-skip-a-couple-of-tests.patch"))))
2355 (build-system python-build-system)
2357 `(("python-mock" ,python-mock)
2358 ("python-nose" ,python-nose)
2359 ("python-pathpy" ,python-pathpy)
2360 ("python-pyhamcrest" ,python-pyhamcrest)
2361 ("python-pytest" ,python-pytest)))
2363 `(("python-importlib-metadata" ,python-importlib-metadata)
2364 ("python-six" ,python-six)
2365 ("python-parse" ,python-parse)
2366 ("python-parse-type" ,python-parse-type)))
2368 '(#:test-target "behave_test"
2370 (modify-phases %standard-phases
2371 (add-before 'check 'fix-library-loading
2373 ;; Otherwise, tests fail with no module named 'path'
2374 (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH") ":"
2375 (getcwd) "/tasks/_vendor"))
2377 (home-page "https://github.com/behave/behave")
2378 (synopsis "Python behavior-driven development")
2380 "Behave is a tool for behavior-driven development in python.
2381 Behavior-driven development (or BDD) is an agile software development
2382 technique that encourages collaboration between developers, QA and
2383 non-technical or business participants in a software project. Behave uses
2384 tests written in a natural language style, backed up by Python code.")
2385 (license license:x11)))
2387 (define-public python-behave-web-api
2389 (name "python-behave-web-api")
2394 (uri (pypi-uri "behave-web-api" version))
2397 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
2398 (build-system python-build-system)
2401 (modify-phases %standard-phases
2402 (add-after 'unpack 'fix-dependencies
2404 (substitute* "setup.py"
2405 (("'wheel'") "") ; We don't use it.
2406 (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
2409 `(("behave" ,behave)
2410 ("python-requests" ,python-requests)))
2411 (home-page "https://github.com/jefersondaniel/behave-web-api")
2412 (synopsis "Provides testing for JSON APIs with Behave for Python")
2413 (description "This package provides testing utility modules for testing
2414 JSON APIs with Behave.")
2415 (license license:expat)))
2417 (define-public python-rednose
2419 (name "python-rednose")
2424 (uri (pypi-uri "rednose" version))
2427 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
2428 (build-system python-build-system)
2430 `(#:phases (modify-phases %standard-phases
2431 (add-after 'unpack 'patch-setup.py
2433 ;; Six is only required for tests and later versions
2435 (substitute* "setup.py"
2436 (("six==1.10.0") "six"))
2439 `(("python-colorama" ,python-colorama)
2440 ("python-termstyle" ,python-termstyle)))
2442 `(("python-six" ,python-six)
2443 ("python-nose" ,python-nose)))
2444 (home-page "https://github.com/JBKahn/rednose")
2445 (synopsis "Colored output for Python nosetests")
2446 (description "This package provides colored output for the
2447 @command{nosetests} command of the Python Nose unit test framework.")
2448 (license license:bsd-3)))
2450 (define-public python2-rednose
2451 (package-with-python2 python-rednose))
2453 (define-public python-nose-random
2455 (name "python-nose-random")
2461 (url "https://github.com/fzumstein/nose-random")
2463 (file-name (git-file-name name version))
2466 "1dvip61r2frjv35mv6mmfjc07402z73pjbndfp3mhxyjn2zhksw2"))))
2467 (build-system python-build-system)
2469 `(("python-nose" ,python-nose)))
2470 (home-page "https://github.com/fzumstein/nose-random")
2471 (synopsis "Nose plugin to facilitate randomized unit testing with
2473 (description "Python nose-random is designed to facilitate
2474 Monte-Carlo style unit testing. The idea is to improve testing by
2475 running your code against a large number of randomly generated input
2477 (license license:expat)))
2479 (define-public python-nose-randomly
2481 (name "python-nose-randomly")
2486 (uri (pypi-uri "nose-randomly" version))
2488 (base32 "0z662rqhfk4bjmg806mn4frb8nz4gbh7mrddsrhfffp1g4yklj3y"))))
2489 (build-system python-build-system)
2491 `(("python-nose" ,python-nose)
2492 ("python-numpy" ,python-numpy)))
2493 (home-page "https://github.com/adamchainz/nose-randomly")
2495 "Nose plugin to randomly order tests and control random.seed")
2497 "This is a @code{Nose} plugin to randomly order tests which can be quite
2498 powerful in discovering hidden flaws in the tests themselves, while helping to
2499 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
2500 by resetting it to a repeatable number for each test, enabling the tests to
2501 create data based on random numbers and yet remain repeatable.")
2502 (license license:bsd-3)))
2504 (define-public python2-nose-randomly
2505 (package-with-python2 python-nose-randomly))
2507 (define-public python-nose-timer
2509 (name "python-nose-timer")
2514 (uri (pypi-uri "nose-timer" version))
2516 (base32 "05wzkc88vbzw62pqkvhl33211b90kns0lny70b7qw62rcg4flzk4"))))
2517 (build-system python-build-system)
2519 `(("python-nose" ,python-nose)
2520 ("python-termcolor" ,python-termcolor)))
2521 (home-page "https://github.com/mahmoudimus/nose-timer")
2522 (synopsis "Timer plugin for nosetests")
2523 (description "Shows how much time was needed to run individual tests.")
2524 (license license:expat)))
2526 (define-public python2-nose-timer
2527 (package-with-python2 python-nose-timer))
2529 (define-public python-freezegun
2531 (name "python-freezegun")
2536 (uri (pypi-uri "freezegun" version))
2538 (base32 "0al75mk829j1izxi760b7yjnknjihyfhp2mvi5qiyrxb9cpxwqk2"))))
2539 (build-system python-build-system)
2541 `(("python-mock" ,python-mock)
2542 ("python-pytest" ,python-pytest)))
2544 `(("python-six" ,python-six)
2545 ("python-dateutil" ,python-dateutil)))
2548 (modify-phases %standard-phases
2549 ;; The tests are normally executed via `make test`, but the PyPi
2550 ;; package does not include the Makefile.
2553 (invoke "pytest" "-vv"))))))
2554 (home-page "https://github.com/spulec/freezegun")
2555 (synopsis "Test utility for mocking the datetime module")
2557 "FreezeGun is a library that allows your python tests to travel through
2558 time by mocking the datetime module.")
2559 (license license:asl2.0)))
2561 (define-public python2-freezegun
2562 (package-with-python2 python-freezegun))
2564 (define-public python-flexmock
2566 (name "python-flexmock")
2570 (uri (pypi-uri "flexmock" version))
2573 "0b6qw3grhgx58kxlkj7mdma7xdvlj02zabvcf7w2qifnfjwwwcsh"))))
2574 (build-system python-build-system)
2575 (home-page "https://flexmock.readthedocs.org")
2576 (synopsis "Testing library for Python")
2578 "flexmock is a testing library for Python that makes it easy to create
2579 mocks, stubs and fakes.")
2580 (license license:bsd-3)))
2582 (define-public python2-flexmock
2583 (package-with-python2 python-flexmock))
2585 (define-public python-flaky
2587 (name "python-flaky")
2591 (uri (pypi-uri "flaky" version))
2594 "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j"))))
2595 (build-system python-build-system)
2597 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2599 (home-page "https://github.com/box/flaky")
2600 (synopsis "Automatically rerun flaky tests")
2602 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2605 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2606 on components that aren't 100% reliable. With flaky, instead of removing
2607 those tests or marking them to @code{@@skip}, they can be automatically
2609 (license license:asl2.0)))
2611 (define-public python2-flaky
2612 (package-with-python2 python-flaky))
2614 (define-public python-pyhamcrest
2615 ;; The latest release was in 2016 and its test suite does not work with recent
2616 ;; versions of Pytest. Just take the master branch for now, which seems stable.
2617 (let ((commit "25fdc5f00bdf3084335353bc9247253098ec4cf2")
2620 (name "python-pyhamcrest")
2621 (version (git-version "1.9.0" revision commit))
2623 ;; Tests not distributed from pypi release.
2626 (url "https://github.com/hamcrest/PyHamcrest")
2628 (file-name (git-file-name name version))
2631 "1miqmhhi68vaix8sqc1lvpvbm27bacffxh5anm5cbfsvk7g9n6f3"))))
2632 (native-inputs ;all native inputs are for tests
2633 `(("python-pytest-cov" ,python-pytest-cov)
2634 ("python-mock" ,python-mock)
2635 ("python-pytest" ,python-pytest)
2636 ("python-hypothesis" ,python-hypothesis)))
2638 `(("python-six" ,python-six)))
2639 (build-system python-build-system)
2641 `(#:phases (modify-phases %standard-phases
2644 (setenv "PYTHONPATH"
2645 (string-append "build/lib:"
2646 (getenv "PYTHONPATH")))
2647 (invoke "pytest" "-vv"))))))
2648 (home-page "http://hamcrest.org/")
2649 (synopsis "Hamcrest matchers for Python")
2651 "PyHamcrest is a framework for writing matcher objects,
2652 allowing you to declaratively define \"match\" rules.")
2653 (license license:bsd-3))))
2655 (define-public python2-pyhamcrest
2656 (package-with-python2 python-pyhamcrest))
2658 (define-public unittest-cpp
2660 (name "unittest-cpp")
2665 (url "https://github.com/unittest-cpp/unittest-cpp")
2666 (commit (string-append "v" version))))
2667 (file-name (git-file-name name version))
2669 (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
2671 `(#:tests? #f)) ; It's run after build automatically.
2672 (build-system cmake-build-system)
2673 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2674 (synopsis "Lightweight unit testing framework for C++")
2675 (description "UnitTest++ is a lightweight unit testing framework for C++.
2676 It was designed to do test-driven development on a wide variety of platforms.
2677 Simplicity, portability, speed, and small footprint are all very important
2678 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2679 of advanced library and language features, which means it should be easily
2680 portable to just about any platform.")
2681 (license license:expat)))
2683 (define-public libfaketime
2685 (name "libfaketime")
2687 (home-page "https://github.com/wolfcw/libfaketime")
2692 (commit (string-append "v" version))))
2695 "1mfdl82ppgbdvy1ny8mb7xii7p0g7awvn4bn36jb8v4r545slmjc"))
2696 (file-name (git-file-name name version))))
2697 (build-system gnu-build-system)
2699 '(#:phases (modify-phases %standard-phases
2701 (lambda* (#:key outputs #:allow-other-keys)
2702 (let ((out (assoc-ref outputs "out")))
2704 (setenv "PREFIX" out)
2706 ;; XXX: Without this flag, the CLOCK_REALTIME test hangs
2707 ;; indefinitely. See README.packagers for more information.
2708 ;; Try removing this for future versions of libfaketime.
2709 (setenv "FAKETIME_COMPILE_CFLAGS" "-DFORCE_MONOTONIC_FIX")
2712 (add-before 'check 'pre-check
2714 (substitute* "test/functests/test_exclude_mono.sh"
2715 (("/bin/bash") (which "bash")))
2717 ;; Do not fail due to use of 'ftime', which was deprecated in
2718 ;; glibc 2.31. Remove this for later versions of libfaketime.
2719 (setenv "FAKETIME_COMPILE_CFLAGS" "-Wno-deprecated-declarations")
2721 #:test-target "test"))
2723 `(("perl" ,perl))) ;for tests
2724 (synopsis "Fake the system time for single applications")
2726 "The libfaketime library allows users to modify the system time that an
2727 application \"sees\". It is meant to be loaded using the dynamic linker's
2728 @code{LD_PRELOAD} environment variable. The @command{faketime} command
2729 provides a simple way to achieve this.")
2730 (license license:gpl2)))
2732 (define-public umockdev
2738 (uri (string-append "https://github.com/martinpitt/umockdev/"
2739 "releases/download/" version "/"
2740 "umockdev-" version ".tar.xz"))
2743 "0xmi24ckpps32k7hc139psgbsnsf4g106sv4l9m445m46amkxggd"))))
2744 (build-system gnu-build-system)
2747 (modify-phases %standard-phases
2748 (add-after 'unpack 'fix-test
2750 (substitute* "tests/test-umockdev.c"
2755 ("gobject-introspection" ,gobject-introspection)
2756 ("gtk-doc" ,gtk-doc/stable)
2757 ("pkg-config" ,pkg-config)
2765 ("libgudev" ,libgudev)))
2766 (home-page "https://github.com/martinpitt/umockdev/")
2767 (synopsis "Mock hardware devices for creating unit tests")
2768 (description "umockdev mocks hardware devices for creating integration
2769 tests for hardware related libraries and programs. It also provides tools to
2770 record the properties and behaviour of particular devices, and to run a
2771 program or test suite under a test bed with the previously recorded devices
2773 (license license:lgpl2.1+)))
2775 (define-public virtest
2776 ;; No releases yet, so we take the commit that "vc" expects.
2777 (let ((commit "f7d03ef39fceba168745bd29e1b20af6e7971e04")
2781 (version (git-version "0.0" revision commit))
2782 (home-page "https://github.com/mattkretz/virtest")
2785 (uri (git-reference (url home-page) (commit commit)))
2786 (file-name (git-file-name name version))
2789 "07pjyb0mk7y2w1dg1bhl26nb7416xa1mw16ifj6mmps5y6aq054l"))))
2790 (build-system cmake-build-system)
2792 `(#:phases (modify-phases %standard-phases
2793 (add-after 'unpack 'adjust-install-directory
2795 ;; Vc is the only consumer of this library, and expects
2796 ;; to find it in "virtest/vir/" instead of "vir/vir/".
2797 (substitute* "CMakeLists.txt"
2798 (("DESTINATION include/vir")
2799 "DESTINATION include/virtest"))
2801 (synopsis "Header-only test framework")
2803 "@code{virtest} is a small header-only test framework for C++. It
2804 grew out of the @dfn{Vc} project.")
2805 (license license:bsd-3))))
2807 (define-public python-pyfakefs
2809 (name "python-pyfakefs")
2813 ;; We use the PyPI URL because there is no proper release
2814 ;; available from GitHub. The GitHub project only provides
2815 ;; autogenerated tarballs, which are known to change in place.
2816 (uri (pypi-uri "pyfakefs" version))
2819 "1cp2yw96fa2qkgi39xa3nlr3inf8wb5rgh9kdq53256ca2r8pdhy"))
2820 (patches (search-patches
2821 "python-pyfakefs-remove-bad-test.patch"))
2822 (file-name (string-append name "-" version ".tar.gz"))))
2825 (modify-phases %standard-phases
2826 ;; The default test suite does not run these extra tests.
2827 (add-after 'check 'check-pytest-plugin
2830 "python" "-m" "pytest"
2831 "pyfakefs/pytest_tests/pytest_plugin_test.py")
2834 `(("python-pytest" ,python-pytest)))
2835 (build-system python-build-system)
2836 ;; Guix lint doesn't like that this is a permanent redirect to the GitHub
2837 ;; page, but the pyfakefs documentation asks us to use this specific URL
2838 ;; when linking to the project. Honor their request.
2839 (home-page "http://pyfakefs.org/")
2840 ;; TRANSLATORS: In the synopsis, "Mock" is a verb.
2841 (synopsis "Mock file system interactions in tests")
2843 "This package provides a Python library intended for use in automated
2844 tests. One difficulty when testing software is that the code under test might
2845 need to read or write to files in the local file system. If the file system
2846 is not set up in just the right way, it might cause a spurious error during
2847 the test. The pyfakefs library provides a solution to problems like this by
2848 mocking file system interactions. In other words, it arranges for the code
2849 under test to interact with a fake file system instead of the real file
2850 system. The code under test requires no modification to work with pyfakefs.")
2851 (license license:asl2.0)))
2853 ;; This minimal variant is used to avoid a circular dependency between
2854 ;; python2-importlib-metadata, which requires pyfakefs for its tests, and
2855 ;; python2-pytest, which requires python2-importlib-metadata.
2856 (define-public python2-pyfakefs-bootstrap
2859 (inherit (package-with-python2 python-pyfakefs))
2860 (name "python2-pyfakefs-bootstrap")
2863 `(#:python ,python-2
2866 (define-public python-aiounittest
2868 (name "python-aiounittest")
2870 ;; Pypi package lacks tests.
2872 (origin (method git-fetch)
2874 (url "https://github.com/kwarunek/aiounittest.git")
2876 (file-name (git-file-name name version))
2879 "0hql5mw62lclrpblbh7xvinwjfcdcfvhhlvl7xlq2hi9isjq1c8r"))))
2880 (build-system python-build-system)
2882 '(#:phases (modify-phases %standard-phases
2884 (lambda* (#:key tests? #:allow-other-keys)
2886 (invoke "nosetests" "-v")
2887 (format #t "test suite not run~%"))
2889 (propagated-inputs `(("python-wrapt" ,python-wrapt)))
2891 `(("python-coverage" ,python-coverage)
2892 ("python-nose" ,python-nose)))
2894 "https://github.com/kwarunek/aiounittest")
2895 (synopsis "Test asyncio code more easily")
2896 (description "Aiounittest is a library that helps write tests using
2897 asynchronous code in Python (asyncio).")
2898 (license license:expat)))
2900 (define-public python-pytest-dependency
2902 (name "python-pytest-dependency")
2907 (uri (pypi-uri "pytest-dependency" version))
2910 "0swl3mxca7nnjbb5grfzrm3fa2750h9vjsha0f2kyrljc6895a62"))))
2911 (build-system python-build-system)
2913 `(("python-pytest" ,python-pytest)))
2915 "https://github.com/RKrahl/pytest-dependency")
2916 (synopsis "Manage dependencies of tests")
2917 (description "This pytest plugin manages dependencies of tests. It allows
2918 to mark some tests as dependent from other tests. These tests will then be
2919 skipped if any of the dependencies did fail or has been skipped.")
2920 (license license:asl2.0)))
2922 (define-public python-pytest-datadir
2924 (name "python-pytest-datadir")
2929 (uri (pypi-uri "pytest-datadir" version))
2932 "066bg6wlzgq2pqnjp73dfrcmk8951xw3aqcxa3p1axgqimrixbyk"))))
2933 (build-system python-build-system)
2935 `(("python-setuptools-scm" ,python-setuptools-scm)))
2937 `(("python-pytest" ,python-pytest)
2938 ("python-wheel" ,python-wheel)))
2939 (home-page "https://github.com/gabrielcnr/pytest-datadir")
2940 (synopsis "Pytest plugin for manipulating test data directories and files")
2942 "This package provides a Pytest plugin for manipulating test data
2943 directories and files.")
2944 (license license:expat)))