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 python-science)
75 #:use-module (gnu packages time)
76 #:use-module (gnu packages xml)
77 #:use-module (guix utils)
78 #:use-module ((guix licenses) #:prefix license:)
79 #:use-module (guix packages)
80 #:use-module (guix download)
81 #:use-module (guix git-download)
82 #:use-module (guix build-system cmake)
83 #:use-module (guix build-system glib-or-gtk)
84 #:use-module (guix build-system gnu)
85 #:use-module (guix build-system go)
86 #:use-module (guix build-system meson)
87 #:use-module (guix build-system python)
88 #:use-module (guix build-system trivial)
89 #:use-module (srfi srfi-1))
91 (define-public pedansee
99 (string-append "https://www.flyn.org/projects/"
100 name "/" name "-" version ".tar.gz"))
102 (base32 "0lsg791x6n95pxg6vif8qfc46nqcamhjq3g0dl5xqf6imy7n3acd"))))
103 (build-system glib-or-gtk-build-system)
106 ("pkg-config" ,pkg-config)
107 ("python" ,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"))))
152 (build-system gnu-build-system)
153 (home-page "https://libcheck.github.io/check/")
154 (synopsis "Unit test framework for C")
156 "Check is a unit testing framework for C. It features a simple
157 interface for defining unit tests, putting little in the way of the
158 developer. Tests are run in a separate address space, so Check can
159 catch both assertion failures and code errors that cause segmentation
160 faults or other signals. The output from unit tests can be used within
161 source code editors and IDEs.")
162 (license license:lgpl2.1+)))
164 ;; Some packages require older versions. Removed once no longer needed.
165 (define-public check-0.14
171 (uri (string-append "https://github.com/libcheck/check/releases"
172 "/download/" version "/check-" version ".tar.gz"))
175 "02zkfiyklckmivrfvdsrlzvzphkdsgjrz3igncw05dv5pshhq3xx"))))))
177 (define-public check-0.12
183 (uri (string-append "https://github.com/libcheck/check/releases"
184 "/download/" version "/check-" version ".tar.gz"))
187 "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6"))))))
189 (define-public clitest
193 (home-page "https://github.com/aureliojargas/clitest")
198 (commit (string-append "v" version))))
199 (file-name (git-file-name name version))
202 "0zw5wra9hc717srmcar1wm4i34kyj8c49ny4bb7y3nrvkjp2pdb5"))))
203 (build-system gnu-build-system)
206 (modify-phases %standard-phases
207 ;; This package is distributed as a single shell script and comes
208 ;; without a proper build system.
213 (substitute* "test.md"
214 ;; One test looks for an error from grep in the form "grep: foo",
215 ;; but our grep returns the absolute file name on errors. Adjust
216 ;; the test to cope with that.
217 (("sed 's/\\^e\\*grep: \\.\\*/")
218 "sed 's/.*e*grep: .*/"))
220 (setenv "HOME" "/tmp")
221 (invoke "./clitest" "test.md")))
223 (lambda* (#:key outputs #:allow-other-keys)
224 (let ((out (assoc-ref outputs "out")))
225 (install-file "clitest" (string-append out "/bin"))
226 (install-file "README.md"
227 (string-append out "/share/doc/clitest-" ,version))
230 `(("perl" ,perl))) ;for tests
231 (synopsis "Command line test tool")
233 "@command{clitest} is a portable shell script that performs automatic
234 testing of Unix command lines.")
235 (license license:expat)))
244 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
245 version "/CUnit-" version ".tar.bz2"))
248 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
249 (build-system gnu-build-system)
250 (arguments '(#:phases
251 (modify-phases %standard-phases
252 ;; XXX: The "bootstrap" phase detects the "bootstrap"
253 ;; script, but fails to execute it, so we bootstrap
256 (lambda _ (invoke "autoreconf" "-vfi"))))))
258 `(("automake" ,automake)
259 ("autoconf" ,autoconf)
260 ("libtool" ,libtool)))
261 (home-page "http://cunit.sourceforge.net/")
262 (synopsis "Automated testing framework for C")
264 "CUnit is a lightweight system for writing, administering, and running
265 unit tests in C. It provides C programmers with basic testing functionality
266 with a flexible variety of user interfaces.")
267 (license license:gpl2+)))
269 (define-public cppunit
275 (uri (string-append "http://dev-www.libreoffice.org/src/"
276 name "-" version ".tar.gz"))
279 "19qpqzy66bq76wcyadmi3zahk5v1ll2kig1nvg96zx9padkcdic9"))))
280 ;; Explicitly link with libdl. This is expected to be done by packages
281 ;; relying on cppunit for their tests. However, not all of them do.
282 ;; If we added the linker flag to such packages, we would pollute all
283 ;; binaries, not only those used for testing.
285 `(#:make-flags '("LDFLAGS=-ldl")))
286 (build-system gnu-build-system)
287 (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
288 (synopsis "Unit testing framework for C++")
289 (description "CppUnit is the C++ port of the famous JUnit framework for
290 unit testing. Test output is in XML for automatic testing and GUI based for
292 (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
294 (define-public shunit2
301 (url "https://github.com/kward/shunit2")
302 (commit (string-append "v" version))))
303 (file-name (git-file-name name version))
306 "08vs0jjl3pfh100sjlw31x4638xj7fghr0j2g1zfikba8n1f9491"))))
307 (build-system gnu-build-system)
310 (modify-phases %standard-phases
311 (delete 'configure) ; no configure script
313 (add-after 'patch-source-shebangs 'patch-more-shebangs
315 (substitute* "shunit2"
316 (("#! /bin/sh") (string-append "#! " (which "sh")))
317 (("/usr/bin/od") (which "od")))
318 (substitute* "test_runner"
319 (("/bin/sh") (which "sh"))
320 (("/bin/bash") (which "bash")))
323 (lambda* (#:key tests? #:allow-other-keys)
325 ;; This test is buggy in the build container.
326 (delete-file "shunit2_misc_test.sh")
327 (invoke "sh" "test_runner"))
330 (lambda* (#:key outputs #:allow-other-keys)
331 (install-file "shunit2"
332 (string-append (assoc-ref outputs "out")
335 (home-page "https://github.com/kward/shunit2")
336 (synopsis "@code{xUnit} based unit testing for Unix shell scripts")
337 (description "@code{shUnit2} was originally developed to provide a
338 consistent testing solution for @code{log4sh}, a shell based logging framework
339 similar to @code{log4j}. It is designed to work in a similar manner to JUnit,
341 (license license:asl2.0)))
343 ;; When dependent packages upgraded to use newer version of catch, this one should
345 (define-public catch-framework
348 (version "1.3.5") ;Sub-minor is the build number
352 (url "https://github.com/philsquared/Catch")
354 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
355 (file-name (string-append name "-" version))
358 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
359 (build-system trivial-build-system)
361 `(#:modules ((guix build utils))
363 (use-modules (guix build utils))
364 (let* ((source (assoc-ref %build-inputs "source"))
365 (output (assoc-ref %outputs "out"))
366 (incdir (string-append output "/include"))
367 (docdir (string-append output "/share/doc/catch-"
369 (for-each mkdir-p (list incdir docdir))
370 (install-file (string-append source
371 "/single_include/catch.hpp")
373 (copy-recursively (string-append source "/docs")
376 (home-page "http://catch-lib.net/")
377 (synopsis "Automated test framework for C++ and Objective-C")
379 "Catch stands for C++ Automated Test Cases in Headers and is a
380 multi-paradigm automated test framework for C++ and Objective-C.")
381 (license license:boost1.0)))
383 (define-public catch-framework2-1
387 (home-page "https://github.com/catchorg/Catch2")
391 (url "https://github.com/catchorg/Catch2")
392 (commit (string-append "v" version))))
393 (file-name (git-file-name name version))
396 "1gdp5wm8khn02g2miz381llw3191k7309qj8s3jd6sasj01rhf23"))))
397 (build-system cmake-build-system)
398 (synopsis "Automated test framework for C++ and Objective-C")
399 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
400 a multi-paradigm automated test framework for C++ and Objective-C.")
401 (license license:boost1.0)))
403 (define-public catch-framework2
407 (home-page "https://github.com/catchorg/Catch2")
411 (url "https://github.com/catchorg/Catch2")
412 (commit (string-append "v" version))))
413 (file-name (git-file-name name version))
416 "100r0kmra8jmra2hv92lzvwcmphpaiccwvq3lpdsa5b7hailhach"))))
417 (build-system cmake-build-system)
419 `(("python" ,python-wrapper)))
420 (synopsis "Automated test framework for C++ and Objective-C")
421 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
422 a multi-paradigm automated test framework for C++ and Objective-C.")
423 (license license:boost1.0)))
425 (define-public cmdtest
428 ;; Use the latest commit (from 2019) in order to get Python 3 support.
429 (version "0.32-14-gcdfe14e")
433 (url "git://git.liw.fi/cmdtest/")
435 (file-name (git-file-name name version))
438 "1yhcwsqcpckkq5kw3h07k0xg6infyiyzq9ni3nqphrzxis7hxjf1"))))
439 (build-system python-build-system)
440 (arguments `(#:tests? #f)) ;requires Python 2!
442 `(("python-coverage-test-runner" ,python-coverage-test-runner)
445 `(("python-cliapp" ,python-cliapp)
446 ("python-markdown" ,python-markdown)
447 ("python-ttystatus" ,python-ttystatus)))
448 (home-page "https://liw.fi/cmdtest/")
449 (synopsis "Black box Unix program tester")
451 "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
452 given a command line and input files, and the expected output, and it verifies
453 that the command line produces the expected output. If not, it reports a
454 problem, and shows the differences.")
455 (license license:gpl3+)))
457 (define-public cmocka
463 (uri (string-append "https://cmocka.org/files/"
464 (version-major+minor version) "/cmocka-"
468 "1dm8pdvkyfa8dsbz9bpq7wwgixjij4sii9bbn5sgvqjm5ljdik7h"))))
469 (build-system cmake-build-system)
471 `(#:tests? #f)) ; no test target
472 (home-page "https://cmocka.org/")
473 (synopsis "Unit testing framework for C")
474 (description "Cmocka is a unit testing framework for C with support for
475 mock objects. It only requires the standard C library, and works with
476 different compilers. Cmocka supports several different message output formats
477 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
479 (license license:asl2.0)))
481 (define-public cppcheck
488 (url "https://github.com/danmar/cppcheck")
490 (file-name (git-file-name name version))
492 (base32 "03ic5mig3ryzkf85r95ryagf84s7y5nd6sqr915l3zj30apnifvz"))))
493 (build-system cmake-build-system)
495 '(#:configure-flags '("-DBUILD_TESTS=ON")))
496 (home-page "http://cppcheck.sourceforge.net")
497 (synopsis "Static C/C++ code analyzer")
498 (description "Cppcheck is a static code analyzer for C and C++. Unlike
499 C/C++ compilers and many other analysis tools it does not detect syntax errors
500 in the code. Cppcheck primarily detects the types of bugs that the compilers
501 normally do not detect. The goal is to detect only real errors in the code
502 (i.e. have zero false positives).")
503 (license license:gpl3+)))
505 (define-public cxxtest
511 (uri (string-append "mirror://sourceforge/cxxtest/cxxtest/"
512 version "/cxxtest-" version ".tar.gz"))
515 "1n7pbj4z9ivx005hqvivj9ddhq8awynzg6jishfbypf6j7ply58w"))))
516 (build-system python-build-system)
519 (modify-phases %standard-phases
520 (add-after 'unpack 'chdir-to-source
524 (add-after 'install 'install-headers
525 (lambda* (#:key outputs #:allow-other-keys)
526 (let* ((out (assoc-ref outputs "out"))
527 (include-dir (string-append out "/include/cxxtest")))
528 (for-each (lambda (header-file)
529 (install-file header-file include-dir))
530 (find-files "../cxxtest"))
532 (add-after 'install 'install-doc
533 (lambda* (#:key outputs #:allow-other-keys)
534 (let* ((out (assoc-ref outputs "out"))
535 (doc-dir (string-append out "/share/doc/cxxtest")))
536 (install-file "../README" doc-dir)
537 (install-file "../doc/guide.txt" doc-dir)
538 (copy-recursively "../sample" (string-append doc-dir "/sample"))
541 `(("python-ply" ,python-ply)))
542 (home-page "https://cxxtest.com/")
543 (synopsis "Unit testing framework for C++")
544 (description "CxxTest is a unit testing framework for C++ that is similar
545 in spirit to JUnit, CppUnit, and xUnit. CxxTest does not require precompiling
546 a CxxTest testing library, it employs no advanced features of C++ (e.g. RTTI)
547 and it supports a very flexible form of test discovery.")
548 (license license:lgpl3+)))
550 (define-public doctest
554 (home-page "https://github.com/onqtam/doctest")
557 (uri (git-reference (url home-page) (commit version)))
558 (file-name (git-file-name name version))
561 "14m3q6d96zg6d99x1152jkly50gdjrn5ylrbhax53pfgfzzc5yqx"))))
562 (build-system cmake-build-system)
563 (synopsis "C++ test framework")
565 "doctest is a single-header testing framework for C++11 and later. It
566 has been designed to be fast, light and unintrusive.")
567 (license license:expat)))
569 (define-public go-gopkg.in-check.v1
570 (let ((commit "788fd78401277ebd861206a03c884797c6ec5541")
573 (name "go-gopkg.in-check.v1")
574 (version (git-version "0.0.0" revision commit))
578 (url "https://github.com/go-check/check")
580 (file-name (git-file-name name version))
583 "0v3bim0j375z81zrpr5qv42knqs0y2qv2vkjiqi5axvb78slki1a"))))
584 (build-system go-build-system)
586 '(#:import-path "gopkg.in/check.v1"))
588 `(("go-github-com-kr-pretty" ,go-github-com-kr-pretty)))
589 (synopsis "Rich testing extension for Go's testing package")
591 "@code{check} is a rich testing extension for Go's testing package.")
592 (home-page "https://github.com/go-check/check")
593 (license license:bsd-2))))
595 (define-public go-github.com-smartystreets-gunit
597 (name "go-github.com-smartystreets-gunit")
602 (url "https://github.com/smartystreets/gunit")
604 (file-name (git-file-name name version))
607 "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
608 (build-system go-build-system)
610 '(;; TODO: This package depends on go-github.com-smartystreets-assertions
611 ;; for running the tests, but go-github.com-smartystreets-assertions
612 ;; depends on this package, so break this loop by not running the tests
615 #:import-path "github.com/smartystreets/gunit"))
616 (synopsis "Testing tool for Go, in the style of xUnit")
618 "@code{gunit} allows the test author to use a struct as the scope for a
619 group of related test cases, in the style of xUnit fixtures. This makes
620 extraction of setup/teardown behavior (as well as invoking the system under
621 test) much simpler.")
622 (home-page "https://github.com/smartystreets/gunit")
623 (license license:expat)))
625 (define-public go-github.com-smartystreets-assertions
627 (name "go-github.com-smartystreets-assertions")
632 (url "https://github.com/smartystreets/assertions")
634 (file-name (git-file-name name version))
637 "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
638 (build-system go-build-system)
640 '(#:import-path "github.com/smartystreets/assertions"))
642 `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
643 (synopsis "Assertions for testing with Go")
645 "The @code{assertions} package provides convenient assertion functions
646 for writing tests in Go.")
647 (home-page "https://github.com/smartystreets/assertions")
648 (license license:expat)))
650 (define-public go-github.com-smartystreets-goconvey
652 (name "go-github.com-smartystreets-goconvey")
657 (url "https://github.com/smartystreets/goconvey")
659 (file-name (git-file-name name version))
662 "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
663 (build-system go-build-system)
665 '(#:import-path "github.com/smartystreets/goconvey"))
667 `(("go-github.com-jtolds-gls" ,go-github.com-jtolds-gls)
668 ("go-github.com-smartystreets-assertions" ,go-github.com-smartystreets-assertions)))
669 (synopsis "Go testing tool with both a web and terminal user interface")
671 "GoConvey is a testing tool for Go. It integrates with go test, can show
672 test coverage and has a web user interface that will refresh automatically.")
673 (home-page "https://github.com/smartystreets/goconvey")
674 (license license:expat)))
676 (define-public googletest
684 (url "https://github.com/google/googletest")
685 (commit (string-append "release-" version))))
686 (file-name (git-file-name name version))
688 (base32 "1zbmab9295scgg4z2vclgfgjchfjailjnvzc6f5x9jvlsdi3dpwz"))))
689 (build-system cmake-build-system)
691 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
693 `(("python" ,python-wrapper)))
694 (home-page "https://github.com/google/googletest/")
695 (synopsis "Test discovery and XUnit test framework")
696 (description "Google Test features an XUnit test framework, automated test
697 discovery, death tests, assertions, parameterized tests and XML test report
699 (license license:bsd-3)))
701 (define-public googletest-1.8
708 (url "https://github.com/google/googletest")
709 (commit (string-append "release-" version))))
710 (file-name (git-file-name "googletest" version))
713 "0270msj6n7mggh4xqqjp54kswbl7mkcc8px1p5dqdpmw5ngh9fzk"))))))
715 (define-public cpputest
722 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
723 version "/cpputest-" version ".tar.gz"))
726 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
727 (build-system gnu-build-system)
729 `(("googletest" ,googletest)))
730 (home-page "https://cpputest.github.io/")
731 (synopsis "Unit testing and mocking framework for C/C++")
733 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
734 C++ but is used in C and C++ projects and frequently used in embedded systems
735 but it works for any C/C++ project.")
736 (license license:bsd-3)))
738 (define-public python-parameterized
740 (name "python-parameterized")
745 (uri (pypi-uri "parameterized" version))
747 (base32 "1444fdz5bj0k10nmhxv0bv2gfrfisi7hfzqdndb0pvhf4g3qq3qr"))))
748 (build-system python-build-system)
750 '(#:phases (modify-phases %standard-phases
752 (lambda* (#:key tests? #:allow-other-keys)
754 (invoke "nosetests" "-v")
755 (format #t "test suite not run~%"))
758 `(("python-mock" ,python-mock)
759 ("python-nose" ,python-nose)))
760 (home-page "https://github.com/wolever/parameterized")
761 (synopsis "Parameterized testing with any Python test framework")
763 "Parameterized is a Python library that aims to fix parameterized testing
764 for every Python test framework. It supports nose, py.test, and unittest.")
765 (properties `((python2-variant . ,(delay python2-parameterized))))
766 (license license:bsd-2)))
768 (define-public python2-parameterized
769 (let ((base (package-with-python2 (strip-python2-variant
770 python-parameterized))))
775 (inherit (package-source base))
776 (patches (search-patches "python2-parameterized-docstring-test.patch")))))))
778 (define-public python-minimock
780 (name "python-minimock")
785 (uri (pypi-uri "MiniMock" version))
788 "0k2sxb1ibnyg05iblz7zhbv825f1zk9906rab7883iqgvzmdzpsz"))))
789 (build-system python-build-system)
790 (home-page "https://pypi.org/project/MiniMock")
791 (synopsis "Simple Python library for using mock objects")
792 (description "MiniMock is a simple library for building mock objects with
794 (license license:expat)))
796 (define-public python2-minimock
797 (package-with-python2 python-minimock))
799 (define-public python-mock
806 (uri (pypi-uri "mock" version))
809 "1hrp6j0yrx2xzylfv02qa8kph661m6yq4p0mc8fnimch9j4psrc3"))))
811 `(("python-six" ,python-six)))
812 (build-system python-build-system)
814 ;; FIXME: Tests require "pytest", which depends on this package.
816 (home-page "https://github.com/testing-cabal/mock")
817 (synopsis "Python mocking and patching library for testing")
819 "Mock is a library for testing in Python. It allows you to replace parts
820 of your system under test with mock objects and make assertions about how they
822 (properties `((python2-variant . ,(delay python2-mock))))
823 (license license:expat)))
825 (define-public python2-mock
826 (let ((base (package-with-python2
827 (strip-python2-variant python-mock))))
828 (package/inherit base
830 `(("python2-functools32" ,python2-functools32)
831 ("python2-funcsigs" ,python2-funcsigs)
832 ,@(package-propagated-inputs base))))))
834 (define-public python-nose
841 (uri (pypi-uri "nose" version))
844 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
845 (build-system python-build-system)
847 '(#:tests? #f)) ; FIXME: test suite fails
848 (home-page "http://readthedocs.org/docs/nose/")
849 (synopsis "Python testing library")
851 "Nose extends the unittest library to make testing easier.")
852 (license license:lgpl2.0+)))
854 (define-public python2-nose
855 (package-with-python2 python-nose))
857 (define-public python-nose2
859 (name "python-nose2")
864 (uri (pypi-uri "nose2" version))
867 "0pmbb6nk31yhgh4zkcblzxsznml7f7pf5q1ihgrwvbxv4mwzfql7"))))
868 (build-system python-build-system)
869 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
871 `(("python-cov-core" ,python-cov-core)
872 ("python-pytest-cov" ,python-pytest-cov)
873 ("python-six" ,python-six)))
874 (home-page "https://github.com/nose-devs/nose2")
875 (synopsis "Next generation of nicer testing for Python")
877 "Nose2 is the next generation of nicer testing for Python, based on the
878 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
879 better plugin api, being easier for users to configure, and simplifying internal
880 interfaces and processes.")
881 (license license:bsd-2)))
883 (define-public python2-nose2
884 (package-with-python2 python-nose2))
886 (define-public python-unittest2
888 (name "python-unittest2")
893 (uri (pypi-uri "unittest2" version))
895 (search-patches "python-unittest2-python3-compat.patch"
896 "python-unittest2-remove-argparse.patch"))
899 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
900 (build-system python-build-system)
903 (modify-phases %standard-phases
906 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
908 `(("python-six" ,python-six)
909 ("python-traceback2" ,python-traceback2)))
910 (home-page "https://pypi.org/project/unittest2/")
911 (synopsis "Python unit testing library")
913 "Unittest2 is a replacement for the unittest module in the Python
915 (license license:psfl)))
917 (define-public python2-unittest2
918 (package-with-python2 python-unittest2))
920 (define-public python-pytest
922 (name "python-pytest")
927 (uri (pypi-uri "pytest" version))
930 "139i9cjhrv5aici3skq8iihvfb3lq0d8xb5j7qycr2hlk8cfjpqd"))))
931 (build-system python-build-system)
934 (modify-phases %standard-phases
936 (lambda* (#:key (tests? #t) #:allow-other-keys)
938 (invoke "pytest" "-vv" "-k"
940 ;; These tests involve the /usr directory, and fails.
941 "not test_remove_dir_prefix"
942 " and not test_argcomplete"
943 ;; This test tries to override PYTHONPATH, and
944 ;; subsequently fails to locate the test libraries.
945 " and not test_collection"))
946 (format #t "test suite not run~%"))
949 `(("python-atomicwrites" ,python-atomicwrites)
950 ("python-attrs" ,python-attrs-bootstrap)
951 ("python-more-itertools" ,python-more-itertools)
952 ("python-packaging" ,python-packaging-bootstrap)
953 ("python-pluggy" ,python-pluggy)
954 ("python-py" ,python-py)
955 ("python-six" ,python-six-bootstrap)
956 ("python-wcwidth" ,python-wcwidth)))
958 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
960 ("python-hypothesis" ,python-hypothesis)
961 ("python-nose" ,python-nose)
962 ("python-mock" ,python-mock)
963 ("python-pytest" ,python-pytest-bootstrap)
964 ("python-setuptools-scm" ,python-setuptools-scm)
965 ("python-xmlschema" ,python-xmlschema)))
966 (home-page "https://docs.pytest.org/en/latest/")
967 (synopsis "Python testing library")
969 "Pytest is a testing tool that provides auto-discovery of test modules
970 and functions, detailed info on failing assert statements, modular fixtures,
971 and many external plugins.")
972 (license license:expat)
973 (properties `((python2-variant . ,(delay python2-pytest))))))
975 (define-public python-pytest-6
977 (inherit (strip-python2-variant python-pytest))
982 (uri (pypi-uri "pytest" version))
985 "0gl2sdm322vzmsh5k4f8kj9raiq2y7kdinnca4m45ifvii5fk9y0"))))
988 (modify-phases %standard-phases
990 (lambda* (#:key (tests? #t) #:allow-other-keys)
991 (setenv "TERM" "dumb") ;attempt disabling markup tests
993 (invoke "pytest" "-vv" "-k"
995 ;; This test involve the /usr directory, and fails.
996 " not test_argcomplete"
997 ;; These test do not honor the isatty detection and
999 " and not test_code_highlight"
1000 " and not test_color_yes"))
1001 (format #t "test suite not run~%"))
1004 (append (alist-delete "python-py"
1005 (package-propagated-inputs python-pytest))
1006 `(("python-py" ,python-py-next))))
1008 (append (alist-delete "python-pytest"
1009 (package-native-inputs python-pytest))
1010 `(("python-pytest" ,python-pytest-6-bootstrap)
1011 ("python-toml" ,python-toml)
1012 ("python-iniconfig" ,python-iniconfig))))))
1014 ;; Pytest 4.x are the last versions that support Python 2.
1015 (define-public python2-pytest
1017 (inherit (strip-python2-variant python-pytest))
1018 (name "python2-pytest")
1022 (uri (pypi-uri "pytest" version))
1025 "0ls3pqr86xgif6bphsb6wrww9r2vc7p7a2naq8zcq8115wwq5yjh"))))
1026 (build-system python-build-system)
1028 `(#:python ,python-2
1029 ,@(package-arguments python-pytest)))
1031 `(("python-atomicwrites" ,python2-atomicwrites)
1032 ("python-attrs" ,python2-attrs-bootstrap)
1033 ("python-funcsigs" ,python2-funcsigs)
1034 ("python-importlib-metadata" ,python2-importlib-metadata-bootstrap)
1035 ("python-more-itertools" ,python2-more-itertools)
1036 ("python-packaging" ,python2-packaging-bootstrap)
1037 ("python-pathlib2" ,python2-pathlib2)
1038 ("python-pluggy" ,python2-pluggy)
1039 ("python-py" ,python2-py)
1040 ("python-six" ,python2-six-bootstrap)
1041 ("python-wcwidth" ,python2-wcwidth)))
1043 `(("bash" ,bash) ;tests require 'compgen'
1044 ("python-hypothesis" ,python2-hypothesis)
1045 ("python-nose" ,python2-nose)
1046 ("python-mock" ,python2-mock)
1047 ("python-pytest" ,python2-pytest-bootstrap)
1048 ("python-setuptools-scm" ,python2-setuptools-scm)))))
1050 (define-public python-pytest-bootstrap
1052 (inherit (strip-python2-variant python-pytest))
1053 (name "python-pytest-bootstrap")
1054 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
1055 (arguments `(#:tests? #f))
1056 (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
1058 (define-public python-pytest-6-bootstrap
1060 (inherit (strip-python2-variant python-pytest-6))
1061 (name "python-pytest-bootstrap")
1062 (arguments `(#:tests? #f))
1064 `(("python-setuptools-scm" ,python-setuptools-scm)
1065 ("python-toml" ,python-toml)))))
1067 (define-public python2-pytest-bootstrap
1071 (name "python2-pytest-bootstrap")
1073 (substitute-keyword-arguments (package-arguments python2-pytest)
1074 ((#:tests? _ #f) #f)))
1076 `(("python-setuptools-scm" ,python2-setuptools-scm)))
1078 `(("python-atomicwrites" ,python2-atomicwrites)
1079 ("python-attrs" ,python2-attrs-bootstrap)
1080 ("python-funcsigs" ,python2-funcsigs-bootstrap)
1081 ("python-importlib-metadata" ,python2-importlib-metadata-bootstrap)
1082 ("python-more-itertools" ,python2-more-itertools)
1083 ("python-packaging" ,python2-packaging-bootstrap)
1084 ("python-pathlib2" ,python2-pathlib2-bootstrap)
1085 ("python-pluggy" ,python2-pluggy-bootstrap)
1086 ("python-py" ,python2-py)
1087 ("python-wcwidth" ,python2-wcwidth))))))
1089 (define-public python-pytest-cov
1091 (name "python-pytest-cov")
1096 (uri (pypi-uri "pytest-cov" version))
1098 (base32 "0avzlk9p4nc44k7lpx9109dybq71xqnggxb9f4hp0l64pbc44ryc"))))
1099 (build-system python-build-system)
1102 (modify-phases %standard-phases
1105 ;; Options taken from tox.ini.
1106 ;; TODO: make "--restructuredtext" tests pass. They currently fail
1107 ;; with "Duplicate implicit target name".
1108 (invoke "python" "./setup.py" "check"
1109 "--strict" "--metadata"))))))
1111 `(("python-coverage" ,python-coverage)
1112 ("python-pytest" ,python-pytest)))
1113 (home-page "https://github.com/pytest-dev/pytest-cov")
1114 (synopsis "Pytest plugin for measuring coverage")
1116 "Pytest-cov produces coverage reports. It supports centralised testing and
1117 distributed testing in both @code{load} and @code{each} modes. It also
1118 supports coverage of subprocesses.")
1119 (license license:expat)))
1121 (define-public python2-pytest-cov
1122 (package-with-python2 python-pytest-cov))
1124 (define-public python-pytest-httpserver
1126 (name "python-pytest-httpserver")
1130 (uri (pypi-uri "pytest_httpserver" version))
1133 "0vbls0j570l5my83j4jnk5blmnir44i0w511azlh41nl6k8rac5f"))))
1134 (build-system python-build-system)
1136 `(("python-pytest" ,python-pytest)))
1138 `(("python-werkzeug" ,python-werkzeug)))
1141 (modify-phases %standard-phases
1142 (add-before 'check 'fix-library-loading
1144 (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH") ":."))))
1147 (invoke "pytest" "tests" "-vv")
1148 (invoke "pytest" "tests" "-vv" "--ssl"))))))
1149 (home-page "https://github.com/csernazs/pytest-httpserver")
1150 (synopsis "HTTP server for pytest")
1151 (description "Pytest plugin library to test http clients without
1152 contacting the real http server.")
1153 (license license:expat)))
1155 (define-public python-pytest-runner
1157 (name "python-pytest-runner")
1162 (uri (pypi-uri "pytest-runner" version))
1165 "0awll1bva5zy8cspsxcpv7pjcrdf5c6pf56nqn4f74vvmlzfgiwn"))))
1166 (build-system python-build-system)
1168 '(;; FIXME: The test suite requires 'python-flake8' and 'python-black',
1169 ;; but that introduces a circular dependency.
1171 #:phases (modify-phases %standard-phases
1173 (lambda* (#:key tests? #:allow-other-keys)
1175 (invoke "pytest" "-vv")
1176 (format #t "test suite not run~%"))
1179 `(("python-setuptools-scm" ,python-setuptools-scm)))
1180 (home-page "https://github.com/pytest-dev/pytest-runner")
1181 (synopsis "Invoke py.test as a distutils command")
1183 "This package provides a @command{pytest-runner} command that
1184 @file{setup.py} files can use to run tests.")
1185 (license license:expat)))
1187 (define-public python2-pytest-runner
1188 (package-with-python2 python-pytest-runner))
1190 ;; python-bleach 3.1.0 requires this ancient version of pytest-runner.
1191 ;; Remove once no longer needed.
1192 (define-public python-pytest-runner-2
1194 (inherit python-pytest-runner)
1198 (uri (pypi-uri "pytest-runner" version))
1201 "11ivjj9hfphkv4yfb2g74av4yy86y8gcbf7gbif0p1hcdfnxg3w6"))))))
1203 (define-public python2-pytest-runner-2
1204 (package-with-python2 python-pytest-runner-2))
1206 (define-public python-pytest-lazy-fixture
1208 (name "python-pytest-lazy-fixture")
1213 (uri (pypi-uri "pytest-lazy-fixture" version))
1215 (base32 "1b0hmnsxw4s2wf9pks8dg6dfy5cx3zcbzs8517lfccxsfizhqz8f"))))
1216 (build-system python-build-system)
1219 (modify-phases %standard-phases
1221 (lambda* (#:key inputs outputs #:allow-other-keys)
1222 ;; Make the installed plugin discoverable by Pytest.
1223 (add-installed-pythonpath inputs outputs)
1224 (invoke "pytest" "-vv"))))))
1226 `(("python-pytest" ,python-pytest)))
1227 (home-page "https://github.com/tvorog/pytest-lazy-fixture")
1228 (synopsis "Use fixtures in @code{pytest.mark.parametrize}")
1229 (description "This plugin helps to use fixtures in
1230 @code{pytest.mark.parametrize}.")
1231 (license license:expat)))
1233 (define-public python-pytest-mock
1235 (name "python-pytest-mock")
1240 (uri (pypi-uri "pytest-mock" version))
1243 "1i5mg3ff1qk0wqfcxfz60hwy3q5dskdp36i10ckigkzffg8hc3ad"))))
1244 (build-system python-build-system)
1246 `(("python-setuptools-scm" ,python-setuptools-scm)))
1248 `(("python-pytest" ,python-pytest)))
1249 (home-page "https://github.com/pytest-dev/pytest-mock/")
1250 (synopsis "Thin-wrapper around the mock package for easier use with py.test")
1252 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
1253 around the patching API provided by the @code{mock} package, but with the
1254 benefit of not having to worry about undoing patches at the end of a test.
1255 The mocker fixture has the same API as @code{mock.patch}, supporting the
1257 (properties `((python2-variant . ,(delay python2-pytest-mock))))
1258 (license license:expat)))
1260 (define-public python2-pytest-mock
1261 (let ((base (package-with-python2
1262 (strip-python2-variant python-pytest-mock))))
1263 (package/inherit base
1265 `(("python2-mock" ,python2-mock)
1266 ,@(package-propagated-inputs base))))))
1268 (define-public python-pytest-xdist
1270 (name "python-pytest-xdist")
1275 (uri (pypi-uri "pytest-xdist" version))
1278 "0wh6pn66nncfs6ay0n863bgyriwsgppn8flx5l7551j1lbqkinc2"))
1279 (modules '((guix build utils)))
1282 ;; Remove pre-compiled .pyc files from source.
1283 (for-each delete-file-recursively
1284 (find-files "." "__pycache__" #:directories? #t))
1285 (for-each delete-file (find-files "." "\\.pyc$"))
1287 (build-system python-build-system)
1289 '(#:tests? #f)) ;FIXME: Some tests are failing.
1291 ;; (modify-phases %standard-phases
1293 ;; (add-after 'install 'check
1294 ;; (lambda* (#:key inputs outputs #:allow-other-keys)
1295 ;; (add-installed-pythonpath inputs outputs)
1296 ;; (zero? (system* "py.test" "-v")))))
1298 `(("python-setuptools-scm" ,python-setuptools-scm)))
1300 `(("python-execnet" ,python-execnet)
1301 ("python-pytest" ,python-pytest)
1302 ("python-py" ,python-py)))
1304 "https://github.com/pytest-dev/pytest-xdist")
1306 "Plugin for py.test with distributed testing and loop-on-failing modes")
1308 "The pytest-xdist plugin extends py.test with some unique test execution
1309 modes: parallelization, running tests in boxed subprocesses, the ability
1310 to run tests repeatedly when failed, and the ability to run tests on multiple
1311 Python interpreters or platforms. It uses rsync to copy the existing
1312 program code to a remote location, executes there, and then syncs the
1314 (license license:expat)))
1316 (define-public python2-pytest-xdist
1317 (package-with-python2 python-pytest-xdist))
1319 (define-public python-pytest-timeout
1321 (name "python-pytest-timeout")
1326 (uri (pypi-uri "pytest-timeout" version))
1329 "13n42azbvs5slvy2n1a9nw17r4qdq10dd68nln3jp925safa3yl0"))))
1330 (build-system python-build-system)
1332 '(#:phases (modify-phases %standard-phases
1334 (lambda* (#:key inputs outputs #:allow-other-keys)
1335 ;; Make the installed plugin discoverable by Pytest.
1336 (add-installed-pythonpath inputs outputs)
1337 (invoke "pytest" "-vv"))))))
1339 `(("python-pytest" ,python-pytest)))
1341 `(("python-pexpect" ,python-pexpect)))
1342 (home-page "https://github.com/pytest-dev/pytest-timeout")
1343 (synopsis "Plugin for py.test to abort hanging tests")
1345 "This package provides a py.test plugin that aborts hanging tests after a
1346 timeout has been exceeded.")
1347 (license license:expat)))
1349 (define-public python-pytest-forked
1351 (name "python-pytest-forked")
1356 (uri (pypi-uri "pytest-forked" version))
1359 "000i4q7my2fq4l49n8idx2c812dql97qv6qpm2vhrrn9v6g6j18q"))))
1360 (build-system python-build-system)
1362 `(("python-pytest" ,python-pytest)))
1364 `(("python-setuptools-scm" ,python-setuptools-scm)))
1366 "https://github.com/pytest-dev/pytest-forked")
1368 "Run tests in isolated forked subprocesses")
1370 "Pytest plugin which will run each test in a subprocess and will report if
1371 a test crashed the process.")
1372 (license license:expat)))
1374 (define-public python-scripttest
1376 (name "python-scripttest")
1381 (uri (pypi-uri "scripttest" version))
1384 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
1385 (build-system python-build-system)
1387 `(("python-pytest" ,python-pytest)))
1388 (home-page (string-append "https://web.archive.org/web/20161029233413/"
1389 "http://pythonpaste.org/scripttest/"))
1390 (synopsis "Python library to test command-line scripts")
1391 (description "Scripttest is a Python helper library for testing
1392 interactive command-line applications. With it you can run a script in a
1393 subprocess and see the output as well as any file modifications.")
1394 (license license:expat)))
1396 (define-public python-testtools-bootstrap
1398 (name "python-testtools-bootstrap")
1403 (uri (pypi-uri "testtools" version))
1406 "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
1407 (patches (search-patches "python-testtools.patch"))))
1408 (build-system python-build-system)
1409 (arguments '(#:tests? #f))
1411 `(("python-extras" ,python-extras)
1412 ("python-fixtures" ,python-fixtures-bootstrap)
1413 ("python-mimeparse" ,python-mimeparse)
1414 ("python-pbr" ,python-pbr-minimal)
1415 ("python-six" ,python-six)
1416 ("python-traceback2" ,python-traceback2)
1417 ("python-unittest2" ,python-unittest2)))
1418 (home-page "https://github.com/testing-cabal/testtools")
1420 "Extensions to the Python standard library unit testing framework")
1422 "This package is only for bootstrapping. Do not use this.")
1423 (license license:psfl)))
1425 (define-public python-testtools
1427 (inherit python-testtools-bootstrap)
1428 (name "python-testtools")
1430 `(#:phases (modify-phases %standard-phases
1433 (invoke "python" "-m" "testtools.run"
1434 "testtools.tests.test_suite"))))))
1436 `(("python-extras" ,python-extras)
1437 ("python-fixtures" ,python-fixtures)
1438 ("python-mimeparse" ,python-mimeparse)
1439 ("python-pbr" ,python-pbr)
1440 ("python-six" ,python-six)
1441 ("python-traceback2" ,python-traceback2)
1442 ("python-unittest2" ,python-unittest2)))
1444 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
1446 "Testtools extends the Python standard library unit testing framework to
1447 provide matchers, more debugging information, and cross-Python
1450 (define-public python-testscenarios-bootstrap
1452 (name "python-testscenarios-bootstrap")
1457 (uri (pypi-uri "testscenarios" version))
1460 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
1461 (build-system python-build-system)
1463 `(#:phases (modify-phases %standard-phases
1466 (invoke "python" "-m" "testtools.run"
1467 "testscenarios.test_suite"))))))
1469 `(("python-pbr" ,python-pbr-minimal)
1470 ("python-testtools" ,python-testtools-bootstrap)))
1471 (home-page "https://launchpad.net/testscenarios")
1472 (synopsis "Pyunit extension for dependency injection")
1474 "This package is only for bootstrapping. Don't use this.")
1475 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1477 (define-public python-testscenarios
1479 (inherit python-testscenarios-bootstrap)
1480 (name "python-testscenarios")
1482 `(("python-pbr" ,python-pbr)
1483 ("python-testtools" ,python-testtools)))
1485 "Testscenarios provides clean dependency injection for Python unittest
1488 ;; Testresources requires python-pbr at runtime, but pbr needs it for its
1489 ;; own tests. Hence this bootstrap variant.
1490 (define-public python-testresources-bootstrap
1492 (name "python-testresources-bootstrap")
1496 (uri (pypi-uri "testresources" version))
1499 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
1500 (build-system python-build-system)
1501 (arguments '(#:tests? #f))
1503 `(("python-pbr" ,python-pbr-minimal)))
1504 (home-page "https://launchpad.net/testresources")
1506 "Pyunit extension for managing test resources")
1508 "This package is only here for bootstrapping purposes. Use the regular
1509 testresources package instead.")
1510 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1512 (define-public python-testresources
1514 (inherit python-testresources-bootstrap)
1515 (name "python-testresources")
1517 `(("python-pbr" ,python-pbr)))
1520 `(("python-fixtures" ,python-fixtures)
1521 ("python-testtols" ,python-testtools)))
1523 "Testresources is an extension to Python's unittest to allow declarative
1524 use of resources by test cases.")))
1526 (define-public python-subunit-bootstrap
1528 (name "python-subunit-bootstrap")
1533 (uri (pypi-uri "python-subunit" version))
1536 "0j0ymmnc5nfxi1qzvy59j27viqca7l7xd0y9x29g7yr0h693j804"))))
1537 (build-system python-build-system)
1539 `(("python-extras" ,python-extras)
1540 ("python-testtools" ,python-testtools-bootstrap)))
1542 `(("python-fixtures" ,python-fixtures-bootstrap)
1543 ("python-hypothesis" ,python-hypothesis)
1544 ("python-testscenarios" ,python-testscenarios-bootstrap)))
1545 (home-page "https://launchpad.net/subunit")
1546 (synopsis "Python implementation of the subunit protocol")
1548 "This package is here for bootstrapping purposes only. Use the regular
1549 python-subunit package instead.")
1550 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1552 (define-public python-subunit
1554 (inherit python-subunit-bootstrap)
1555 (name "python-subunit")
1557 `(("python-extras" ,python-extras)
1558 ("python-testtools" ,python-testtools)))
1560 `(("python-fixtures" ,python-fixtures)
1561 ("python-hypothesis" ,python-hypothesis)
1562 ("python-testscenarios" ,python-testscenarios)))
1564 "Python-subunit is a Python implementation of the subunit test streaming
1567 ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
1568 ;; own tests. Hence this bootstrap variant.
1569 (define-public python-fixtures-bootstrap
1571 (name "python-fixtures-bootstrap")
1575 (uri (pypi-uri "fixtures" version))
1578 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
1579 (build-system python-build-system)
1580 (arguments `(#:tests? #f))
1582 `(("python-pbr-minimal" ,python-pbr-minimal)
1583 ("python-six" ,python-six)))
1584 (home-page "https://launchpad.net/python-fixtures")
1585 (synopsis "Python test fixture library")
1587 "This package is only used for bootstrapping. Use the regular
1588 python-fixtures package instead.")
1589 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1591 (define-public python-fixtures
1593 (inherit python-fixtures-bootstrap)
1594 (name "python-fixtures")
1597 (modify-phases %standard-phases
1600 (invoke "python" "-m" "testtools.run"
1601 "fixtures.test_suite"))))))
1603 ;; Fixtures uses pbr at runtime to check versions, etc.
1604 `(("python-pbr" ,python-pbr)
1605 ("python-six" ,python-six)))
1607 `(("python-mock" ,python-mock)
1608 ("python-testtools" ,python-testtools-bootstrap)))
1610 "Fixtures provides a way to create reusable state, useful when writing
1613 (define-public python-testrepository-bootstrap
1615 (name "python-testrepository-bootstrap")
1620 (uri (pypi-uri "testrepository" version))
1623 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1624 (build-system python-build-system)
1625 (arguments '(#:tests? #f))
1627 `(("python-fixtures" ,python-fixtures-bootstrap)
1628 ("python-subunit" ,python-subunit-bootstrap)
1629 ("python-testtools" ,python-testtools-bootstrap)))
1631 `(("python-mimeparse" ,python-mimeparse)))
1632 (home-page "https://launchpad.net/testrepository")
1633 (synopsis "Database for Python test results")
1635 "Bootstrap package for python-testrepository. Don't use this.")
1636 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1638 (define-public python-testrepository
1640 (inherit python-testrepository-bootstrap)
1641 (name "python-testrepository")
1643 ;; FIXME: Many tests are failing.
1646 `(("python-fixtures" ,python-fixtures)
1647 ("python-subunit" ,python-subunit)
1648 ("python-testtools" ,python-testtools)))
1650 `(("python-mimeparse" ,python-mimeparse)))
1651 (description "Testrepository provides a database of test results which can
1652 be used as part of a developer's workflow to check things such as what tests
1653 have failed since the last commit or what tests are currently failing.")))
1655 (define-public python-coverage
1657 (name "python-coverage")
1662 (uri (pypi-uri "coverage" version))
1665 "16z8i18msgs8k74n73dj9x49wzkl0vk4vq8k5pl1bsj70y7b4k53"))))
1666 (build-system python-build-system)
1668 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1670 (home-page "https://coverage.readthedocs.io")
1671 (synopsis "Code coverage measurement for Python")
1673 "Coverage measures code coverage, typically during test execution. It
1674 uses the code analysis tools and tracing hooks provided in the Python standard
1675 library to determine which lines are executable, and which have been
1677 (license license:bsd-3)))
1679 (define-public python2-coverage
1680 (package-with-python2 python-coverage))
1682 (define-public python-pytest-asyncio
1684 (name "python-pytest-asyncio")
1689 (uri (pypi-uri "pytest-asyncio" version))
1691 (base32 "1bysy4nii13bm7h345wxf8fxcjhab7l374pqdv7vwv3izl053b4z"))))
1692 (build-system python-build-system)
1694 `(("python-coverage" ,python-coverage)
1695 ("python-async-generator" ,python-async-generator)
1696 ("python-hypothesis" ,python-hypothesis)
1697 ("python-pytest" ,python-pytest)))
1698 (home-page "https://github.com/pytest-dev/pytest-asyncio")
1699 (synopsis "Pytest support for asyncio")
1700 (description "Python asyncio code is usually written in the form of
1701 coroutines, which makes it slightly more difficult to test using normal
1702 testing tools. @code{pytest-asyncio} provides useful fixtures and markers
1703 to make testing async code easier.")
1704 (license license:asl2.0)))
1706 (define-public python-cov-core
1708 (name "python-cov-core")
1713 (uri (pypi-uri "cov-core" version))
1716 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1717 (build-system python-build-system)
1719 `(("python-coverage" ,python-coverage)))
1720 (home-page "https://github.com/schlamar/cov-core")
1721 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
1723 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1724 and @code{nose2-cov}. It is useful for developing coverage plugins for these
1725 testing frameworks.")
1726 (license license:expat)))
1728 (define-public python2-cov-core
1729 (package-with-python2 python-cov-core))
1731 (define-public python-codecov
1733 (name "python-codecov")
1738 (uri (pypi-uri "codecov" version))
1741 "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1742 (build-system python-build-system)
1744 `(("python-unittest2" ,python-unittest2)))
1746 `(("python-coverage" ,python-coverage)
1747 ("python-requests" ,python-requests)))
1748 (home-page "https://github.com/codecov/codecov-python")
1749 (synopsis "Upload code coverage reports to @code{codecov.io}")
1751 "Codecov collects code coverage reports from code written in Python, Java,
1752 C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
1753 (license license:asl2.0)))
1755 (define-public python-testpath
1757 (name "python-testpath")
1763 (url "https://github.com/jupyter/testpath")
1765 (file-name (git-file-name name version))
1768 "1fwv4d3p54xx1x942s104irr35lszvv6jnr4nn1scsfvc0m1qmbk"))))
1769 (build-system python-build-system)
1771 `(#:tests? #f ; this package does not even have a setup.py
1772 #:modules ((guix build python-build-system)
1776 (modify-phases %standard-phases
1779 ;; A ZIP archive should be generated, but it fails with "ZIP does
1780 ;; not support timestamps before 1980". Luckily,
1781 ;; SOURCE_DATE_EPOCH is respected, which we set to some time in
1783 (setenv "SOURCE_DATE_EPOCH" "315532800")
1784 (invoke "flit" "build")))
1786 (lambda* (#:key inputs outputs #:allow-other-keys)
1787 (add-installed-pythonpath inputs outputs)
1788 (let ((out (assoc-ref outputs "out")))
1789 (for-each (lambda (wheel)
1790 (format #true wheel)
1791 (invoke "python" "-m" "pip" "install"
1792 wheel (string-append "--prefix=" out)))
1793 (find-files "dist" "\\.whl$"))))))))
1795 `(("python-flit" ,python-flit)))
1796 (home-page "https://github.com/takluyver/testpath")
1797 (synopsis "Test utilities for code working with files and commands")
1799 "Testpath is a collection of utilities for Python code working with files
1800 and commands. It contains functions to check things on the file system, and
1801 tools for mocking system commands and recording calls to those.")
1802 (license license:expat)))
1804 (define-public python-testlib
1806 (name "python-testlib")
1811 (uri (pypi-uri "testlib" version ".zip"))
1813 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1814 (build-system python-build-system)
1816 `(("unzip" ,unzip))) ; for unpacking the source
1817 (synopsis "Python micro test suite harness")
1818 (description "A micro unittest suite harness for Python.")
1819 (home-page "https://github.com/trentm/testlib")
1820 (license license:expat)))
1822 (define-public python2-testlib
1823 (package-with-python2 python-testlib))
1825 ;;; The software provided by this package was integrated into pytest 2.8.
1826 (define-public python-pytest-cache
1828 (name "python-pytest-cache")
1832 (uri (pypi-uri "pytest-cache" version))
1835 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1836 (build-system python-build-system)
1838 `(("python-apipkg" ,python-apipkg)
1839 ("python-execnet" ,python-execnet)
1840 ("python-py" ,python-py)
1841 ("python-pytest" ,python-pytest)))
1842 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1843 (description "The pytest-cache plugin provides tools to rerun failures from
1844 the last py.test invocation.")
1845 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1846 (license license:expat)))
1848 (define-public python2-pytest-cache
1849 (package-with-python2 python-pytest-cache))
1851 (define-public python-pytest-localserver
1853 (name "python-pytest-localserver")
1857 (uri (pypi-uri "pytest-localserver" version))
1860 "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
1861 (build-system python-build-system)
1864 (modify-phases %standard-phases
1867 (invoke "py.test" "-v"))))))
1869 `(("python-pytest" ,python-pytest)
1870 ("python-requests" ,python-requests)
1871 ("python-six" ,python-six)))
1873 `(("python-werkzeug" ,python-werkzeug)))
1874 (synopsis "Py.test plugin to test server connections locally")
1875 (description "Pytest-localserver is a plugin for the pytest testing
1876 framework which enables you to test server connections locally.")
1877 (home-page "https://pypi.org/project/pytest-localserver/")
1878 (license license:expat)))
1880 (define-public python-pytest-xprocess
1882 (name "python-pytest-xprocess")
1886 (uri (pypi-uri "pytest-xprocess" version))
1889 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1890 (build-system python-build-system)
1892 `(("python-pytest" ,python-pytest)
1893 ("python-pytest-cache" ,python-pytest-cache)
1894 ("python-psutil" ,python-psutil)))
1895 (synopsis "Pytest plugin to manage external processes across test runs")
1896 (description "Pytest-xprocess is an experimental py.test plugin for managing
1897 processes across test runs.")
1898 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1899 (license license:expat)))
1901 (define-public python-pytest-subtesthack
1903 (name "python-pytest-subtesthack")
1907 (uri (pypi-uri "pytest-subtesthack" version))
1910 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1911 (build-system python-build-system)
1913 `(("python-pytest" ,python-pytest)))
1914 (synopsis "Set-up and tear-down fixtures for unit tests")
1915 (description "This plugin allows you to set up and tear down fixtures within
1916 unit test functions that use @code{py.test}. This is useful for using
1917 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1918 function multiple times, without setting up or tearing down fixture state as is
1919 normally the case.")
1920 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1921 (license license:unlicense)))
1923 (define-public python2-pytest-subtesthack
1924 (package-with-python2 python-pytest-subtesthack))
1926 (define-public python-pytest-sugar
1928 (name "python-pytest-sugar")
1933 (uri (pypi-uri "pytest-sugar" version))
1935 (base32 "1i0hv3h49zvl62jbiyjag84carbrp3zprqzxffdr291nxavvac0n"))))
1936 (build-system python-build-system)
1938 `(("python-packaging" ,python-packaging)
1939 ("python-pytest" ,python-pytest)
1940 ("python-termcolor" ,python-termcolor)))
1941 (home-page "https://pivotfinland.com/pytest-sugar/")
1942 (synopsis "Plugin for pytest that changes the default look and feel")
1944 "@code{pytest-sugar} is a plugin for py.test that changes the default
1945 look and feel of py.test, using a progress bar and showing failures and errors
1947 (license license:bsd-3)))
1949 (define-public python-hypothesis
1951 (name "python-hypothesis")
1955 (uri (pypi-uri "hypothesis" version))
1958 "0zn09bn6hadk4vxl6jy8bkjr5fz8mrhin3z46w7pq5qgbaycr89p"))))
1959 (build-system python-build-system)
1961 ;; XXX: Tests are not distributed with the PyPI archive.
1964 `(("python-attrs" ,python-attrs-bootstrap)
1965 ("python-sortedcontainers" ,python-sortedcontainers)))
1966 (synopsis "Library for property based testing")
1967 (description "Hypothesis is a library for testing your Python code against a
1968 much larger range of examples than you would ever want to write by hand. It’s
1969 based on the Haskell library, Quickcheck, and is designed to integrate
1970 seamlessly into your existing Python unit testing work flow.")
1971 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
1972 (license license:mpl2.0)
1973 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1975 (define-public python-hypothesis-5.23
1977 (inherit python-hypothesis)
1981 (uri (pypi-uri "hypothesis" version))
1984 "0sy1v6nyxg4rjcf3rlr8nalb7wqd9nccpb2lzkchbj5an13ysf1h"))))
1985 (home-page "https://github.com/HypothesisWorks/hypothesis")))
1987 ;; This is the last version of Hypothesis that supports Python 2.
1988 (define-public python2-hypothesis
1989 (let ((hypothesis (package-with-python2
1990 (strip-python2-variant python-hypothesis))))
1991 (package (inherit hypothesis)
1995 (uri (pypi-uri "hypothesis" version))
1998 "183gpxbfcdhdqzlahkji5a71n6lmvgqsbkcb0ihqad51n2j6jhrw"))))
2000 `(("python2-enum34" ,python2-enum34)
2001 ,@(package-propagated-inputs hypothesis))))))
2003 (define-public python-hypothesmith
2005 (name "python-hypothesmith")
2010 (uri (pypi-uri "hypothesmith" version))
2013 "09331sspknv459xcyn1k0lx5flqlc6gmnwp9370pfvg4kg1zmss6"))))
2014 (build-system python-build-system)
2016 `(("python-hypothesis" ,python-hypothesis-5.23)
2017 ("python-lark-parser" ,python-lark-parser)
2018 ("python-libcst" ,python-libcst)))
2019 (home-page "https://github.com/Zac-HD/hypothesmith")
2020 (synopsis "Strategies for generating Python programs")
2022 "This package contains hypothesis strategies for generating Python
2023 programs, something like CSmith, a random generator of C programs.")
2024 (license license:mpl2.0)))
2026 (define-public python-lit
2033 (uri (pypi-uri "lit" version))
2036 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
2037 (build-system python-build-system)
2040 (modify-phases %standard-phases
2043 (invoke "python" "lit.py" "tests"))))))
2046 (home-page "https://llvm.org/")
2047 (synopsis "LLVM Software Testing Tool")
2048 (description "@code{lit} is a portable tool for executing LLVM and Clang
2049 style test suites, summarizing their results, and providing indication of
2051 (license license:ncsa)))
2053 (define-public python2-lit
2054 (package-with-python2 python-lit))
2056 (define-public python-pytest-pep8
2058 (name "python-pytest-pep8")
2062 (uri (pypi-uri "pytest-pep8" version))
2065 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
2066 (build-system python-build-system)
2068 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
2070 `(("python-pytest" ,python-pytest)))
2072 `(("python-pep8" ,python-pep8)))
2073 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
2074 (synopsis "Py.test plugin to check PEP8 requirements")
2075 (description "Pytest plugin for checking PEP8 compliance.")
2076 (license license:expat)))
2078 (define-public python2-pytest-pep8
2079 (package-with-python2 python-pytest-pep8))
2081 (define-public python-pytest-flakes
2083 (name "python-pytest-flakes")
2087 (uri (pypi-uri "pytest-flakes" version))
2090 "0045h3hnrkn2jwr42jgy2j98npx4amwr6wxzi9j0nppaqz33l49p"))))
2091 (build-system python-build-system)
2094 (modify-phases %standard-phases
2096 (add-after 'install 'check
2097 (lambda* (#:key outputs inputs #:allow-other-keys)
2098 ;; It's easier to run tests after install.
2099 ;; Make installed package available for running the tests
2100 (add-installed-pythonpath inputs outputs)
2101 (invoke "py.test" "-vv" "-k" "not test_syntax_error"))))))
2103 `(("python-coverage" ,python-coverage)
2104 ("python-pytest" ,python-pytest)
2105 ("python-pytest-cache" ,python-pytest-cache)
2106 ("python-pytest-pep8" ,python-pytest-pep8)))
2108 `(("python-pyflakes" ,python-pyflakes)))
2109 (home-page "https://github.com/fschulze/pytest-flakes")
2110 (synopsis "Py.test plugin to check source code with pyflakes")
2111 (description "Pytest plugin for checking Python source code with pyflakes.")
2112 (license license:expat)))
2114 (define-public python2-pytest-flakes
2115 (package-with-python2 python-pytest-flakes))
2117 (define-public python-coverage-test-runner
2119 (name "python-coverage-test-runner")
2125 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
2126 "coverage-test-runner/snapshot/coverage-test-runner-"
2130 "1kjjb9llckycnfxag8zcvqsn4z1s3dwyw6b1n0avxydihgf30rny"))))
2131 (build-system python-build-system)
2134 (modify-phases %standard-phases
2137 (invoke "./testrun"))))))
2139 `(("python-coverage" ,python-coverage)))
2140 (home-page "https://liw.fi/coverage-test-runner/")
2141 (synopsis "Python module for running unit tests")
2142 (description "@code{CoverageTestRunner} is a python module for running
2143 unit tests and failing them if the unit test module does not exercise all
2144 statements in the module it tests.")
2145 (license license:gpl3+)))
2147 (define-public python2-coverage-test-runner
2148 (package-with-python2 python-coverage-test-runner))
2150 (define-public python-pylint
2152 (name "python-pylint")
2158 (url "https://github.com/PyCQA/pylint")
2159 (commit (string-append "pylint-" version))))
2160 (file-name (git-file-name name version))
2162 (base32 "04cgbh2z1mygar63plzziyz34yg6bdr4i0g63jp256fgnqwb1bi3"))))
2163 (build-system python-build-system)
2164 ;; FIXME: Tests are failing since version 2.4.3, see:
2165 ;; https://github.com/PyCQA/pylint/issues/3198.
2166 (arguments '(#:tests? #f))
2168 `(("python-pytest" ,python-pytest)
2169 ("python-pytest-runner" ,python-pytest-runner)
2170 ("python-tox" ,python-tox)))
2172 `(("python-astroid" ,python-astroid)
2173 ("python-isort" ,python-isort)
2174 ("python-mccabe" ,python-mccabe)
2175 ("python-six" ,python-six)
2176 ("python-toml" ,python-toml)))
2177 (home-page "https://github.com/PyCQA/pylint")
2178 (synopsis "Python source code analyzer which looks for coding standard
2180 (description "Pylint is a Python source code analyzer which looks
2181 for programming errors, helps enforcing a coding standard and sniffs
2182 for some code smells (as defined in Martin Fowler's Refactoring book).
2184 Pylint has many rules enabled by default, way too much to silence them
2185 all on a minimally sized program. It's highly configurable and handle
2186 pragmas to control it from within your code. Additionally, it is
2187 possible to write plugins to add your own checks.")
2188 (license license:gpl2+)))
2190 (define-public python-paramunittest
2192 (name "python-paramunittest")
2197 (uri (pypi-uri "ParamUnittest" version))
2200 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
2201 (build-system python-build-system)
2203 "https://github.com/rik0/ParamUnittest")
2205 "Simple extension to have parametrized unit tests")
2207 "This package creates parameterized unit-tests that work with the standard
2208 unittest package. A parameterized test case is automatically converted to multiple test
2209 cases. Since they are TestCase subclasses, they work with other test suites that
2210 recognize TestCases.")
2211 (license license:bsd-2)))
2213 (define-public python2-python-paramunittest
2214 (package-with-python2 python-paramunittest))
2216 (define-public python-pytest-warnings
2218 (name "python-pytest-warnings")
2223 (uri (pypi-uri "pytest-warnings" version))
2226 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
2227 (build-system python-build-system)
2229 `(("pytest" ,python-pytest)))
2230 (home-page "https://github.com/fschulze/pytest-warnings")
2231 (synopsis "Pytest plugin to list Python warnings in pytest report")
2233 "Python-pytest-warnings is a pytest plugin to list Python warnings in
2235 (license license:expat)
2236 (properties `((python2-variant . ,(delay python2-pytest-warnings))
2237 ;; This package is part of pytest as of version 3.1.0.
2238 (superseded . ,python-pytest)))))
2240 (define-public python2-pytest-warnings
2241 (package (inherit (package-with-python2
2242 (strip-python2-variant python-pytest-warnings)))
2243 (properties `((superseded . ,python2-pytest)))))
2245 (define-public python-pytest-capturelog
2247 (name "python-pytest-capturelog")
2252 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
2255 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
2256 (build-system python-build-system)
2258 `(("pytest" ,python-pytest)))
2259 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
2260 (synopsis "Pytest plugin to catch log messages")
2262 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
2263 (license license:expat)))
2265 (define-public python2-pytest-capturelog
2266 (package-with-python2 python-pytest-capturelog))
2268 (define-public python-pytest-catchlog
2270 (name "python-pytest-catchlog")
2275 (uri (pypi-uri "pytest-catchlog" version ".zip"))
2278 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
2279 (build-system python-build-system)
2281 `(("unzip" ,unzip)))
2283 `(("pytest" ,python-pytest)))
2284 (home-page "https://github.com/eisensheng/pytest-catchlog")
2285 (synopsis "Pytest plugin to catch log messages")
2287 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
2288 a fork of pytest-capturelog.")
2289 (license license:expat)))
2291 (define-public python2-pytest-catchlog
2292 (package-with-python2 python-pytest-catchlog))
2294 (define-public python-nosexcover
2296 (name "python-nosexcover")
2300 (uri (pypi-uri "nosexcover" version))
2303 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
2304 (build-system python-build-system)
2306 `(("python-coverage" ,python-coverage)
2307 ("python-nose" ,python-nose)))
2308 (home-page "https://github.com/cmheisel/nose-xcover")
2309 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
2310 (description "Nose-xcover is a companion to the built-in
2311 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
2312 to a file named coverage.xml.
2314 It will honor all the options you pass to the Nose coverage plugin,
2315 especially -cover-package.")
2316 (license license:expat)))
2318 (define-public python2-nosexcover
2319 (package-with-python2 python-nosexcover))
2321 (define-public python-discover
2323 (name "python-discover")
2328 (uri (pypi-uri "discover" version))
2331 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
2332 (build-system python-build-system)
2333 (home-page "https://pypi.org/project/discover/")
2335 "Python test discovery for unittest")
2337 "Discover provides test discovery for unittest, a feature that has been
2338 backported from Python 2.7 for Python 2.4+.")
2339 (license license:bsd-3)))
2341 (define-public python2-discover
2342 (package-with-python2 python-discover))
2344 (define-public behave
2350 (uri (pypi-uri "behave" version))
2353 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))
2354 (patches (search-patches
2355 "behave-skip-a-couple-of-tests.patch"))))
2356 (build-system python-build-system)
2358 `(("python-mock" ,python-mock)
2359 ("python-nose" ,python-nose)
2360 ("python-pathpy" ,python-pathpy)
2361 ("python-pyhamcrest" ,python-pyhamcrest)
2362 ("python-pytest" ,python-pytest)))
2364 `(("python-importlib-metadata" ,python-importlib-metadata)
2365 ("python-six" ,python-six)
2366 ("python-parse" ,python-parse)
2367 ("python-parse-type" ,python-parse-type)))
2369 '(#:test-target "behave_test"
2371 (modify-phases %standard-phases
2372 (add-before 'check 'fix-library-loading
2374 ;; Otherwise, tests fail with no module named 'path'
2375 (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH") ":"
2376 (getcwd) "/tasks/_vendor"))
2378 (home-page "https://github.com/behave/behave")
2379 (synopsis "Python behavior-driven development")
2381 "Behave is a tool for behavior-driven development in python.
2382 Behavior-driven development (or BDD) is an agile software development
2383 technique that encourages collaboration between developers, QA and
2384 non-technical or business participants in a software project. Behave uses
2385 tests written in a natural language style, backed up by Python code.")
2386 (license license:x11)))
2388 (define-public python-behave-web-api
2390 (name "python-behave-web-api")
2395 (uri (pypi-uri "behave-web-api" version))
2398 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
2399 (build-system python-build-system)
2402 (modify-phases %standard-phases
2403 (add-after 'unpack 'fix-dependencies
2405 (substitute* "setup.py"
2406 (("'wheel'") "") ; We don't use it.
2407 (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
2410 `(("behave" ,behave)
2411 ("python-requests" ,python-requests)))
2412 (home-page "https://github.com/jefersondaniel/behave-web-api")
2413 (synopsis "Provides testing for JSON APIs with Behave for Python")
2414 (description "This package provides testing utility modules for testing
2415 JSON APIs with Behave.")
2416 (license license:expat)))
2418 (define-public python-rednose
2420 (name "python-rednose")
2425 (uri (pypi-uri "rednose" version))
2428 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
2429 (build-system python-build-system)
2431 `(#:phases (modify-phases %standard-phases
2432 (add-after 'unpack 'patch-setup.py
2434 ;; Six is only required for tests and later versions
2436 (substitute* "setup.py"
2437 (("six==1.10.0") "six"))
2440 `(("python-colorama" ,python-colorama)
2441 ("python-termstyle" ,python-termstyle)))
2443 `(("python-six" ,python-six)
2444 ("python-nose" ,python-nose)))
2445 (home-page "https://github.com/JBKahn/rednose")
2446 (synopsis "Colored output for Python nosetests")
2447 (description "This package provides colored output for the
2448 @command{nosetests} command of the Python Nose unit test framework.")
2449 (license license:bsd-3)))
2451 (define-public python2-rednose
2452 (package-with-python2 python-rednose))
2454 (define-public python-nose-random
2456 (name "python-nose-random")
2462 (url "https://github.com/fzumstein/nose-random")
2464 (file-name (git-file-name name version))
2467 "1dvip61r2frjv35mv6mmfjc07402z73pjbndfp3mhxyjn2zhksw2"))))
2468 (build-system python-build-system)
2470 `(("python-nose" ,python-nose)))
2471 (home-page "https://github.com/fzumstein/nose-random")
2472 (synopsis "Nose plugin to facilitate randomized unit testing with
2474 (description "Python nose-random is designed to facilitate
2475 Monte-Carlo style unit testing. The idea is to improve testing by
2476 running your code against a large number of randomly generated input
2478 (license license:expat)))
2480 (define-public python-nose-randomly
2482 (name "python-nose-randomly")
2487 (uri (pypi-uri "nose-randomly" version))
2489 (base32 "0z662rqhfk4bjmg806mn4frb8nz4gbh7mrddsrhfffp1g4yklj3y"))))
2490 (build-system python-build-system)
2492 `(("python-nose" ,python-nose)
2493 ("python-numpy" ,python-numpy)))
2494 (home-page "https://github.com/adamchainz/nose-randomly")
2496 "Nose plugin to randomly order tests and control random.seed")
2498 "This is a @code{Nose} plugin to randomly order tests which can be quite
2499 powerful in discovering hidden flaws in the tests themselves, while helping to
2500 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
2501 by resetting it to a repeatable number for each test, enabling the tests to
2502 create data based on random numbers and yet remain repeatable.")
2503 (license license:bsd-3)))
2505 (define-public python2-nose-randomly
2506 (package-with-python2 python-nose-randomly))
2508 (define-public python-nose-timer
2510 (name "python-nose-timer")
2515 (uri (pypi-uri "nose-timer" version))
2517 (base32 "05wzkc88vbzw62pqkvhl33211b90kns0lny70b7qw62rcg4flzk4"))))
2518 (build-system python-build-system)
2520 `(("python-nose" ,python-nose)
2521 ("python-termcolor" ,python-termcolor)))
2522 (home-page "https://github.com/mahmoudimus/nose-timer")
2523 (synopsis "Timer plugin for nosetests")
2524 (description "Shows how much time was needed to run individual tests.")
2525 (license license:expat)))
2527 (define-public python2-nose-timer
2528 (package-with-python2 python-nose-timer))
2530 (define-public python-freezegun
2532 (name "python-freezegun")
2537 (uri (pypi-uri "freezegun" version))
2539 (base32 "0al75mk829j1izxi760b7yjnknjihyfhp2mvi5qiyrxb9cpxwqk2"))))
2540 (build-system python-build-system)
2542 `(("python-mock" ,python-mock)
2543 ("python-pytest" ,python-pytest)))
2545 `(("python-six" ,python-six)
2546 ("python-dateutil" ,python-dateutil)))
2549 (modify-phases %standard-phases
2550 ;; The tests are normally executed via `make test`, but the PyPi
2551 ;; package does not include the Makefile.
2554 (invoke "pytest" "-vv"))))))
2555 (home-page "https://github.com/spulec/freezegun")
2556 (synopsis "Test utility for mocking the datetime module")
2558 "FreezeGun is a library that allows your python tests to travel through
2559 time by mocking the datetime module.")
2560 (license license:asl2.0)))
2562 (define-public python2-freezegun
2563 (package-with-python2 python-freezegun))
2565 (define-public python-flexmock
2567 (name "python-flexmock")
2571 (uri (pypi-uri "flexmock" version))
2574 "0b6qw3grhgx58kxlkj7mdma7xdvlj02zabvcf7w2qifnfjwwwcsh"))))
2575 (build-system python-build-system)
2576 (home-page "https://flexmock.readthedocs.org")
2577 (synopsis "Testing library for Python")
2579 "flexmock is a testing library for Python that makes it easy to create
2580 mocks, stubs and fakes.")
2581 (license license:bsd-3)))
2583 (define-public python2-flexmock
2584 (package-with-python2 python-flexmock))
2586 (define-public python-flaky
2588 (name "python-flaky")
2592 (uri (pypi-uri "flaky" version))
2595 "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j"))))
2596 (build-system python-build-system)
2598 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2600 (home-page "https://github.com/box/flaky")
2601 (synopsis "Automatically rerun flaky tests")
2603 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2606 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2607 on components that aren't 100% reliable. With flaky, instead of removing
2608 those tests or marking them to @code{@@skip}, they can be automatically
2610 (license license:asl2.0)))
2612 (define-public python2-flaky
2613 (package-with-python2 python-flaky))
2615 (define-public python-pyhamcrest
2616 ;; The latest release was in 2016 and its test suite does not work with recent
2617 ;; versions of Pytest. Just take the master branch for now, which seems stable.
2618 (let ((commit "25fdc5f00bdf3084335353bc9247253098ec4cf2")
2621 (name "python-pyhamcrest")
2622 (version (git-version "1.9.0" revision commit))
2624 ;; Tests not distributed from pypi release.
2627 (url "https://github.com/hamcrest/PyHamcrest")
2629 (file-name (git-file-name name version))
2632 "1miqmhhi68vaix8sqc1lvpvbm27bacffxh5anm5cbfsvk7g9n6f3"))))
2633 (native-inputs ;all native inputs are for tests
2634 `(("python-pytest-cov" ,python-pytest-cov)
2635 ("python-mock" ,python-mock)
2636 ("python-pytest" ,python-pytest)
2637 ("python-hypothesis" ,python-hypothesis)))
2639 `(("python-six" ,python-six)))
2640 (build-system python-build-system)
2642 `(#:phases (modify-phases %standard-phases
2645 (setenv "PYTHONPATH"
2646 (string-append "build/lib:"
2647 (getenv "PYTHONPATH")))
2648 (invoke "pytest" "-vv"))))))
2649 (home-page "http://hamcrest.org/")
2650 (synopsis "Hamcrest matchers for Python")
2652 "PyHamcrest is a framework for writing matcher objects,
2653 allowing you to declaratively define \"match\" rules.")
2654 (license license:bsd-3))))
2656 (define-public python2-pyhamcrest
2657 (package-with-python2 python-pyhamcrest))
2659 (define-public unittest-cpp
2661 (name "unittest-cpp")
2666 (url "https://github.com/unittest-cpp/unittest-cpp")
2667 (commit (string-append "v" version))))
2668 (file-name (git-file-name name version))
2670 (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
2672 `(#:tests? #f)) ; It's run after build automatically.
2673 (build-system cmake-build-system)
2674 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2675 (synopsis "Lightweight unit testing framework for C++")
2676 (description "UnitTest++ is a lightweight unit testing framework for C++.
2677 It was designed to do test-driven development on a wide variety of platforms.
2678 Simplicity, portability, speed, and small footprint are all very important
2679 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2680 of advanced library and language features, which means it should be easily
2681 portable to just about any platform.")
2682 (license license:expat)))
2684 (define-public libfaketime
2686 (name "libfaketime")
2688 (home-page "https://github.com/wolfcw/libfaketime")
2693 (commit (string-append "v" version))))
2696 "1mfdl82ppgbdvy1ny8mb7xii7p0g7awvn4bn36jb8v4r545slmjc"))
2697 (file-name (git-file-name name version))))
2698 (build-system gnu-build-system)
2700 '(#:phases (modify-phases %standard-phases
2702 (lambda* (#:key outputs #:allow-other-keys)
2703 (let ((out (assoc-ref outputs "out")))
2705 (setenv "PREFIX" out)
2707 ;; XXX: Without this flag, the CLOCK_REALTIME test hangs
2708 ;; indefinitely. See README.packagers for more information.
2709 ;; Try removing this for future versions of libfaketime.
2710 (setenv "FAKETIME_COMPILE_CFLAGS" "-DFORCE_MONOTONIC_FIX")
2713 (add-before 'check 'pre-check
2715 (substitute* "test/functests/test_exclude_mono.sh"
2716 (("/bin/bash") (which "bash")))
2718 ;; Do not fail due to use of 'ftime', which was deprecated in
2719 ;; glibc 2.31. Remove this for later versions of libfaketime.
2720 (setenv "FAKETIME_COMPILE_CFLAGS" "-Wno-deprecated-declarations")
2722 #:test-target "test"))
2724 `(("perl" ,perl))) ;for tests
2725 (synopsis "Fake the system time for single applications")
2727 "The libfaketime library allows users to modify the system time that an
2728 application \"sees\". It is meant to be loaded using the dynamic linker's
2729 @code{LD_PRELOAD} environment variable. The @command{faketime} command
2730 provides a simple way to achieve this.")
2731 (license license:gpl2)))
2733 (define-public umockdev
2739 (uri (string-append "https://github.com/martinpitt/umockdev/"
2740 "releases/download/" version "/"
2741 "umockdev-" version ".tar.xz"))
2744 "0xmi24ckpps32k7hc139psgbsnsf4g106sv4l9m445m46amkxggd"))))
2745 (build-system gnu-build-system)
2748 (modify-phases %standard-phases
2749 (add-after 'unpack 'fix-test
2751 (substitute* "tests/test-umockdev.c"
2756 ("gobject-introspection" ,gobject-introspection)
2757 ("gtk-doc" ,gtk-doc/stable)
2758 ("pkg-config" ,pkg-config)
2766 ("libgudev" ,libgudev)))
2767 (home-page "https://github.com/martinpitt/umockdev/")
2768 (synopsis "Mock hardware devices for creating unit tests")
2769 (description "umockdev mocks hardware devices for creating integration
2770 tests for hardware related libraries and programs. It also provides tools to
2771 record the properties and behaviour of particular devices, and to run a
2772 program or test suite under a test bed with the previously recorded devices
2774 (license license:lgpl2.1+)))
2776 (define-public virtest
2777 ;; No releases yet, so we take the commit that "vc" expects.
2778 (let ((commit "f7d03ef39fceba168745bd29e1b20af6e7971e04")
2782 (version (git-version "0.0" revision commit))
2783 (home-page "https://github.com/mattkretz/virtest")
2786 (uri (git-reference (url home-page) (commit commit)))
2787 (file-name (git-file-name name version))
2790 "07pjyb0mk7y2w1dg1bhl26nb7416xa1mw16ifj6mmps5y6aq054l"))))
2791 (build-system cmake-build-system)
2793 `(#:phases (modify-phases %standard-phases
2794 (add-after 'unpack 'adjust-install-directory
2796 ;; Vc is the only consumer of this library, and expects
2797 ;; to find it in "virtest/vir/" instead of "vir/vir/".
2798 (substitute* "CMakeLists.txt"
2799 (("DESTINATION include/vir")
2800 "DESTINATION include/virtest"))
2802 (synopsis "Header-only test framework")
2804 "@code{virtest} is a small header-only test framework for C++. It
2805 grew out of the @dfn{Vc} project.")
2806 (license license:bsd-3))))
2808 (define-public python-pyfakefs
2810 (name "python-pyfakefs")
2814 ;; We use the PyPI URL because there is no proper release
2815 ;; available from GitHub. The GitHub project only provides
2816 ;; autogenerated tarballs, which are known to change in place.
2817 (uri (pypi-uri "pyfakefs" version))
2820 "1cp2yw96fa2qkgi39xa3nlr3inf8wb5rgh9kdq53256ca2r8pdhy"))
2821 (patches (search-patches
2822 "python-pyfakefs-remove-bad-test.patch"))
2823 (file-name (string-append name "-" version ".tar.gz"))))
2826 (modify-phases %standard-phases
2827 ;; The default test suite does not run these extra tests.
2828 (add-after 'check 'check-pytest-plugin
2831 "python" "-m" "pytest"
2832 "pyfakefs/pytest_tests/pytest_plugin_test.py")
2835 `(("python-pytest" ,python-pytest)))
2836 (build-system python-build-system)
2837 ;; Guix lint doesn't like that this is a permanent redirect to the GitHub
2838 ;; page, but the pyfakefs documentation asks us to use this specific URL
2839 ;; when linking to the project. Honor their request.
2840 (home-page "http://pyfakefs.org/")
2841 ;; TRANSLATORS: In the synopsis, "Mock" is a verb.
2842 (synopsis "Mock file system interactions in tests")
2844 "This package provides a Python library intended for use in automated
2845 tests. One difficulty when testing software is that the code under test might
2846 need to read or write to files in the local file system. If the file system
2847 is not set up in just the right way, it might cause a spurious error during
2848 the test. The pyfakefs library provides a solution to problems like this by
2849 mocking file system interactions. In other words, it arranges for the code
2850 under test to interact with a fake file system instead of the real file
2851 system. The code under test requires no modification to work with pyfakefs.")
2852 (license license:asl2.0)))
2854 ;; This minimal variant is used to avoid a circular dependency between
2855 ;; python2-importlib-metadata, which requires pyfakefs for its tests, and
2856 ;; python2-pytest, which requires python2-importlib-metadata.
2857 (define-public python2-pyfakefs-bootstrap
2860 (inherit (package-with-python2 python-pyfakefs))
2861 (name "python2-pyfakefs-bootstrap")
2864 `(#:python ,python-2
2867 (define-public python-aiounittest
2869 (name "python-aiounittest")
2871 ;; Pypi package lacks tests.
2873 (origin (method git-fetch)
2875 (url "https://github.com/kwarunek/aiounittest.git")
2877 (file-name (git-file-name name version))
2880 "0hql5mw62lclrpblbh7xvinwjfcdcfvhhlvl7xlq2hi9isjq1c8r"))))
2881 (build-system python-build-system)
2883 '(#:phases (modify-phases %standard-phases
2885 (lambda* (#:key tests? #:allow-other-keys)
2887 (invoke "nosetests" "-v")
2888 (format #t "test suite not run~%"))
2890 (propagated-inputs `(("python-wrapt" ,python-wrapt)))
2892 `(("python-coverage" ,python-coverage)
2893 ("python-nose" ,python-nose)))
2895 "https://github.com/kwarunek/aiounittest")
2896 (synopsis "Test asyncio code more easily")
2897 (description "Aiounittest is a library that helps write tests using
2898 asynchronous code in Python (asyncio).")
2899 (license license:expat)))
2901 (define-public python-pytest-dependency
2903 (name "python-pytest-dependency")
2908 (uri (pypi-uri "pytest-dependency" version))
2911 "0swl3mxca7nnjbb5grfzrm3fa2750h9vjsha0f2kyrljc6895a62"))))
2912 (build-system python-build-system)
2914 `(("python-pytest" ,python-pytest)))
2916 "https://github.com/RKrahl/pytest-dependency")
2917 (synopsis "Manage dependencies of tests")
2918 (description "This pytest plugin manages dependencies of tests. It allows
2919 to mark some tests as dependent from other tests. These tests will then be
2920 skipped if any of the dependencies did fail or has been skipped.")
2921 (license license:asl2.0)))
2923 (define-public python-pytest-datadir
2925 (name "python-pytest-datadir")
2930 (uri (pypi-uri "pytest-datadir" version))
2933 "066bg6wlzgq2pqnjp73dfrcmk8951xw3aqcxa3p1axgqimrixbyk"))))
2934 (build-system python-build-system)
2936 `(("python-setuptools-scm" ,python-setuptools-scm)))
2938 `(("python-pytest" ,python-pytest)
2939 ("python-wheel" ,python-wheel)))
2940 (home-page "https://github.com/gabrielcnr/pytest-datadir")
2941 (synopsis "Pytest plugin for manipulating test data directories and files")
2943 "This package provides a Pytest plugin for manipulating test data
2944 directories and files.")
2945 (license license:expat)))
2947 (define-public python-pytest-regressions
2949 (name "python-pytest-regressions")
2954 (uri (pypi-uri "pytest-regressions" version))
2957 "05jpsvv8rj8i4x24fphpnar5dl4s6d6bw6ikjk5d8v96rdviz9qm"))))
2958 (build-system python-build-system)
2960 `(("python-pytest-datadir" ,python-pytest-datadir)
2961 ("python-pyyaml" ,python-pyyaml)))
2963 `(("python-matplotlib" ,python-matplotlib)
2964 ("python-numpy" ,python-numpy)
2965 ("python-pandas" ,python-pandas)
2966 ("python-pillow" ,python-pillow)
2967 ("python-pre-commit" ,python-pre-commit)
2968 ("python-restructuredtext-lint"
2969 ,python-restructuredtext-lint)
2970 ("python-tox" ,python-tox)
2971 ("python-setuptools-scm" ,python-setuptools-scm)
2972 ("python-pytest" ,python-pytest)))
2973 (home-page "https://github.com/ESSS/pytest-regressions")
2974 (synopsis "Easy to use fixtures to write regression tests")
2976 "This plugin makes it simple to test general data, images, files, and numeric
2977 tables by saving expected data in a data directory (courtesy of pytest-datadir)
2978 that can be used to verify that future runs produce the same data.")
2979 (license license:expat)))