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 Christine Lemmer-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-2022 Marius Bakke <marius@gnu.org>
29 ;;; Copyright © 2017, 2018, 2020, 2021 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, 2021 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-check)
72 #:use-module (gnu packages python-build)
73 #:use-module (gnu packages python-web)
74 #:use-module (gnu packages python-xyz)
75 #:use-module (gnu packages python-science)
76 #:use-module (gnu packages time)
77 #:use-module (gnu packages xml)
78 #:use-module (guix utils)
79 #:use-module ((guix licenses) #:prefix license:)
80 #:use-module (guix packages)
81 #:use-module (guix download)
82 #:use-module (guix gexp)
83 #:use-module (guix git-download)
84 #:use-module (guix build-system cmake)
85 #:use-module (guix build-system glib-or-gtk)
86 #:use-module (guix build-system gnu)
87 #:use-module (guix build-system go)
88 #:use-module (guix build-system meson)
89 #:use-module (guix build-system python)
90 #:use-module (guix build-system trivial)
91 #:use-module (srfi srfi-1))
93 (define-public pedansee
101 (string-append "https://www.flyn.org/projects/"
102 name "/" name "-" version ".tar.gz"))
104 (base32 "0lsg791x6n95pxg6vif8qfc46nqcamhjq3g0dl5xqf6imy7n3acd"))))
105 (build-system glib-or-gtk-build-system)
107 (list clang pkg-config python-wrapper))
110 (synopsis "Code checker for C")
111 (description "Pedansee checks C source files for compliance with a particular
112 programming style. The style is currently defined by the pedansee source code
113 in the form of functions which walk each source file’s syntax tree. You can
114 modify some aspects of this style through the use of regular expressions.")
115 (home-page "https://www.flyn.org/projects/pedansee/")
116 (license license:gpl3+)))
118 (define-public mutest
127 (url "https://github.com/ebassi/mutest")
129 (file-name (git-file-name name version))
131 (base32 "0gdqwq6fvk06wld4rhnw5752hahrvhd69zrci045x25rwx90x26q"))))
132 (build-system meson-build-system)
133 (synopsis "Small C testing library")
134 (description "Mutest aims to be a small unit testing library for C projects,
135 with an API heavily modelled on high level Behavior-Driver Development frameworks
136 like Jasmine or Mocha.")
137 (home-page "https://ebassi.github.io/mutest/mutest.md.html")
138 (license license:expat)))
147 (uri (string-append "https://github.com/libcheck/check/releases/download/"
148 version "/check-" version ".tar.gz"))
151 "02m25y9m46pb6n46s51av62kpd936lkfv3b13kfpckgvmh5lxpm8"))
154 ;; This patch fixes some tests that would otherwise fail on
155 ;; powerpc64le-linux. Without this patch, the tests make certain
156 ;; assumptions about floating point number precision that are not true
159 ;; TODO: Remove this patch when updating to the next check release,
160 ;; since it will be included there. See:
161 ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=47698
165 (string-append "https://github.com/libcheck/check/commit/"
166 "4fbe702fa4f35bee8a90512f9f59d1441c4ae82e.patch"))
167 (file-name (string-append name
168 "-fix-test-precision-for-ppc.patch"))
171 "04qg1p9afdd6453k18qskazrvscysdcjz9j6w4i6p5x4xyma19v6")))))))
172 (build-system gnu-build-system)
173 (home-page "https://libcheck.github.io/check/")
174 (synopsis "Unit test framework for C")
176 "Check is a unit testing framework for C. It features a simple
177 interface for defining unit tests, putting little in the way of the
178 developer. Tests are run in a separate address space, so Check can
179 catch both assertion failures and code errors that cause segmentation
180 faults or other signals. The output from unit tests can be used within
181 source code editors and IDEs.")
182 (license license:lgpl2.1+)))
184 ;; Some packages require older versions. Removed once no longer needed.
185 (define-public check-0.14
191 (uri (string-append "https://github.com/libcheck/check/releases"
192 "/download/" version "/check-" version ".tar.gz"))
195 "02zkfiyklckmivrfvdsrlzvzphkdsgjrz3igncw05dv5pshhq3xx"))))))
197 (define-public check-0.12
203 (uri (string-append "https://github.com/libcheck/check/releases"
204 "/download/" version "/check-" version ".tar.gz"))
207 "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6"))))))
209 (define-public clitest
213 (home-page "https://github.com/aureliojargas/clitest")
216 (uri (git-reference (url home-page) (commit version)))
217 (file-name (git-file-name name version))
220 "1p745mxiq3hgi3ywfljs5sa1psi06awwjxzw0j9c2xx1b09yqv4a"))))
221 (build-system gnu-build-system)
225 #~(modify-phases %standard-phases
226 ;; This package is distributed as a single shell script and comes
227 ;; without a proper build system.
231 (lambda* (#:key tests? #:allow-other-keys)
233 (substitute* "test.md"
234 ;; One test looks for an error from grep in the form "grep: foo",
235 ;; but our grep returns the absolute file name on errors. Adjust
236 ;; the test to cope with that.
237 (("sed 's/\\^e\\*grep: \\.\\*/")
238 "sed 's/.*e*grep: .*/"))
240 (setenv "HOME" "/tmp")
241 (invoke "./clitest" "test.md"))))
244 (install-file "clitest" (string-append #$output "/bin"))
245 (install-file "README.md"
246 (string-append #$output "/share/doc/clitest-"
247 #$(package-version this-package))))))))
249 (list perl)) ;for tests
252 (synopsis "Command line test tool")
254 "@command{clitest} is a portable shell script that performs automatic
255 testing of Unix command lines.")
256 (license license:expat)))
265 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
266 version "/CUnit-" version ".tar.bz2"))
269 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
270 (build-system gnu-build-system)
271 (arguments '(#:phases
272 (modify-phases %standard-phases
273 ;; XXX: The "bootstrap" phase detects the "bootstrap"
274 ;; script, but fails to execute it, so we bootstrap
277 (lambda _ (invoke "autoreconf" "-vfi"))))))
279 (list automake autoconf libtool))
280 (home-page "http://cunit.sourceforge.net/")
281 (synopsis "Automated testing framework for C")
283 "CUnit is a lightweight system for writing, administering, and running
284 unit tests in C. It provides C programmers with basic testing functionality
285 with a flexible variety of user interfaces.")
286 (license license:gpl2+)))
288 (define-public cppunit
294 (uri (string-append "http://dev-www.libreoffice.org/src/"
295 name "-" version ".tar.gz"))
298 "19qpqzy66bq76wcyadmi3zahk5v1ll2kig1nvg96zx9padkcdic9"))))
299 ;; Explicitly link with libdl. This is expected to be done by packages
300 ;; relying on cppunit for their tests. However, not all of them do.
301 ;; If we added the linker flag to such packages, we would pollute all
302 ;; binaries, not only those used for testing.
304 `(#:make-flags '("LDFLAGS=-ldl")))
305 (build-system gnu-build-system)
306 (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
307 (synopsis "Unit testing framework for C++")
308 (description "CppUnit is the C++ port of the famous JUnit framework for
309 unit testing. Test output is in XML for automatic testing and GUI based for
311 (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
313 (define-public shunit2
320 (url "https://github.com/kward/shunit2")
321 (commit (string-append "v" version))))
322 (file-name (git-file-name name version))
325 "08vs0jjl3pfh100sjlw31x4638xj7fghr0j2g1zfikba8n1f9491"))))
326 (build-system gnu-build-system)
329 (modify-phases %standard-phases
330 (delete 'configure) ; no configure script
332 (add-after 'patch-source-shebangs 'patch-more-shebangs
334 (substitute* "shunit2"
335 (("#! /bin/sh") (string-append "#! " (which "sh")))
336 (("/usr/bin/od") (which "od")))
337 (substitute* "test_runner"
338 (("/bin/sh") (which "sh"))
339 (("/bin/bash") (which "bash")))
342 (lambda* (#:key tests? #:allow-other-keys)
344 ;; This test is buggy in the build container.
345 (delete-file "shunit2_misc_test.sh")
346 (invoke "sh" "test_runner"))
349 (lambda* (#:key outputs #:allow-other-keys)
350 (install-file "shunit2"
351 (string-append (assoc-ref outputs "out")
354 (home-page "https://github.com/kward/shunit2")
355 (synopsis "@code{xUnit} based unit testing for Unix shell scripts")
356 (description "@code{shUnit2} was originally developed to provide a
357 consistent testing solution for @code{log4sh}, a shell based logging framework
358 similar to @code{log4j}. It is designed to work in a similar manner to JUnit,
360 (license license:asl2.0)))
362 ;; When dependent packages upgraded to use newer version of catch, this one should
364 (define-public catch-framework
367 (version "1.3.5") ;Sub-minor is the build number
371 (url "https://github.com/philsquared/Catch")
373 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
374 (file-name (string-append name "-" version))
377 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
378 (build-system trivial-build-system)
380 `(#:modules ((guix build utils))
382 (use-modules (guix build utils))
383 (let* ((source (assoc-ref %build-inputs "source"))
384 (output (assoc-ref %outputs "out"))
385 (incdir (string-append output "/include"))
386 (docdir (string-append output "/share/doc/catch-"
388 (for-each mkdir-p (list incdir docdir))
389 (install-file (string-append source
390 "/single_include/catch.hpp")
392 (copy-recursively (string-append source "/docs")
395 (home-page "http://catch-lib.net/")
396 (synopsis "Automated test framework for C++ and Objective-C")
398 "Catch stands for C++ Automated Test Cases in Headers and is a
399 multi-paradigm automated test framework for C++ and Objective-C.")
400 (license license:boost1.0)))
402 (define-public catch-framework2-1
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 "1gdp5wm8khn02g2miz381llw3191k7309qj8s3jd6sasj01rhf23"))))
416 (build-system cmake-build-system)
417 (synopsis "Automated test framework for C++ and Objective-C")
418 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
419 a multi-paradigm automated test framework for C++ and Objective-C.")
420 (license license:boost1.0)))
422 (define-public catch-framework2
426 (home-page "https://github.com/catchorg/Catch2")
430 (url "https://github.com/catchorg/Catch2")
431 (commit (string-append "v" version))))
432 (file-name (git-file-name name version))
435 "18a6d7rcb6ilhxd5dff32jkfdf2ik58pbywrv04ras70217kdq4c"))))
436 (build-system cmake-build-system)
438 (list python-wrapper))
439 (synopsis "Automated test framework for C++ and Objective-C")
440 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
441 a multi-paradigm automated test framework for C++ and Objective-C.")
442 (license license:boost1.0)))
444 (define-public cmdtest
447 ;; Use the latest commit (from 2019) in order to get Python 3 support.
448 (version "0.32-14-gcdfe14e")
452 (url "git://git.liw.fi/cmdtest/")
454 (file-name (git-file-name name version))
457 "1yhcwsqcpckkq5kw3h07k0xg6infyiyzq9ni3nqphrzxis7hxjf1"))))
458 (build-system python-build-system)
459 (arguments `(#:tests? #f)) ;requires Python 2!
461 (list python-coverage-test-runner python))
463 (list python-cliapp python-markdown python-ttystatus))
464 (home-page "https://liw.fi/cmdtest/")
465 (synopsis "Black box Unix program tester")
467 "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
468 given a command line and input files, and the expected output, and it verifies
469 that the command line produces the expected output. If not, it reports a
470 problem, and shows the differences.")
471 (license license:gpl3+)))
473 (define-public cmocka
479 (uri (string-append "https://cmocka.org/files/"
480 (version-major+minor version) "/cmocka-"
484 "1dm8pdvkyfa8dsbz9bpq7wwgixjij4sii9bbn5sgvqjm5ljdik7h"))))
485 (build-system cmake-build-system)
487 `(#:tests? #f)) ; no test target
488 (home-page "https://cmocka.org/")
489 (synopsis "Unit testing framework for C")
490 (description "Cmocka is a unit testing framework for C with support for
491 mock objects. It only requires the standard C library, and works with
492 different compilers. Cmocka supports several different message output formats
493 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
495 (license license:asl2.0)))
497 (define-public cppcheck
504 (url "https://github.com/danmar/cppcheck")
506 (file-name (git-file-name name version))
508 (base32 "03ic5mig3ryzkf85r95ryagf84s7y5nd6sqr915l3zj30apnifvz"))))
509 (build-system cmake-build-system)
511 '(#:configure-flags '("-DBUILD_TESTS=ON")))
512 (home-page "http://cppcheck.sourceforge.net")
513 (synopsis "Static C/C++ code analyzer")
514 (description "Cppcheck is a static code analyzer for C and C++. Unlike
515 C/C++ compilers and many other analysis tools it does not detect syntax errors
516 in the code. Cppcheck primarily detects the types of bugs that the compilers
517 normally do not detect. The goal is to detect only real errors in the code
518 (i.e. have zero false positives).")
519 (license license:gpl3+)))
521 (define-public cxxtest
527 (uri (string-append "mirror://sourceforge/cxxtest/cxxtest/"
528 version "/cxxtest-" version ".tar.gz"))
531 "1n7pbj4z9ivx005hqvivj9ddhq8awynzg6jishfbypf6j7ply58w"))))
532 (build-system python-build-system)
535 (modify-phases %standard-phases
536 (add-after 'unpack 'chdir-to-source
540 (add-after 'install 'install-headers
541 (lambda* (#:key outputs #:allow-other-keys)
542 (let* ((out (assoc-ref outputs "out"))
543 (include-dir (string-append out "/include/cxxtest")))
544 (for-each (lambda (header-file)
545 (install-file header-file include-dir))
546 (find-files "../cxxtest"))
548 (add-after 'install 'install-doc
549 (lambda* (#:key outputs #:allow-other-keys)
550 (let* ((out (assoc-ref outputs "out"))
551 (doc-dir (string-append out "/share/doc/cxxtest")))
552 (install-file "../README" doc-dir)
553 (install-file "../doc/guide.txt" doc-dir)
554 (copy-recursively "../sample" (string-append doc-dir "/sample"))
558 (home-page "https://cxxtest.com/")
559 (synopsis "Unit testing framework for C++")
560 (description "CxxTest is a unit testing framework for C++ that is similar
561 in spirit to JUnit, CppUnit, and xUnit. CxxTest does not require precompiling
562 a CxxTest testing library, it employs no advanced features of C++ (e.g. RTTI)
563 and it supports a very flexible form of test discovery.")
564 (license license:lgpl3+)))
566 (define-public doctest
570 (home-page "https://github.com/onqtam/doctest")
573 (uri (git-reference (url home-page)
574 (commit (string-append "v" version))))
575 (file-name (git-file-name name version))
578 "057wdkv3gcz42mh1j284sgvm16i5fk1f9b1plgvavca70q4p52gz"))))
579 (build-system cmake-build-system)
580 (synopsis "C++ test framework")
582 "doctest is a single-header testing framework for C++11 and later. It
583 has been designed to be fast, light and unintrusive.")
584 (license license:expat)))
586 (define-public go-github.com-smartystreets-gunit
588 (name "go-github.com-smartystreets-gunit")
593 (url "https://github.com/smartystreets/gunit")
595 (file-name (git-file-name name version))
598 "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
599 (build-system go-build-system)
601 '(;; TODO: This package depends on go-github.com-smartystreets-assertions
602 ;; for running the tests, but go-github.com-smartystreets-assertions
603 ;; depends on this package, so break this loop by not running the tests
606 #:import-path "github.com/smartystreets/gunit"))
607 (synopsis "Testing tool for Go, in the style of xUnit")
609 "@code{gunit} allows the test author to use a struct as the scope for a
610 group of related test cases, in the style of xUnit fixtures. This makes
611 extraction of setup/teardown behavior (as well as invoking the system under
612 test) much simpler.")
613 (home-page "https://github.com/smartystreets/gunit")
614 (license license:expat)))
616 (define-public go-github.com-smartystreets-assertions
618 (name "go-github.com-smartystreets-assertions")
623 (url "https://github.com/smartystreets/assertions")
625 (file-name (git-file-name name version))
628 "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
629 (build-system go-build-system)
631 '(#:import-path "github.com/smartystreets/assertions"))
633 (list go-github.com-smartystreets-gunit))
634 (synopsis "Assertions for testing with Go")
636 "The @code{assertions} package provides convenient assertion functions
637 for writing tests in Go.")
638 (home-page "https://github.com/smartystreets/assertions")
639 (license license:expat)))
641 (define-public go-github.com-smartystreets-goconvey
643 (name "go-github.com-smartystreets-goconvey")
648 (url "https://github.com/smartystreets/goconvey")
650 (file-name (git-file-name name version))
653 "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
654 (build-system go-build-system)
656 '(#:import-path "github.com/smartystreets/goconvey"))
658 (list go-github.com-jtolds-gls go-github.com-smartystreets-assertions))
659 (synopsis "Go testing tool with both a web and terminal user interface")
661 "GoConvey is a testing tool for Go. It integrates with go test, can show
662 test coverage and has a web user interface that will refresh automatically.")
663 (home-page "https://github.com/smartystreets/goconvey")
664 (license license:expat)))
666 (define-public googletest
674 (url "https://github.com/google/googletest")
675 (commit (string-append "release-" version))))
676 (file-name (git-file-name name version))
678 (base32 "0pd4y1gpx1z8fiyarkvqlmk6hbv0lc8fr00ivnsvqzi1xg34jfaa"))))
679 (build-system cmake-build-system)
681 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
683 `(("python" ,python-wrapper)))
684 (home-page "https://github.com/google/googletest/")
685 (synopsis "Test discovery and XUnit test framework")
686 (description "Google Test features an XUnit test framework, automated test
687 discovery, death tests, assertions, parameterized tests and XML test report
689 (license license:bsd-3)))
691 (define-public googletest-1.8
698 (url "https://github.com/google/googletest")
699 (commit (string-append "release-" version))))
700 (file-name (git-file-name "googletest" version))
703 "0270msj6n7mggh4xqqjp54kswbl7mkcc8px1p5dqdpmw5ngh9fzk"))))))
705 (define-public googlebenchmark
707 (name "googlebenchmark")
709 (home-page "https://github.com/google/benchmark")
712 (uri (git-reference (url home-page)
713 (commit (string-append "v" version))))
714 (file-name (git-file-name "google-benchmark" version))
717 "1hls0aqqj5cfldn9jfpvzjhpxkhrydrz9crp477rwllwjsybdxw7"))))
718 (build-system cmake-build-system)
720 '(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON"
723 (assoc-ref %build-inputs "googletest")))))
725 `(("googletest" ,(package-source googletest))))
726 (synopsis "C++ library to support the benchmarking of functions")
728 "The googlebenchmark C++ library support the benchmarking of functions,
729 similar to unit tests.")
730 (license license:asl2.0)))
732 (define-public cpputest
739 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
740 version "/cpputest-" version ".tar.gz"))
743 "1xslavlb1974y5xvs8n1j9zkk05dlw8imy4saasrjlmibl895ii1"))))
744 (build-system gnu-build-system)
747 (home-page "https://cpputest.github.io/")
748 (synopsis "Unit testing and mocking framework for C/C++")
750 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
751 C++ but is used in C and C++ projects and frequently used in embedded systems
752 but it works for any C/C++ project.")
753 (license license:bsd-3)))
755 (define-public python-parameterized
757 (name "python-parameterized")
762 (uri (pypi-uri "parameterized" version))
764 (base32 "1444fdz5bj0k10nmhxv0bv2gfrfisi7hfzqdndb0pvhf4g3qq3qr"))))
765 (build-system python-build-system)
767 '(#:phases (modify-phases %standard-phases
769 (lambda* (#:key tests? #:allow-other-keys)
771 (invoke "nosetests" "-v")
772 (format #t "test suite not run~%"))
775 (list python-mock python-nose))
776 (home-page "https://github.com/wolever/parameterized")
777 (synopsis "Parameterized testing with any Python test framework")
779 "Parameterized is a Python library that aims to fix parameterized testing
780 for every Python test framework. It supports nose, py.test, and unittest.")
781 (properties `((python2-variant . ,(delay python2-parameterized))))
782 (license license:bsd-2)))
784 (define-public python2-parameterized
785 (let ((base (package-with-python2 (strip-python2-variant
786 python-parameterized))))
791 (inherit (package-source base))
792 (patches (search-patches "python2-parameterized-docstring-test.patch")))))))
794 (define-public python-minimock
796 (name "python-minimock")
801 (uri (pypi-uri "MiniMock" version))
804 "0k2sxb1ibnyg05iblz7zhbv825f1zk9906rab7883iqgvzmdzpsz"))))
805 (build-system python-build-system)
806 (home-page "https://pypi.org/project/MiniMock")
807 (synopsis "Simple Python library for using mock objects")
808 (description "MiniMock is a simple library for building mock objects with
810 (license license:expat)))
812 (define-public python2-minimock
813 (package-with-python2 python-minimock))
815 (define-public python-mock
822 (uri (pypi-uri "mock" version))
825 "1hrp6j0yrx2xzylfv02qa8kph661m6yq4p0mc8fnimch9j4psrc3"))))
828 (build-system python-build-system)
830 ;; FIXME: Tests require "pytest", which depends on this package.
832 (home-page "https://github.com/testing-cabal/mock")
833 (synopsis "Python mocking and patching library for testing")
835 "Mock is a library for testing in Python. It allows you to replace parts
836 of your system under test with mock objects and make assertions about how they
837 have been used. This library is now part of Python (since Python 3.3),
838 available via the @code{unittest.mock} module.")
839 (properties `((python2-variant . ,(delay python2-mock))))
840 (license license:expat)))
842 (define-public python2-mock
843 (let ((base (package-with-python2
844 (strip-python2-variant python-mock))))
845 (package/inherit base
847 `(("python2-functools32" ,python2-functools32)
848 ("python2-funcsigs" ,python2-funcsigs)
849 ,@(package-propagated-inputs base))))))
851 ;;; This package is unmaintained (see the note at the top of doc/index.rst).
852 (define-public python-nose
859 (uri (pypi-uri "nose" version))
862 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
863 (build-system python-build-system)
866 #:phases (modify-phases %standard-phases
867 (add-after 'unpack 'invoke-2to3
869 (invoke "2to3" "-w" "."))))))
870 (home-page "http://readthedocs.org/docs/nose/")
871 (synopsis "Python testing library")
873 "Nose extends the unittest library to make testing easier.")
874 (license license:lgpl2.0+)
875 (properties `((python2-variant . ,(delay python2-nose))))))
877 (define-public python2-nose
878 (let ((base (package-with-python2
879 (strip-python2-variant python-nose))))
880 (package/inherit base
881 (arguments (substitute-keyword-arguments (package-arguments base)
883 `(modify-phases ,phases
884 (delete 'invoke-2to3))))))))
886 (define-public python-nose2
888 (name "python-nose2")
893 (uri (pypi-uri "nose2" version))
896 "0pmbb6nk31yhgh4zkcblzxsznml7f7pf5q1ihgrwvbxv4mwzfql7"))))
897 (build-system python-build-system)
898 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
900 (list python-cov-core python-pytest-cov python-six))
901 (home-page "https://github.com/nose-devs/nose2")
902 (synopsis "Next generation of nicer testing for Python")
904 "Nose2 is the next generation of nicer testing for Python, based on the
905 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
906 better plugin api, being easier for users to configure, and simplifying internal
907 interfaces and processes.")
908 (license license:bsd-2)))
910 (define-public python2-nose2
911 (package-with-python2 python-nose2))
913 (define-public python-unittest2
915 (name "python-unittest2")
920 (uri (pypi-uri "unittest2" version))
922 (search-patches "python-unittest2-python3-compat.patch"
923 "python-unittest2-remove-argparse.patch"))
926 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
927 (build-system python-build-system)
930 (modify-phases %standard-phases
933 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
935 (list python-six python-traceback2))
936 (home-page "https://pypi.org/project/unittest2/")
937 (synopsis "Python unit testing library")
939 "Unittest2 is a replacement for the unittest module in the Python
941 (license license:psfl)))
943 (define-public python2-unittest2
944 (package-with-python2 python-unittest2))
946 (define-public python-pytest
948 (name "python-pytest")
953 (uri (pypi-uri "pytest" version))
956 "12cyi0lnyaq8sdqfnqlppd76gkw6zcg10gyih5knx9v611l3c6qk"))))
957 (build-system python-build-system)
960 (modify-phases %standard-phases
961 (add-before 'build 'pretend-version
962 ;; The version string is usually derived via setuptools-scm, but
963 ;; without the git metadata available, the version string is set to
966 (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" ,version)))
968 (lambda* (#:key (tests? #t) #:allow-other-keys)
969 (setenv "TERM" "dumb") ;attempt disabling markup tests
971 (invoke "pytest" "-vv" "-k"
973 ;; This test involves the /usr directory, and fails.
974 " not test_argcomplete"
975 ;; These test do not honor the isatty detection and
977 " and not test_code_highlight"
978 " and not test_color_yes"))
979 (format #t "test suite not run~%")))))))
981 `(("python-attrs" ,python-attrs-bootstrap)
982 ("python-iniconfig" ,python-iniconfig)
983 ("python-more-itertools" ,python-more-itertools)
984 ("python-packaging" ,python-packaging-bootstrap)
985 ("python-pluggy" ,python-pluggy)
986 ("python-py" ,python-py)
987 ("python-six" ,python-six-bootstrap)
988 ("python-toml" ,python-toml)
989 ("python-wcwidth" ,python-wcwidth)))
991 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
993 ("python-hypothesis" ,python-hypothesis)
994 ("python-nose" ,python-nose)
995 ("python-mock" ,python-mock)
996 ("python-pytest" ,python-pytest-bootstrap)
997 ("python-setuptools-scm" ,python-setuptools-scm)
998 ("python-toml" ,python-toml)
999 ("python-xmlschema" ,python-xmlschema)))
1000 (home-page "https://docs.pytest.org/en/latest/")
1001 (synopsis "Python testing library")
1003 "Pytest is a testing tool that provides auto-discovery of test modules
1004 and functions, detailed info on failing assert statements, modular fixtures,
1005 and many external plugins.")
1006 (license license:expat)
1007 (properties `((python2-variant . ,(delay python2-pytest))))))
1009 (define-public python-pytest-6 python-pytest)
1011 ;; Pytest 4.x are the last versions that support Python 2.
1012 (define-public python2-pytest
1014 (inherit (strip-python2-variant python-pytest))
1015 (name "python2-pytest")
1019 (uri (pypi-uri "pytest" version))
1022 "0ls3pqr86xgif6bphsb6wrww9r2vc7p7a2naq8zcq8115wwq5yjh"))))
1023 (build-system python-build-system)
1025 `(#:python ,python-2
1026 ,@(package-arguments python-pytest)))
1028 `(("python-atomicwrites" ,python2-atomicwrites)
1029 ("python-attrs" ,python2-attrs-bootstrap)
1030 ("python-funcsigs" ,python2-funcsigs)
1031 ("python-importlib-metadata" ,python2-importlib-metadata-bootstrap)
1032 ("python-more-itertools" ,python2-more-itertools)
1033 ("python-packaging" ,python2-packaging-bootstrap)
1034 ("python-pathlib2" ,python2-pathlib2)
1035 ("python-pluggy" ,python2-pluggy)
1036 ("python-py" ,python2-py)
1037 ("python-six" ,python2-six-bootstrap)
1038 ("python-wcwidth" ,python2-wcwidth)))
1040 `(("bash" ,bash) ;tests require 'compgen'
1041 ("python-hypothesis" ,python2-hypothesis)
1042 ("python-nose" ,python2-nose)
1043 ("python-mock" ,python2-mock)
1044 ("python-pytest" ,python2-pytest-bootstrap)
1045 ("python-setuptools-scm" ,python2-setuptools-scm)))))
1047 (define-public python-pytest-bootstrap
1049 (inherit (strip-python2-variant python-pytest))
1050 (name "python-pytest-bootstrap")
1051 (native-inputs (list python-iniconfig python-setuptools-scm
1053 (arguments `(#:tests? #f))
1054 (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
1056 (define-public python2-pytest-bootstrap
1060 (name "python2-pytest-bootstrap")
1062 (substitute-keyword-arguments (package-arguments python2-pytest)
1063 ((#:tests? _ #f) #f)))
1065 `(("python-setuptools-scm" ,python2-setuptools-scm)))
1067 `(("python-atomicwrites" ,python2-atomicwrites)
1068 ("python-attrs" ,python2-attrs-bootstrap)
1069 ("python-funcsigs" ,python2-funcsigs-bootstrap)
1070 ("python-importlib-metadata" ,python2-importlib-metadata-bootstrap)
1071 ("python-more-itertools" ,python2-more-itertools)
1072 ("python-packaging" ,python2-packaging-bootstrap)
1073 ("python-pathlib2" ,python2-pathlib2-bootstrap)
1074 ("python-pluggy" ,python2-pluggy-bootstrap)
1075 ("python-py" ,python2-py)
1076 ("python-wcwidth" ,python2-wcwidth))))))
1078 (define-public python-pytest-assume
1080 (name "python-pytest-assume")
1085 (uri (pypi-uri "pytest-assume" version))
1087 (base32 "0zilqsy9fcjr6l2f9qzfxpkp40h24csnjm5mifhpmzb0fr9r0glq"))))
1088 (build-system python-build-system)
1090 `(#:phases (modify-phases %standard-phases
1092 (lambda* (#:key tests? #:allow-other-keys)
1094 (invoke "pytest")))))))
1096 (list python-pytest python-six))
1097 (home-page "https://github.com/astraw38/pytest-assume")
1098 (synopsis "Pytest plugin that allows multiple failures per test")
1100 (description "This package provides a Pytest plugin that allows multiple
1101 failures per test. This is a fork from pytest-expect which includes the
1102 following improvements:
1104 @item showlocals support (the Pytest option)
1105 @item global usage support (a fixture is not required)
1106 @item output refinements and tweaks.
1108 (license license:expat)))
1110 (define-public python-pytest-cov
1112 (name "python-pytest-cov")
1117 (uri (pypi-uri "pytest-cov" version))
1119 (base32 "0avzlk9p4nc44k7lpx9109dybq71xqnggxb9f4hp0l64pbc44ryc"))))
1120 (build-system python-build-system)
1123 (modify-phases %standard-phases
1126 ;; Options taken from tox.ini.
1127 ;; TODO: make "--restructuredtext" tests pass. They currently fail
1128 ;; with "Duplicate implicit target name".
1129 (invoke "python" "./setup.py" "check"
1130 "--strict" "--metadata"))))))
1132 (list python-coverage python-pytest))
1133 (home-page "https://github.com/pytest-dev/pytest-cov")
1134 (synopsis "Pytest plugin for measuring coverage")
1136 "Pytest-cov produces coverage reports. It supports centralised testing and
1137 distributed testing in both @code{load} and @code{each} modes. It also
1138 supports coverage of subprocesses.")
1139 (license license:expat)))
1141 (define-public python2-pytest-cov
1142 (package-with-python2 python-pytest-cov))
1144 (define-public python-pytest-httpserver
1146 (name "python-pytest-httpserver")
1150 (uri (pypi-uri "pytest_httpserver" version))
1153 "0vbls0j570l5my83j4jnk5blmnir44i0w511azlh41nl6k8rac5f"))))
1154 (build-system python-build-system)
1156 (list python-pytest))
1158 (list python-werkzeug))
1161 (modify-phases %standard-phases
1162 (add-before 'check 'fix-library-loading
1164 (setenv "GUIX_PYTHONPATH" (string-append (getenv "GUIX_PYTHONPATH") ":."))))
1167 (invoke "pytest" "tests" "-vv")
1168 (invoke "pytest" "tests" "-vv" "--ssl"))))))
1169 (home-page "https://github.com/csernazs/pytest-httpserver")
1170 (synopsis "HTTP server for pytest")
1171 (description "Pytest plugin library to test http clients without
1172 contacting the real http server.")
1173 (license license:expat)))
1175 (define-public python-pytest-random-order
1177 (name "python-pytest-random-order")
1182 (uri (pypi-uri "pytest-random-order" version))
1184 (base32 "0lpzl218l04vjy4gckrbrcacc3w9xrjnvz64bf2i132c58s5j8bb"))))
1185 (build-system python-build-system)
1187 `(#:phases (modify-phases %standard-phases
1189 (lambda* (#:key tests? #:allow-other-keys)
1191 (invoke "python" "-m" "pytest" "--random-order")))))))
1193 (list python-pytest))
1194 (home-page "https://github.com/jbasko/pytest-random-order")
1195 (synopsis "Pytest plugin to randomize the order of tests")
1196 (description "@code{pytest-random-order} is a Pytest plugin that
1197 randomizes the order of tests. This can be useful to detect a test that
1198 passes just because it happens to run after an unrelated test that leaves the
1199 system in a favourable state. The plugin allows user to control the level of
1200 randomness they want to introduce and to disable reordering on subsets of
1201 tests. Tests can be rerun in a specific order by passing a seed value
1202 reported in a previous test run.")
1203 (license license:expat)))
1205 (define-public python-pytest-runner
1207 (name "python-pytest-runner")
1212 (uri (pypi-uri "pytest-runner" version))
1215 "0awll1bva5zy8cspsxcpv7pjcrdf5c6pf56nqn4f74vvmlzfgiwn"))))
1216 (build-system python-build-system)
1218 '(;; FIXME: The test suite requires 'python-flake8' and 'python-black',
1219 ;; but that introduces a circular dependency.
1221 #:phases (modify-phases %standard-phases
1223 (lambda* (#:key tests? #:allow-other-keys)
1225 (invoke "pytest" "-vv")
1226 (format #t "test suite not run~%"))
1229 (list python-setuptools-scm))
1230 (home-page "https://github.com/pytest-dev/pytest-runner")
1231 (synopsis "Invoke py.test as a distutils command")
1233 "This package provides a @command{pytest-runner} command that
1234 @file{setup.py} files can use to run tests.")
1235 (license license:expat)))
1237 (define-public python2-pytest-runner
1238 (package-with-python2 python-pytest-runner))
1240 ;; python-bleach 3.1.0 requires this ancient version of pytest-runner.
1241 ;; Remove once no longer needed.
1242 (define-public python-pytest-runner-2
1244 (inherit python-pytest-runner)
1248 (uri (pypi-uri "pytest-runner" version))
1251 "11ivjj9hfphkv4yfb2g74av4yy86y8gcbf7gbif0p1hcdfnxg3w6"))))))
1253 (define-public python2-pytest-runner-2
1254 (package-with-python2 python-pytest-runner-2))
1256 (define-public python-pytest-lazy-fixture
1258 (name "python-pytest-lazy-fixture")
1263 (uri (pypi-uri "pytest-lazy-fixture" version))
1265 (base32 "1b0hmnsxw4s2wf9pks8dg6dfy5cx3zcbzs8517lfccxsfizhqz8f"))))
1266 (build-system python-build-system)
1269 (modify-phases %standard-phases
1271 (lambda* (#:key inputs outputs #:allow-other-keys)
1272 ;; Make the installed plugin discoverable by Pytest.
1273 (add-installed-pythonpath inputs outputs)
1274 (invoke "pytest" "-vv"))))))
1276 (list python-pytest))
1277 (home-page "https://github.com/tvorog/pytest-lazy-fixture")
1278 (synopsis "Use fixtures in @code{pytest.mark.parametrize}")
1279 (description "This plugin helps to use fixtures in
1280 @code{pytest.mark.parametrize}.")
1281 (license license:expat)))
1283 (define-public python-pytest-mock
1285 (name "python-pytest-mock")
1290 (uri (pypi-uri "pytest-mock" version))
1292 (base32 "0qhfmd05z3g88bnwq6644jl6p5wy01i4yy7h8883z9jjih2pl8a0"))
1293 (modules '((guix build utils)))
1295 ;; Some tests do a string match on Pytest output, and fails when
1296 ;; warnings are present. Adjust to cope with warnings from
1297 ;; third-party libraries (looking at you, pytest-asyncio).
1298 '(substitute* "tests/test_pytest_mock.py"
1299 (("1 passed in \\*")
1301 (build-system python-build-system)
1304 (modify-phases %standard-phases
1306 (lambda* (#:key tests? #:allow-other-keys)
1308 ;; Skip the assertion rewriting tests, which don't work in the
1309 ;; presence of read-only Python modules (a limitation of
1310 ;; Pytest). Also skip the "test_standalone_mock" test, which
1311 ;; can only work when 'python-mock' is not available
1312 ;; (currently propagated by Pytest 5).
1313 (invoke "pytest" "--assert=plain" "-vv"
1314 "-k" "not test_standalone_mock")))))))
1316 (list python-pytest-asyncio python-setuptools-scm))
1318 (list python-pytest))
1319 (home-page "https://github.com/pytest-dev/pytest-mock/")
1320 (synopsis "Thin-wrapper around the mock package for easier use with py.test")
1322 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
1323 around the patching API provided by the @code{mock} package, but with the
1324 benefit of not having to worry about undoing patches at the end of a test.
1325 The mocker fixture has the same API as @code{mock.patch}, supporting the
1327 (properties `((python2-variant . ,(delay python2-pytest-mock))))
1328 (license license:expat)))
1330 (define-public python2-pytest-mock
1331 (let ((base (package-with-python2
1332 (strip-python2-variant python-pytest-mock))))
1333 (package/inherit base
1338 (uri (pypi-uri "pytest-mock" version))
1341 "1i5mg3ff1qk0wqfcxfz60hwy3q5dskdp36i10ckigkzffg8hc3ad"))))
1343 `(#:python ,python-2))
1345 `(("python2-setuptools-scm" ,python2-setuptools-scm)))
1347 `(("python2-mock" ,python2-mock)
1348 ("python2-pytest" ,python2-pytest))))))
1350 (define-public python-pytest-xdist
1352 (name "python-pytest-xdist")
1357 (uri (pypi-uri "pytest-xdist" version))
1360 "0wh6pn66nncfs6ay0n863bgyriwsgppn8flx5l7551j1lbqkinc2"))
1361 (modules '((guix build utils)))
1364 ;; Remove pre-compiled .pyc files from source.
1365 (for-each delete-file-recursively
1366 (find-files "." "__pycache__" #:directories? #t))
1367 (for-each delete-file (find-files "." "\\.pyc$"))
1369 (build-system python-build-system)
1371 '(#:tests? #f ; Lots of tests fail.
1373 (modify-phases %standard-phases
1374 (add-after 'unpack 'patch-setup-py
1376 ;; Relax pytest requirement.
1377 (substitute* "setup.py"
1378 (("pytest>=6\\.0\\.0") "pytest"))))
1380 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
1382 (add-installed-pythonpath inputs outputs)
1383 (invoke "pytest" "-vv"
1384 "-n" (number->string (parallel-job-count)))))))))
1386 (list python-setuptools-scm))
1388 (list python-execnet python-pytest python-py python-pytest-forked))
1390 "https://github.com/pytest-dev/pytest-xdist")
1392 "Plugin for py.test with distributed testing and loop-on-failing modes")
1394 "The pytest-xdist plugin extends py.test with some unique test execution
1395 modes: parallelization, running tests in boxed subprocesses, the ability
1396 to run tests repeatedly when failed, and the ability to run tests on multiple
1397 Python interpreters or platforms. It uses rsync to copy the existing
1398 program code to a remote location, executes there, and then syncs the
1400 (license license:expat)))
1402 (define-public python2-pytest-xdist
1403 (package-with-python2 python-pytest-xdist))
1405 (define-public python-pytest-xdist-next
1406 (package/inherit python-pytest-xdist
1407 (name "python-pytest-xdist")
1412 (uri (pypi-uri "pytest-xdist" version))
1415 "19cy57jrf3pwi7x6fnbxryjvqagsl0yv736jnynvr3yqhlpxxv78"))))
1417 `(("python-execnet" ,python-execnet)
1418 ("python-pytest" ,python-pytest-6)
1419 ("python-pytest-forked" ,python-pytest-forked)))))
1421 (define-public python-pytest-timeout
1423 (name "python-pytest-timeout")
1428 (uri (pypi-uri "pytest-timeout" version))
1431 "04l1cd2qyp3fbccw95a8nqg682r647v7yil8807dgs7xv9a8pyg6"))))
1432 (build-system python-build-system)
1434 '(#:phases (modify-phases %standard-phases
1436 (lambda* (#:key inputs outputs #:allow-other-keys)
1437 ;; Make the installed plugin discoverable by Pytest.
1438 (add-installed-pythonpath inputs outputs)
1439 (invoke "pytest" "-vv"))))))
1441 (list python-pytest python-pytest-cov))
1443 (list python-pexpect))
1444 (home-page "https://github.com/pytest-dev/pytest-timeout")
1445 (synopsis "Plugin for py.test to abort hanging tests")
1447 "This package provides a py.test plugin that aborts hanging tests after a
1448 timeout has been exceeded.")
1449 (license license:expat)))
1451 (define-public python-pytest-forked
1453 (name "python-pytest-forked")
1457 (method git-fetch) ;for tests
1459 (url "https://github.com/pytest-dev/pytest-forked")
1460 (commit (string-append "v" version))))
1461 (file-name (git-file-name name version))
1464 "1aip4kx50ynvykl7kq2mlbsi82vx701dvb8mm64lhp69bbv105rc"))))
1465 (build-system python-build-system)
1468 (modify-phases %standard-phases
1469 (add-after 'unpack 'disable-setuptools-scm
1471 (substitute* "setup.py"
1472 (("use_scm_version=True")
1473 (format #f "version=~s" ,version))
1474 (("setup_requires=\\['setuptools_scm'\\],.*")
1477 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
1479 (add-installed-pythonpath inputs outputs)
1480 (invoke "pytest" "-vv")))))))
1482 ;; XXX: The bootstrap variant of Pytest is used to ensure the
1483 ;; 'hypothesis' plugin is not in the environment (due to
1484 ;; <http://issues.guix.gnu.org/25235>), which would cause the test suite
1485 ;; to fail (see: https://github.com/pytest-dev/pytest-forked/issues/54).
1486 `(("python-pytest" ,python-pytest-bootstrap)))
1487 (home-page "https://github.com/pytest-dev/pytest-forked")
1488 (synopsis "Pytest plugin to run tests in isolated forked subprocesses")
1489 (description "This package provides a Pytest plugin which enables running
1490 each test in a subprocess and will report if a test crashed the process. It
1491 can be useful to isolate tests against undesirable global environment
1492 side-effects (such as setting environment variables).")
1493 (license license:expat)))
1495 (define-public python-scripttest
1497 (name "python-scripttest")
1502 (uri (pypi-uri "scripttest" version))
1505 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
1506 (build-system python-build-system)
1508 (list python-pytest))
1509 (home-page (string-append "https://web.archive.org/web/20161029233413/"
1510 "http://pythonpaste.org/scripttest/"))
1511 (synopsis "Python library to test command-line scripts")
1512 (description "Scripttest is a Python helper library for testing
1513 interactive command-line applications. With it you can run a script in a
1514 subprocess and see the output as well as any file modifications.")
1515 (license license:expat)))
1517 (define-public python-testtools-bootstrap
1519 (name "python-testtools-bootstrap")
1524 (uri (pypi-uri "testtools" version))
1527 "0gxjbjk93jjqi491k4s9rh3ia37v21yifd35pvizv7sgv4rk9hap"))))
1528 (build-system python-build-system)
1529 (arguments '(#:tests? #f))
1531 `(("python-extras" ,python-extras)
1532 ("python-fixtures" ,python-fixtures-bootstrap)
1533 ("python-pbr" ,python-pbr-minimal)))
1534 (home-page "https://github.com/testing-cabal/testtools")
1536 "Extensions to the Python standard library unit testing framework")
1538 "This package is only for bootstrapping. Do not use this.")
1539 (license license:psfl)))
1541 (define-public python-testtools
1543 (inherit python-testtools-bootstrap)
1544 (name "python-testtools")
1547 (modify-phases %standard-phases
1549 (lambda* (#:key tests? #:allow-other-keys)
1551 (invoke "python" "-m" "testtools.run"
1552 "testtools.tests.test_suite")))))))
1554 (list python-extras python-fixtures python-pbr))
1556 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
1558 "Testtools extends the Python standard library unit testing framework to
1559 provide matchers, more debugging information, and cross-Python
1562 (define-public python-testscenarios-bootstrap
1564 (name "python-testscenarios-bootstrap")
1569 (uri (pypi-uri "testscenarios" version))
1572 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
1573 (build-system python-build-system)
1575 `(#:phases (modify-phases %standard-phases
1578 (invoke "python" "-m" "testtools.run"
1579 "testscenarios.test_suite"))))))
1581 `(("python-pbr" ,python-pbr-minimal)
1582 ("python-testtools" ,python-testtools-bootstrap)))
1583 (home-page "https://launchpad.net/testscenarios")
1584 (synopsis "Pyunit extension for dependency injection")
1586 "This package is only for bootstrapping. Don't use this.")
1587 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1589 (define-public python-testscenarios
1591 (inherit python-testscenarios-bootstrap)
1592 (name "python-testscenarios")
1594 (list python-pbr python-testtools))
1596 "Testscenarios provides clean dependency injection for Python unittest
1599 ;; Testresources requires python-pbr at runtime, but pbr needs it for its
1600 ;; own tests. Hence this bootstrap variant.
1601 (define-public python-testresources-bootstrap
1603 (name "python-testresources-bootstrap")
1607 (uri (pypi-uri "testresources" version))
1610 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
1611 (build-system python-build-system)
1612 (arguments '(#:tests? #f))
1614 `(("python-pbr" ,python-pbr-minimal)))
1615 (home-page "https://launchpad.net/testresources")
1617 "Pyunit extension for managing test resources")
1619 "This package is only here for bootstrapping purposes. Use the regular
1620 testresources package instead.")
1621 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1623 (define-public python-testresources
1625 (inherit python-testresources-bootstrap)
1626 (name "python-testresources")
1631 (list python-fixtures python-testtools))
1633 "Testresources is an extension to Python's unittest to allow declarative
1634 use of resources by test cases.")))
1636 (define-public python-subunit-bootstrap
1638 (name "python-subunit-bootstrap")
1643 (uri (pypi-uri "python-subunit" version))
1646 "0j0ymmnc5nfxi1qzvy59j27viqca7l7xd0y9x29g7yr0h693j804"))))
1647 (build-system python-build-system)
1649 (list python-extras python-testtools-bootstrap))
1651 (list python-fixtures-bootstrap python-hypothesis
1652 python-testscenarios-bootstrap))
1653 (home-page "https://launchpad.net/subunit")
1654 (synopsis "Python implementation of the subunit protocol")
1656 "This package is here for bootstrapping purposes only. Use the regular
1657 python-subunit package instead.")
1658 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1660 (define-public python-subunit
1662 (inherit python-subunit-bootstrap)
1663 (name "python-subunit")
1665 (list python-extras python-testtools))
1667 (list python-fixtures python-hypothesis python-testscenarios))
1669 "Python-subunit is a Python implementation of the subunit test streaming
1672 ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
1673 ;; own tests. Hence this bootstrap variant.
1674 (define-public python-fixtures-bootstrap
1676 (name "python-fixtures-bootstrap")
1681 (uri (pypi-uri "fixtures" version))
1684 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))
1685 (patches (search-patches "python-fixtures-remove-monkeypatch-test.patch"))))
1686 (build-system python-build-system)
1690 (modify-phases %standard-phases
1691 ;; Package is not loadable on its own at this stage.
1692 (delete 'sanity-check))))
1694 (list python-pbr-minimal python-six))
1695 (home-page "https://launchpad.net/python-fixtures")
1696 (synopsis "Python test fixture library")
1698 "This package is only used for bootstrapping. Use the regular
1699 python-fixtures package instead.")
1700 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1702 (define-public python-fixtures
1704 (inherit python-fixtures-bootstrap)
1705 (name "python-fixtures")
1708 (modify-phases %standard-phases
1710 (lambda* (#:key tests? #:allow-other-keys)
1712 (invoke "python" "-m" "testtools.run"
1713 "fixtures.test_suite")))))))
1715 ;; Fixtures uses pbr at runtime to check versions, etc.
1716 (list python-pbr python-six))
1718 `(("python-mock" ,python-mock)
1719 ("python-testtools" ,python-testtools-bootstrap)))
1721 "Fixtures provides a way to create reusable state, useful when writing
1724 (define-public python-testrepository-bootstrap
1726 (name "python-testrepository-bootstrap")
1731 (uri (pypi-uri "testrepository" version))
1734 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1735 (build-system python-build-system)
1736 (arguments '(#:tests? #f))
1738 `(("python-fixtures" ,python-fixtures-bootstrap)
1739 ("python-subunit" ,python-subunit-bootstrap)
1740 ("python-testtools" ,python-testtools-bootstrap)))
1742 (list python-mimeparse))
1743 (home-page "https://launchpad.net/testrepository")
1744 (synopsis "Database for Python test results")
1746 "Bootstrap package for python-testrepository. Don't use this.")
1747 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1749 (define-public python-testrepository
1751 (inherit python-testrepository-bootstrap)
1752 (name "python-testrepository")
1754 ;; FIXME: Many tests are failing.
1757 (list python-fixtures python-subunit python-testtools))
1759 (list python-mimeparse))
1760 (description "Testrepository provides a database of test results which can
1761 be used as part of a developer's workflow to check things such as what tests
1762 have failed since the last commit or what tests are currently failing.")))
1764 (define-public python-coverage
1766 (name "python-coverage")
1771 (uri (pypi-uri "coverage" version))
1774 "16z8i18msgs8k74n73dj9x49wzkl0vk4vq8k5pl1bsj70y7b4k53"))))
1775 (build-system python-build-system)
1777 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1779 (home-page "https://coverage.readthedocs.io")
1780 (synopsis "Code coverage measurement for Python")
1782 "Coverage measures code coverage, typically during test execution. It
1783 uses the code analysis tools and tracing hooks provided in the Python standard
1784 library to determine which lines are executable, and which have been
1786 (license license:bsd-3)))
1788 (define-public python2-coverage
1789 (package-with-python2 python-coverage))
1791 (define-public python-pytest-asyncio
1793 (name "python-pytest-asyncio")
1797 (method git-fetch) ;for tests
1799 (url "https://github.com/pytest-dev/pytest-asyncio")
1800 (commit (string-append "v" version))))
1801 (file-name (git-file-name name version))
1803 (base32 "0sl0ckc23m40q6r2xcidsizrgqbbsfa7rwmr80fss359xsydf073"))))
1804 (build-system python-build-system)
1807 #~(modify-phases %standard-phases
1808 (add-after 'unpack 'pretend-version
1810 (setenv "SETUPTOOLS_SCM_PRETEND_VERSION"
1811 #$(package-version this-package))))
1813 (lambda* (#:key tests? #:allow-other-keys)
1814 (invoke "pytest" "-vv" "tests"))))))
1816 (list python-async-generator
1820 python-setuptools-scm))
1821 (home-page "https://github.com/pytest-dev/pytest-asyncio")
1822 (synopsis "Pytest support for asyncio")
1823 (description "Python asyncio code is usually written in the form of
1824 coroutines, which makes it slightly more difficult to test using normal
1825 testing tools. @code{pytest-asyncio} provides useful fixtures and markers
1826 to make testing async code easier.")
1827 (license license:asl2.0)))
1829 (define-public python-cov-core
1831 (name "python-cov-core")
1836 (uri (pypi-uri "cov-core" version))
1839 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1840 (build-system python-build-system)
1842 (list python-coverage))
1843 (home-page "https://github.com/schlamar/cov-core")
1844 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
1846 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1847 and @code{nose2-cov}. It is useful for developing coverage plugins for these
1848 testing frameworks.")
1849 (license license:expat)))
1851 (define-public python2-cov-core
1852 (package-with-python2 python-cov-core))
1854 (define-public python-codecov
1856 (name "python-codecov")
1861 (uri (pypi-uri "codecov" version))
1864 "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1865 (build-system python-build-system)
1867 (list python-unittest2))
1869 (list python-coverage python-requests))
1870 (home-page "https://github.com/codecov/codecov-python")
1871 (synopsis "Upload code coverage reports to @code{codecov.io}")
1873 "Codecov collects code coverage reports from code written in Python, Java,
1874 C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
1875 (license license:asl2.0)))
1877 (define-public python-testpath
1879 (name "python-testpath")
1885 (url "https://github.com/jupyter/testpath")
1887 (file-name (git-file-name name version))
1890 "08r1c6bhvj8pcdvzkqv1950k36a6q3v81fd2p1yqdq3c07mcwgif"))))
1891 (build-system python-build-system)
1895 #~(modify-phases %standard-phases
1896 (add-after 'unpack 'relax-requirements
1898 (substitute* "pyproject.toml"
1899 (("flit_core >=3.2.0,<3.3")
1900 "flit_core >=3.2.0"))))
1901 ;; XXX: PEP 517 manual build copied from python-isort.
1904 (invoke "python" "-m" "build" "--wheel" "--no-isolation" ".")))
1906 (lambda* (#:key tests? #:allow-other-keys)
1908 (invoke "pytest"))))
1911 (let ((whl (car (find-files "dist" "\\.whl$"))))
1912 (invoke "pip" "--no-cache-dir" "--no-input"
1913 "install" "--no-deps" "--prefix" #$output whl)))))))
1915 (list python-pypa-build python-flit-core python-pytest))
1916 (home-page "https://github.com/jupyter/testpath")
1917 (synopsis "Test utilities for code working with files and commands")
1919 "Testpath is a collection of utilities for Python code working with files
1920 and commands. It contains functions to check things on the file system, and
1921 tools for mocking system commands and recording calls to those.")
1922 (license license:expat)))
1924 (define-public python-testlib
1926 (name "python-testlib")
1931 (uri (pypi-uri "testlib" version ".zip"))
1933 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1934 (build-system python-build-system)
1936 (list unzip)) ; for unpacking the source
1937 (synopsis "Python micro test suite harness")
1938 (description "A micro unittest suite harness for Python.")
1939 (home-page "https://github.com/trentm/testlib")
1940 (license license:expat)))
1942 (define-public python2-testlib
1943 (package-with-python2 python-testlib))
1945 ;;; The software provided by this package was integrated into pytest 2.8.
1946 (define-public python-pytest-cache
1948 (name "python-pytest-cache")
1952 (uri (pypi-uri "pytest-cache" version))
1955 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1956 (build-system python-build-system)
1958 (list python-apipkg python-execnet python-py python-pytest))
1959 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1960 (description "The pytest-cache plugin provides tools to rerun failures from
1961 the last py.test invocation.")
1962 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1963 (license license:expat)))
1965 (define-public python2-pytest-cache
1966 (package-with-python2 python-pytest-cache))
1968 (define-public python-pytest-localserver
1970 (name "python-pytest-localserver")
1974 (uri (pypi-uri "pytest-localserver" version))
1977 "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
1978 (build-system python-build-system)
1981 (modify-phases %standard-phases
1984 (invoke "py.test" "-v"))))))
1986 (list python-pytest python-requests python-six))
1988 (list python-werkzeug))
1989 (synopsis "Py.test plugin to test server connections locally")
1990 (description "Pytest-localserver is a plugin for the pytest testing
1991 framework which enables you to test server connections locally.")
1992 (home-page "https://pypi.org/project/pytest-localserver/")
1993 (license license:expat)))
1995 (define-public python-pytest-xprocess
1997 (name "python-pytest-xprocess")
2001 (uri (pypi-uri "pytest-xprocess" version))
2004 "0rm2rchrr63imn44xk5slwydxf8gvy579524qcxq7dc42pnk17zx"))))
2005 (build-system python-build-system)
2007 (list python-setuptools-scm))
2009 (list python-pytest python-psutil))
2010 (synopsis "Pytest plugin to manage external processes across test runs")
2011 (description "Pytest-xprocess is an experimental py.test plugin for managing
2012 processes across test runs.")
2013 (home-page "https://github.com/pytest-dev/pytest-xprocess/")
2014 (license license:expat)))
2016 (define-public python-pytest-subtesthack
2018 (name "python-pytest-subtesthack")
2022 (uri (pypi-uri "pytest-subtesthack" version))
2025 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
2026 (build-system python-build-system)
2028 (list python-pytest))
2029 (synopsis "Set-up and tear-down fixtures for unit tests")
2030 (description "This plugin allows you to set up and tear down fixtures within
2031 unit test functions that use @code{py.test}. This is useful for using
2032 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
2033 function multiple times, without setting up or tearing down fixture state as is
2034 normally the case.")
2035 (home-page "https://github.com/untitaker/pytest-subtesthack/")
2036 (license license:unlicense)))
2038 (define-public python2-pytest-subtesthack
2039 (package-with-python2 python-pytest-subtesthack))
2041 (define-public python-pytest-sugar
2043 (name "python-pytest-sugar")
2048 (uri (pypi-uri "pytest-sugar" version))
2050 (base32 "1i0hv3h49zvl62jbiyjag84carbrp3zprqzxffdr291nxavvac0n"))))
2051 (build-system python-build-system)
2053 (list python-packaging python-pytest python-termcolor))
2054 (home-page "https://pivotfinland.com/pytest-sugar/")
2055 (synopsis "Plugin for pytest that changes the default look and feel")
2057 "@code{pytest-sugar} is a plugin for py.test that changes the default
2058 look and feel of py.test, using a progress bar and showing failures and errors
2060 (license license:bsd-3)))
2062 (define-public python-hypothesis
2064 (name "python-hypothesis")
2068 (uri (pypi-uri "hypothesis" version))
2071 "0wj7ip779naf2n076nylf2gi0sjz68z1ir9d9r2rgs7br18naqdf"))))
2072 (build-system python-build-system)
2074 ;; XXX: Tests are not distributed with the PyPI archive.
2077 `(("python-attrs" ,python-attrs-bootstrap)
2078 ("python-sortedcontainers" ,python-sortedcontainers)))
2079 (synopsis "Library for property based testing")
2080 (description "Hypothesis is a library for testing your Python code against a
2081 much larger range of examples than you would ever want to write by hand. It’s
2082 based on the Haskell library, Quickcheck, and is designed to integrate
2083 seamlessly into your existing Python unit testing work flow.")
2084 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
2085 (license license:mpl2.0)
2086 (properties `((python2-variant . ,(delay python2-hypothesis))))))
2088 (define-public python-hypothesis-6.23
2090 (inherit python-hypothesis)
2094 (uri (pypi-uri "hypothesis" version))
2097 "0wp8i9qmd5wl1sq1l2b97fgliyk5fyphssl6j7q5qn5zjlfgi4qs"))))))
2099 ;; This is the last version of Hypothesis that supports Python 2.
2100 (define-public python2-hypothesis
2101 (let ((hypothesis (package-with-python2
2102 (strip-python2-variant python-hypothesis))))
2103 (package (inherit hypothesis)
2107 (uri (pypi-uri "hypothesis" version))
2110 "183gpxbfcdhdqzlahkji5a71n6lmvgqsbkcb0ihqad51n2j6jhrw"))))
2112 (modify-inputs (package-propagated-inputs hypothesis)
2113 (prepend python2-enum34))))))
2115 (define-public python-hypothesmith
2117 (name "python-hypothesmith")
2122 (uri (pypi-uri "hypothesmith" version))
2125 "02j101m5grjrbvrgjap17jsxd1hgawkylmyswcn33vf42mxh9zzr"))))
2126 (build-system python-build-system)
2128 (list python-hypothesis python-lark-parser python-libcst-minimal))
2129 (home-page "https://github.com/Zac-HD/hypothesmith")
2130 (synopsis "Strategies for generating Python programs")
2132 "This package contains hypothesis strategies for generating Python
2133 programs, something like CSmith, a random generator of C programs.")
2134 (license license:mpl2.0)))
2136 (define-public python-lit
2143 (uri (pypi-uri "lit" version))
2146 "01yggsb73s2gbq36xwifxl6k5ll5lkss5rwz59k9h3jnbnn7m5fj"))))
2147 (build-system python-build-system)
2150 (modify-phases %standard-phases
2153 (invoke "python" "lit.py" "tests"))))))
2156 (home-page "https://llvm.org/")
2157 (synopsis "LLVM Software Testing Tool")
2158 (description "@code{lit} is a portable tool for executing LLVM and Clang
2159 style test suites, summarizing their results, and providing indication of
2161 (license license:ncsa)))
2163 (define-public python-pytest-pep8
2165 (name "python-pytest-pep8")
2169 (uri (pypi-uri "pytest-pep8" version))
2172 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
2173 (build-system python-build-system)
2175 `(#:tests? #f ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
2177 (modify-phases %standard-phases
2178 (add-after 'unpack 'fix-dependencies
2180 (substitute* "setup.py"
2181 (("'pytest-cache', ") "")))) ; Included in recent pytest
2183 (lambda* (#:key tests? inputs outputs #:allow-other-keys)
2185 (add-installed-pythonpath inputs outputs)
2186 (invoke "pytest" "-v")))))))
2188 (list python-pytest))
2191 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
2192 (synopsis "Py.test plugin to check PEP8 requirements")
2193 (description "Pytest plugin for checking PEP8 compliance.")
2194 (license license:expat)))
2196 (define-public python2-pytest-pep8
2197 (package-with-python2 python-pytest-pep8))
2199 (define-public python-pytest-flakes
2201 (name "python-pytest-flakes")
2205 (uri (pypi-uri "pytest-flakes" version))
2208 "0045h3hnrkn2jwr42jgy2j98npx4amwr6wxzi9j0nppaqz33l49p"))))
2209 (build-system python-build-system)
2212 (modify-phases %standard-phases
2214 (add-after 'install 'check
2215 (lambda* (#:key outputs inputs #:allow-other-keys)
2216 ;; It's easier to run tests after install.
2217 ;; Make installed package available for running the tests
2218 (add-installed-pythonpath inputs outputs)
2219 (invoke "py.test" "-vv" "-k" "not test_syntax_error"))))))
2221 (list python-coverage python-pytest python-pytest-cache
2222 python-pytest-pep8))
2224 (list python-pyflakes))
2225 (home-page "https://github.com/fschulze/pytest-flakes")
2226 (synopsis "Py.test plugin to check source code with pyflakes")
2227 (description "Pytest plugin for checking Python source code with pyflakes.")
2228 (license license:expat)))
2230 (define-public python2-pytest-flakes
2231 (package-with-python2 python-pytest-flakes))
2233 (define-public python-coverage-test-runner
2235 (name "python-coverage-test-runner")
2241 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
2242 "coverage-test-runner/snapshot/coverage-test-runner-"
2246 "1kjjb9llckycnfxag8zcvqsn4z1s3dwyw6b1n0avxydihgf30rny"))))
2247 (build-system python-build-system)
2250 (modify-phases %standard-phases
2253 (invoke "./testrun"))))))
2255 (list python-coverage))
2256 (home-page "https://liw.fi/coverage-test-runner/")
2257 (synopsis "Python module for running unit tests")
2258 (description "@code{CoverageTestRunner} is a python module for running
2259 unit tests and failing them if the unit test module does not exercise all
2260 statements in the module it tests.")
2261 (license license:gpl3+)))
2263 (define-public python2-coverage-test-runner
2264 (package-with-python2 python-coverage-test-runner))
2266 (define-public python-pylint
2268 (name "python-pylint")
2274 (url "https://github.com/PyCQA/pylint")
2275 (commit (string-append "v" version))))
2276 (file-name (git-file-name name version))
2278 (base32 "0spmy7j1vvh55shzgma80q61y0d1cj45dcgslb4g5w3y602miq5i"))))
2279 (build-system python-build-system)
2282 (modify-phases %standard-phases
2284 (lambda* (#:key tests? #:allow-other-keys)
2286 ;; The unused but collected 'primer'-related test files require
2287 ;; the extraneous 'git' Python module; remove them.
2288 (delete-file "tests/primer/test_primer_external.py")
2289 (delete-file "tests/testutils/test_package_to_lint.py")
2290 (setenv "HOME" "/tmp")
2291 (invoke "pytest" "-k" "test_functional")))))))
2293 (list python-pytest))
2295 (list python-astroid
2300 python-typing-extensions))
2301 (home-page "https://github.com/PyCQA/pylint")
2302 (synopsis "Advanced Python code static checker")
2303 (description "Pylint is a Python source code analyzer which looks
2304 for programming errors, helps enforcing a coding standard and sniffs
2305 for some code smells (as defined in Martin Fowler's Refactoring book).
2307 Pylint has many rules enabled by default, way too much to silence them
2308 all on a minimally sized program. It's highly configurable and handle
2309 pragmas to control it from within your code. Additionally, it is
2310 possible to write plugins to add your own checks.")
2311 (license license:gpl2+)))
2313 (define-public python-paramunittest
2315 (name "python-paramunittest")
2320 (uri (pypi-uri "ParamUnittest" version))
2323 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
2324 (build-system python-build-system)
2326 "https://github.com/rik0/ParamUnittest")
2328 "Simple extension to have parametrized unit tests")
2330 "This package creates parameterized unit-tests that work with the standard
2331 unittest package. A parameterized test case is automatically converted to multiple test
2332 cases. Since they are TestCase subclasses, they work with other test suites that
2333 recognize TestCases.")
2334 (license license:bsd-2)))
2336 (define-public python2-python-paramunittest
2337 (package-with-python2 python-paramunittest))
2339 (define-public python-pytest-warnings
2341 (name "python-pytest-warnings")
2346 (uri (pypi-uri "pytest-warnings" version))
2349 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
2350 (build-system python-build-system)
2352 (list python-pytest))
2353 (home-page "https://github.com/fschulze/pytest-warnings")
2354 (synopsis "Pytest plugin to list Python warnings in pytest report")
2356 "Python-pytest-warnings is a pytest plugin to list Python warnings in
2358 (license license:expat)
2359 (properties `((python2-variant . ,(delay python2-pytest-warnings))
2360 ;; This package is part of pytest as of version 3.1.0.
2361 (superseded . ,python-pytest)))))
2363 (define-public python2-pytest-warnings
2364 (package (inherit (package-with-python2
2365 (strip-python2-variant python-pytest-warnings)))
2366 (properties `((superseded . ,python2-pytest)))))
2368 (define-public python-pytest-capturelog
2370 (name "python-pytest-capturelog")
2375 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
2378 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
2379 (build-system python-build-system)
2381 (list python-pytest))
2382 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
2383 (synopsis "Pytest plugin to catch log messages")
2385 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
2386 (license license:expat)))
2388 (define-public python2-pytest-capturelog
2389 (package-with-python2 python-pytest-capturelog))
2391 (define-public python-pytest-catchlog
2393 (name "python-pytest-catchlog")
2398 (uri (pypi-uri "pytest-catchlog" version ".zip"))
2401 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
2402 (build-system python-build-system)
2406 (list python-pytest))
2407 (home-page "https://github.com/eisensheng/pytest-catchlog")
2408 (synopsis "Pytest plugin to catch log messages")
2410 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
2411 a fork of pytest-capturelog.")
2412 (license license:expat)))
2414 (define-public python2-pytest-catchlog
2415 (package-with-python2 python-pytest-catchlog))
2417 (define-public python-nosexcover
2419 (name "python-nosexcover")
2423 (uri (pypi-uri "nosexcover" version))
2426 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
2427 (build-system python-build-system)
2429 (list python-coverage python-nose))
2430 (home-page "https://github.com/cmheisel/nose-xcover")
2431 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
2432 (description "Nose-xcover is a companion to the built-in
2433 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
2434 to a file named coverage.xml.
2436 It will honor all the options you pass to the Nose coverage plugin,
2437 especially -cover-package.")
2438 (license license:expat)))
2440 (define-public python2-nosexcover
2441 (package-with-python2 python-nosexcover))
2443 (define-public python-discover
2445 (name "python-discover")
2450 (uri (pypi-uri "discover" version))
2453 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
2454 (build-system python-build-system)
2455 (home-page "https://pypi.org/project/discover/")
2457 "Python test discovery for unittest")
2459 "Discover provides test discovery for unittest, a feature that has been
2460 backported from Python 2.7 for Python 2.4+.")
2461 (license license:bsd-3)))
2463 (define-public python2-discover
2464 (package-with-python2 python-discover))
2466 (define-public behave
2469 ;; The 1.2.6 release from 2018 has several problems with newer Python
2470 ;; versions, so we package a recent snapshot.
2471 (version "1.2.7.dev2")
2475 (url "https://github.com/behave/behave")
2476 (commit (string-append "v" version))))
2477 (file-name (git-file-name name version))
2480 "0sv94wagi214h0l91zn8m04f78x5wn83vqxib81hnl1qahvx9hq7"))))
2481 (build-system python-build-system)
2483 '(#:phases (modify-phases %standard-phases
2485 (lambda* (#:key tests? #:allow-other-keys)
2487 (invoke "pytest" "-c" "/dev/null" "-vv")))))))
2489 (list python-mock python-nose python-pathpy python-pyhamcrest
2492 (list python-colorama
2493 python-cucumber-tag-expressions
2496 (home-page "https://github.com/behave/behave")
2497 (synopsis "Python behavior-driven development")
2499 "Behave is a tool for behavior-driven development in python.
2500 Behavior-driven development (or BDD) is an agile software development
2501 technique that encourages collaboration between developers, QA and
2502 non-technical or business participants in a software project. Behave uses
2503 tests written in a natural language style, backed up by Python code.")
2504 (license license:x11)))
2506 (define-public python-behave-web-api
2508 (name "python-behave-web-api")
2513 (uri (pypi-uri "behave-web-api" version))
2516 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
2517 (build-system python-build-system)
2520 (modify-phases %standard-phases
2521 (add-after 'unpack 'fix-dependencies
2523 (substitute* "setup.py"
2524 (("'wheel'") "") ; We don't use it.
2525 (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
2528 (list behave python-requests))
2529 (home-page "https://github.com/jefersondaniel/behave-web-api")
2530 (synopsis "Provides testing for JSON APIs with Behave for Python")
2531 (description "This package provides testing utility modules for testing
2532 JSON APIs with Behave.")
2533 (license license:expat)))
2535 (define-public python-rednose
2537 (name "python-rednose")
2542 (uri (pypi-uri "rednose" version))
2545 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
2546 (build-system python-build-system)
2548 `(#:phases (modify-phases %standard-phases
2549 (add-after 'unpack 'patch-setup.py
2551 ;; Six is only required for tests and later versions
2553 (substitute* "setup.py"
2554 (("six==1.10.0") "six"))
2557 (list python-colorama python-termstyle))
2559 (list python-six python-nose))
2560 (home-page "https://github.com/JBKahn/rednose")
2561 (synopsis "Colored output for Python nosetests")
2562 (description "This package provides colored output for the
2563 @command{nosetests} command of the Python Nose unit test framework.")
2564 (license license:bsd-3)))
2566 (define-public python2-rednose
2567 (package-with-python2 python-rednose))
2569 (define-public python-nose-random
2571 (name "python-nose-random")
2577 (url "https://github.com/fzumstein/nose-random")
2579 (file-name (git-file-name name version))
2582 "1dvip61r2frjv35mv6mmfjc07402z73pjbndfp3mhxyjn2zhksw2"))))
2583 (build-system python-build-system)
2586 (home-page "https://github.com/fzumstein/nose-random")
2587 (synopsis "Nose plugin to facilitate randomized unit testing with
2589 (description "Python nose-random is designed to facilitate
2590 Monte-Carlo style unit testing. The idea is to improve testing by
2591 running your code against a large number of randomly generated input
2593 (license license:expat)))
2595 (define-public python-nose-randomly
2597 (name "python-nose-randomly")
2602 (uri (pypi-uri "nose-randomly" version))
2604 (base32 "0z662rqhfk4bjmg806mn4frb8nz4gbh7mrddsrhfffp1g4yklj3y"))))
2605 (build-system python-build-system)
2607 (list python-nose python-numpy))
2608 (home-page "https://github.com/adamchainz/nose-randomly")
2610 "Nose plugin to randomly order tests and control random.seed")
2612 "This is a @code{Nose} plugin to randomly order tests which can be quite
2613 powerful in discovering hidden flaws in the tests themselves, while helping to
2614 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
2615 by resetting it to a repeatable number for each test, enabling the tests to
2616 create data based on random numbers and yet remain repeatable.")
2617 (license license:bsd-3)))
2619 (define-public python2-nose-randomly
2620 (package-with-python2 python-nose-randomly))
2622 (define-public python-nose-timer
2624 (name "python-nose-timer")
2629 (uri (pypi-uri "nose-timer" version))
2631 (base32 "05wzkc88vbzw62pqkvhl33211b90kns0lny70b7qw62rcg4flzk4"))))
2632 (build-system python-build-system)
2634 (list python-nose python-termcolor))
2635 (home-page "https://github.com/mahmoudimus/nose-timer")
2636 (synopsis "Timer plugin for nosetests")
2637 (description "Shows how much time was needed to run individual tests.")
2638 (license license:expat)))
2640 (define-public python2-nose-timer
2641 (package-with-python2 python-nose-timer))
2643 (define-public python-freezegun
2645 (name "python-freezegun")
2650 (uri (pypi-uri "freezegun" version))
2652 (base32 "0al75mk829j1izxi760b7yjnknjihyfhp2mvi5qiyrxb9cpxwqk2"))))
2653 (build-system python-build-system)
2655 (list python-mock python-pytest))
2657 (list python-six python-dateutil))
2660 (modify-phases %standard-phases
2661 ;; The tests are normally executed via `make test`, but the PyPi
2662 ;; package does not include the Makefile.
2665 (invoke "pytest" "-vv"))))))
2666 (home-page "https://github.com/spulec/freezegun")
2667 (synopsis "Test utility for mocking the datetime module")
2669 "FreezeGun is a library that allows your python tests to travel through
2670 time by mocking the datetime module.")
2671 (license license:asl2.0)))
2673 (define-public python2-freezegun
2674 (package-with-python2 python-freezegun))
2676 (define-public python-flexmock
2678 (name "python-flexmock")
2682 (uri (pypi-uri "flexmock" version))
2685 "0b6qw3grhgx58kxlkj7mdma7xdvlj02zabvcf7w2qifnfjwwwcsh"))))
2686 (build-system python-build-system)
2687 (home-page "https://flexmock.readthedocs.org")
2688 (synopsis "Testing library for Python")
2690 "flexmock is a testing library for Python that makes it easy to create
2691 mocks, stubs and fakes.")
2692 (license license:bsd-3)))
2694 (define-public python2-flexmock
2695 (package-with-python2 python-flexmock))
2697 (define-public python-flaky
2699 (name "python-flaky")
2703 (uri (pypi-uri "flaky" version))
2706 "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j"))))
2707 (build-system python-build-system)
2709 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2711 (home-page "https://github.com/box/flaky")
2712 (synopsis "Automatically rerun flaky tests")
2714 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2717 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2718 on components that aren't 100% reliable. With flaky, instead of removing
2719 those tests or marking them to @code{@@skip}, they can be automatically
2721 (license license:asl2.0)))
2723 (define-public python2-flaky
2724 (package-with-python2 python-flaky))
2726 (define-public python-pyhamcrest
2728 (name "python-pyhamcrest")
2731 (method git-fetch) ;no tests in PyPI archive
2733 (url "https://github.com/hamcrest/PyHamcrest")
2734 (commit (string-append "V" version))))
2735 (file-name (git-file-name name version))
2738 "05kdzlhs2kvj82pfca13qszszcj6dyrk4b9pbr46x06sq2s4qyls"))))
2739 (native-inputs ;all native inputs are for tests
2740 (list python-pytest-cov python-mock python-pytest python-hypothesis))
2741 (build-system python-build-system)
2743 `(#:phases (modify-phases %standard-phases
2745 (lambda* (#:key inputs outputs #:allow-other-keys)
2746 (add-installed-pythonpath inputs outputs)
2747 (invoke "pytest" "-vv"))))))
2748 (home-page "http://hamcrest.org/")
2749 (synopsis "Hamcrest matchers for Python")
2750 (description "PyHamcrest is a framework for writing matcher objects,
2751 allowing you to declaratively define \"match\" rules.")
2752 (license license:bsd-3)))
2754 (define-public unittest-cpp
2756 (name "unittest-cpp")
2761 (url "https://github.com/unittest-cpp/unittest-cpp")
2762 (commit (string-append "v" version))))
2763 (file-name (git-file-name name version))
2765 (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
2767 `(#:tests? #f)) ; It's run after build automatically.
2768 (build-system cmake-build-system)
2769 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2770 (synopsis "Lightweight unit testing framework for C++")
2771 (description "UnitTest++ is a lightweight unit testing framework for C++.
2772 It was designed to do test-driven development on a wide variety of platforms.
2773 Simplicity, portability, speed, and small footprint are all very important
2774 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2775 of advanced library and language features, which means it should be easily
2776 portable to just about any platform.")
2777 (license license:expat)))
2779 (define-public libfaketime
2781 (name "libfaketime")
2783 (home-page "https://github.com/wolfcw/libfaketime")
2788 (commit (string-append "v" version))))
2791 "1gi1xciqga5hl2xlk7rc3j8wy47ag97pi7ngmdl6ny1d11b2wn1z"))
2792 (file-name (git-file-name name version))))
2793 (build-system gnu-build-system)
2795 `(#:phases (modify-phases %standard-phases
2796 (add-after 'unpack 'embed-date-reference
2797 (lambda* (#:key inputs #:allow-other-keys)
2798 (let ((coreutils (assoc-ref inputs "coreutils")))
2799 (substitute* "src/faketime.c"
2801 (string-append "\"" coreutils "/bin/date\""))))))
2803 (lambda* (#:key outputs #:allow-other-keys)
2804 (let ((out (assoc-ref outputs "out")))
2805 (setenv "CC" ,(cc-for-target))
2806 (setenv "PREFIX" out)
2808 ;; XXX: Without this flag, the CLOCK_REALTIME test hangs
2809 ;; indefinitely. See README.packagers for more information.
2810 ;; There are specific instructions to not enable more flags
2811 ;; than absolutely needed.
2812 ,(if (or (target-ppc64le?)
2814 `(setenv "FAKETIME_COMPILE_CFLAGS"
2815 "-DFORCE_MONOTONIC_FIX -DFORCE_PTHREAD_NONVER")
2816 `(setenv "FAKETIME_COMPILE_CFLAGS"
2817 "-DFORCE_MONOTONIC_FIX")))))
2818 (add-before 'check 'pre-check
2820 (substitute* "test/functests/test_exclude_mono.sh"
2821 (("/bin/bash") (which "bash"))))))
2822 #:test-target "test"))
2824 (list perl)) ;for tests
2827 (synopsis "Fake the system time for single applications")
2829 "The libfaketime library allows users to modify the system time that an
2830 application \"sees\". It is meant to be loaded using the dynamic linker's
2831 @code{LD_PRELOAD} environment variable. The @command{faketime} command
2832 provides a simple way to achieve this.")
2833 (license license:gpl2)))
2835 (define-public umockdev
2841 (uri (string-append "https://github.com/martinpitt/umockdev/"
2842 "releases/download/" version "/"
2843 "umockdev-" version ".tar.xz"))
2846 "0xmi24ckpps32k7hc139psgbsnsf4g106sv4l9m445m46amkxggd"))))
2847 (build-system gnu-build-system)
2850 (modify-phases %standard-phases
2851 (add-after 'unpack 'fix-test
2853 (substitute* "tests/test-umockdev.c"
2858 gobject-introspection
2865 (list glib eudev libgudev))
2866 (home-page "https://github.com/martinpitt/umockdev/")
2867 (synopsis "Mock hardware devices for creating unit tests")
2868 (description "umockdev mocks hardware devices for creating integration
2869 tests for hardware related libraries and programs. It also provides tools to
2870 record the properties and behaviour of particular devices, and to run a
2871 program or test suite under a test bed with the previously recorded devices
2873 (license license:lgpl2.1+)))
2875 (define-public virtest
2876 ;; No releases yet, so we take the commit that "vc" expects.
2877 (let ((commit "f7d03ef39fceba168745bd29e1b20af6e7971e04")
2881 (version (git-version "0.0" revision commit))
2882 (home-page "https://github.com/mattkretz/virtest")
2885 (uri (git-reference (url home-page) (commit commit)))
2886 (file-name (git-file-name name version))
2889 "07pjyb0mk7y2w1dg1bhl26nb7416xa1mw16ifj6mmps5y6aq054l"))))
2890 (build-system cmake-build-system)
2892 `(#:phases (modify-phases %standard-phases
2893 (add-after 'unpack 'adjust-install-directory
2895 ;; Vc is the only consumer of this library, and expects
2896 ;; to find it in "virtest/vir/" instead of "vir/vir/".
2897 (substitute* "CMakeLists.txt"
2898 (("DESTINATION include/vir")
2899 "DESTINATION include/virtest"))
2901 (synopsis "Header-only test framework")
2903 "@code{virtest} is a small header-only test framework for C++. It
2904 grew out of the @dfn{Vc} project.")
2905 (license license:bsd-3))))
2907 (define-public python-pyfakefs
2909 (name "python-pyfakefs")
2913 ;; We use the PyPI URL because there is no proper release
2914 ;; available from GitHub. The GitHub project only provides
2915 ;; autogenerated tarballs, which are known to change in place.
2916 (uri (pypi-uri "pyfakefs" version))
2919 "1cp2yw96fa2qkgi39xa3nlr3inf8wb5rgh9kdq53256ca2r8pdhy"))
2920 (patches (search-patches
2921 "python-pyfakefs-remove-bad-test.patch"))
2922 (file-name (string-append name "-" version ".tar.gz"))))
2925 (modify-phases %standard-phases
2926 (add-after 'unpack 'patch-testsuite
2928 ;; Time difference is larger than expected.
2929 (substitute* "pyfakefs/tests/fake_filesystem_unittest_test.py"
2930 (("(\\s+)def test_copy_real_file" all indent)
2933 "@unittest.skip('disabled by guix')\n"
2935 ;; The default test suite does not run these extra tests.
2936 (add-after 'check 'check-pytest-plugin
2939 "python" "-m" "pytest"
2940 "pyfakefs/pytest_tests/pytest_plugin_test.py"))))))
2942 (list python-pytest))
2943 (build-system python-build-system)
2944 ;; Guix lint doesn't like that this is a permanent redirect to the GitHub
2945 ;; page, but the pyfakefs documentation asks us to use this specific URL
2946 ;; when linking to the project. Honor their request.
2947 (home-page "http://pyfakefs.org/")
2948 ;; TRANSLATORS: In the synopsis, "Mock" is a verb.
2949 (synopsis "Mock file system interactions in tests")
2951 "This package provides a Python library intended for use in automated
2952 tests. One difficulty when testing software is that the code under test might
2953 need to read or write to files in the local file system. If the file system
2954 is not set up in just the right way, it might cause a spurious error during
2955 the test. The pyfakefs library provides a solution to problems like this by
2956 mocking file system interactions. In other words, it arranges for the code
2957 under test to interact with a fake file system instead of the real file
2958 system. The code under test requires no modification to work with pyfakefs.")
2959 (license license:asl2.0)))
2961 ;; This minimal variant is used to avoid a circular dependency between
2962 ;; python2-importlib-metadata, which requires pyfakefs for its tests, and
2963 ;; python2-pytest, which requires python2-importlib-metadata.
2964 (define-public python2-pyfakefs-bootstrap
2967 (inherit (package-with-python2 python-pyfakefs))
2968 (name "python2-pyfakefs-bootstrap")
2971 `(#:python ,python-2
2974 (define-public python-aiounittest
2976 (name "python-aiounittest")
2978 ;; Pypi package lacks tests.
2980 (origin (method git-fetch)
2982 (url "https://github.com/kwarunek/aiounittest.git")
2984 (file-name (git-file-name name version))
2987 "0hql5mw62lclrpblbh7xvinwjfcdcfvhhlvl7xlq2hi9isjq1c8r"))))
2988 (build-system python-build-system)
2990 '(#:phases (modify-phases %standard-phases
2992 (lambda* (#:key tests? #:allow-other-keys)
2994 (invoke "nosetests" "-v")
2995 (format #t "test suite not run~%"))
2997 (propagated-inputs (list python-wrapt))
2999 (list python-coverage python-nose))
3001 "https://github.com/kwarunek/aiounittest")
3002 (synopsis "Test asyncio code more easily")
3003 (description "Aiounittest is a library that helps write tests using
3004 asynchronous code in Python (asyncio).")
3005 (license license:expat)))
3007 (define-public python-pytest-dependency
3009 (name "python-pytest-dependency")
3014 (uri (pypi-uri "pytest-dependency" version))
3017 "0swl3mxca7nnjbb5grfzrm3fa2750h9vjsha0f2kyrljc6895a62"))))
3018 (build-system python-build-system)
3020 (list python-pytest))
3022 "https://github.com/RKrahl/pytest-dependency")
3023 (synopsis "Manage dependencies of tests")
3024 (description "This pytest plugin manages dependencies of tests. It allows
3025 to mark some tests as dependent from other tests. These tests will then be
3026 skipped if any of the dependencies did fail or has been skipped.")
3027 (license license:asl2.0)))
3029 (define-public python-pytest-datadir
3031 (name "python-pytest-datadir")
3036 (uri (pypi-uri "pytest-datadir" version))
3039 "066bg6wlzgq2pqnjp73dfrcmk8951xw3aqcxa3p1axgqimrixbyk"))))
3040 (build-system python-build-system)
3042 (list python-setuptools-scm))
3044 (list python-pytest python-wheel))
3045 (home-page "https://github.com/gabrielcnr/pytest-datadir")
3046 (synopsis "Pytest plugin for manipulating test data directories and files")
3048 "This package provides a Pytest plugin for manipulating test data
3049 directories and files.")
3050 (license license:expat)))
3052 (define-public python-pytest-regressions
3054 (name "python-pytest-regressions")
3059 (uri (pypi-uri "pytest-regressions" version))
3062 "05jpsvv8rj8i4x24fphpnar5dl4s6d6bw6ikjk5d8v96rdviz9qm"))))
3063 (build-system python-build-system)
3065 (list python-pytest-datadir python-pyyaml))
3067 (list python-matplotlib
3072 python-restructuredtext-lint
3074 python-setuptools-scm
3076 (home-page "https://github.com/ESSS/pytest-regressions")
3077 (synopsis "Easy to use fixtures to write regression tests")
3079 "This plugin makes it simple to test general data, images, files, and numeric
3080 tables by saving expected data in a data directory (courtesy of pytest-datadir)
3081 that can be used to verify that future runs produce the same data.")
3082 (license license:expat)))