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 Efraim Flashner <efraim@flashner.co.il>
11 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
12 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
13 ;;; Copyright © 2016, 2017 Danny Milosavljevic <dannym+a@scratchpost.org>
14 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
15 ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
16 ;;; Copyright © 2016 Troy Sankey <sankeytms@gmail.com>
17 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
18 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
19 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
20 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
21 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
22 ;;; Copyright © 2017, 2018 Arun Isaac <arunisaac@systemreboot.net>
23 ;;; Copyright © 2017 Frederick M. Muriithi <fredmanglis@gmail.com>
24 ;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
25 ;;; Copyright © 2017, 2019 Kei Kebreau <kkebreau@posteo.net>
26 ;;; Copyright © 2017 Nikita <nikita@n0.is>
27 ;;; Copyright © 2015, 2017, 2018, 2020 Ricardo Wurmus <rekado@elephly.net>
28 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
29 ;;; Copyright © 2017, 2018, 2020 Ludovic Courtès <ludo@gnu.org>
30 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
31 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
32 ;;; Copyright © 2019 Chris Marusich <cmmarusich@gmail.com>
33 ;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org>
34 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
35 ;;; Copyright © 2020 Josh Marshall <joshua.r.marshall.1991@gmail.com>
36 ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
38 ;;; This file is part of GNU Guix.
40 ;;; GNU Guix is free software; you can redistribute it and/or modify it
41 ;;; under the terms of the GNU General Public License as published by
42 ;;; the Free Software Foundation; either version 3 of the License, or (at
43 ;;; your option) any later version.
45 ;;; GNU Guix is distributed in the hope that it will be useful, but
46 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
47 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48 ;;; GNU General Public License for more details.
50 ;;; You should have received a copy of the GNU General Public License
51 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
53 (define-module (gnu packages check)
54 #:use-module (gnu packages)
55 #:use-module (gnu packages autotools)
56 #:use-module (gnu packages base)
57 #:use-module (gnu packages bash)
58 #:use-module (gnu packages compression)
59 #:use-module (gnu packages linux)
60 #:use-module (gnu packages llvm)
61 #:use-module (gnu packages glib)
62 #:use-module (gnu packages gnome)
63 #:use-module (gnu packages golang)
64 #:use-module (gnu packages gtk)
65 #:use-module (gnu packages perl)
66 #:use-module (gnu packages pkg-config)
67 #:use-module (gnu packages python)
68 #:use-module (gnu packages python-web)
69 #:use-module (gnu packages python-xyz)
70 #:use-module (gnu packages time)
71 #:use-module (gnu packages xml)
72 #:use-module (guix utils)
73 #:use-module ((guix licenses) #:prefix license:)
74 #:use-module (guix packages)
75 #:use-module (guix download)
76 #:use-module (guix git-download)
77 #:use-module (guix build-system cmake)
78 #:use-module (guix build-system gnu)
79 #:use-module (guix build-system go)
80 #:use-module (guix build-system python)
81 #:use-module (guix build-system trivial))
90 (uri (string-append "https://github.com/libcheck/check/releases/download/"
91 version "/check-" version ".tar.gz"))
94 "02zkfiyklckmivrfvdsrlzvzphkdsgjrz3igncw05dv5pshhq3xx"))))
95 (build-system gnu-build-system)
96 (home-page "https://libcheck.github.io/check/")
97 (synopsis "Unit test framework for C")
99 "Check is a unit testing framework for C. It features a simple
100 interface for defining unit tests, putting little in the way of the
101 developer. Tests are run in a separate address space, so Check can
102 catch both assertion failures and code errors that cause segmentation
103 faults or other signals. The output from unit tests can be used within
104 source code editors and IDEs.")
105 (license license:lgpl2.1+)))
107 ;; Some packages require this older version. Removed once no longer needed.
108 (define-public check-0.12
114 (uri (string-append "https://github.com/libcheck/check/releases"
115 "/download/" version "/check-" version ".tar.gz"))
118 "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6"))))))
127 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
128 version "/CUnit-" version ".tar.bz2"))
131 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
132 (build-system gnu-build-system)
133 (arguments '(#:phases
134 (modify-phases %standard-phases
135 ;; XXX: The "bootstrap" phase detects the "bootstrap"
136 ;; script, but fails to execute it, so we bootstrap
139 (lambda _ (invoke "autoreconf" "-vfi"))))))
141 `(("automake" ,automake)
142 ("autoconf" ,autoconf)
143 ("libtool" ,libtool)))
144 (home-page "http://cunit.sourceforge.net/")
145 (synopsis "Automated testing framework for C")
147 "CUnit is a lightweight system for writing, administering, and running
148 unit tests in C. It provides C programmers with basic testing functionality
149 with a flexible variety of user interfaces.")
150 (license license:gpl2+)))
152 (define-public cppunit
158 (uri (string-append "http://dev-www.libreoffice.org/src/"
159 name "-" version ".tar.gz"))
162 "1027cyfx5gsjkdkaf6c2wnjh68882grw8n672018cj3vs9lrhmix"))))
163 ;; Explicitly link with libdl. This is expected to be done by packages
164 ;; relying on cppunit for their tests. However, not all of them do.
165 ;; If we added the linker flag to such packages, we would pollute all
166 ;; binaries, not only those used for testing.
168 `(#:make-flags '("LDFLAGS=-ldl")))
169 (build-system gnu-build-system)
170 (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
171 (synopsis "Unit testing framework for C++")
172 (description "CppUnit is the C++ port of the famous JUnit framework for
173 unit testing. Test output is in XML for automatic testing and GUI based for
175 (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
177 ;; When dependent packages upgraded to use newer version of catch, this one should
179 (define-public catch-framework
182 (version "1.3.5") ;Sub-minor is the build number
186 (url "https://github.com/philsquared/Catch")
188 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
189 (file-name (string-append name "-" version))
192 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
193 (build-system trivial-build-system)
195 `(#:modules ((guix build utils))
197 (use-modules (guix build utils))
198 (let* ((source (assoc-ref %build-inputs "source"))
199 (output (assoc-ref %outputs "out"))
200 (incdir (string-append output "/include"))
201 (docdir (string-append output "/share/doc/catch-"
203 (for-each mkdir-p (list incdir docdir))
204 (install-file (string-append source
205 "/single_include/catch.hpp")
207 (copy-recursively (string-append source "/docs")
210 (home-page "http://catch-lib.net/")
211 (synopsis "Automated test framework for C++ and Objective-C")
213 "Catch stands for C++ Automated Test Cases in Headers and is a
214 multi-paradigm automated test framework for C++ and Objective-C.")
215 (license license:boost1.0)))
217 (define-public catch-framework2-1
221 (home-page "https://github.com/catchorg/Catch2")
225 (url "https://github.com/catchorg/Catch2")
226 (commit (string-append "v" version))))
227 (file-name (git-file-name name version))
230 "1gdp5wm8khn02g2miz381llw3191k7309qj8s3jd6sasj01rhf23"))))
231 (build-system cmake-build-system)
232 (synopsis "Automated test framework for C++ and Objective-C")
233 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
234 a multi-paradigm automated test framework for C++ and Objective-C.")
235 (license license:boost1.0)))
237 (define-public catch-framework2
241 (home-page "https://github.com/catchorg/Catch2")
245 (url "https://github.com/catchorg/Catch2")
246 (commit (string-append "v" version))))
247 (file-name (git-file-name name version))
250 "14vcckqmbydjsg40ngi6iv999zimysh2l7fmrqj1d7xl990qz233"))))
251 (build-system cmake-build-system)
253 `(("python" ,python-wrapper)))
254 (synopsis "Automated test framework for C++ and Objective-C")
255 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
256 a multi-paradigm automated test framework for C++ and Objective-C.")
257 (license license:boost1.0)))
259 (define-public cmdtest
265 (uri (string-append "http://git.liw.fi/cmdtest/snapshot/"
266 name "-" version ".tar.gz"))
269 "1jmfiyrrqmpvwdb273bkb8hjaf4rwx9njblx29pmr7giyahskwi5"))))
270 (build-system python-build-system)
274 (modify-phases %standard-phases
275 ;; check phase needs to be run before the build phase. If not, the
276 ;; coverage test runner looks for tests for the built source files,
279 (add-before 'build 'check
282 (("/bin/sh") (which "sh")))
283 ;; yarn uses python2-ttystatus to print messages.
284 ;; python2-ttystatus requires /dev/tty which is not present in
285 ;; the build environment. Hence assuming-failure test fails.
286 (delete-file "yarn.tests/assuming-failure.script")
287 (delete-file "yarn.tests/assuming-failure.stdout")
288 (invoke "python" "setup.py" "check"))))))
290 `(("python2-coverage-test-runner" ,python2-coverage-test-runner)))
292 `(("python2-cliapp" ,python2-cliapp)
293 ("python2-markdown" ,python2-markdown)
294 ("python2-ttystatus" ,python2-ttystatus)))
295 (home-page "https://liw.fi/cmdtest/")
296 (synopsis "Black box Unix program tester")
298 "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
299 given a command line and input files, and the expected output, and it verifies
300 that the command line produces the expected output. If not, it reports a
301 problem, and shows the differences.")
302 (license license:gpl3+)))
304 (define-public cmocka
310 (uri (string-append "https://cmocka.org/files/"
311 (version-major+minor version) "/cmocka-"
315 "1dm8pdvkyfa8dsbz9bpq7wwgixjij4sii9bbn5sgvqjm5ljdik7h"))))
316 (build-system cmake-build-system)
318 `(#:tests? #f)) ; no test target
319 (home-page "https://cmocka.org/")
320 (synopsis "Unit testing framework for C")
321 (description "Cmocka is a unit testing framework for C with support for
322 mock objects. It only requires the standard C library, and works with
323 different compilers. Cmocka supports several different message output formats
324 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
326 (license license:asl2.0)))
328 (define-public cppcheck
335 (url "https://github.com/danmar/cppcheck")
337 (file-name (git-file-name name version))
339 (base32 "0h7ir2x0k005fm586dxmaphgv5cyz25k3k4sh02p7zb78gzx398h"))))
340 (build-system cmake-build-system)
342 '(#:configure-flags '("-DBUILD_TESTS=ON")))
343 (home-page "http://cppcheck.sourceforge.net")
344 (synopsis "Static C/C++ code analyzer")
345 (description "Cppcheck is a static code analyzer for C and C++. Unlike
346 C/C++ compilers and many other analysis tools it does not detect syntax errors
347 in the code. Cppcheck primarily detects the types of bugs that the compilers
348 normally do not detect. The goal is to detect only real errors in the code
349 (i.e. have zero false positives).")
350 (license license:gpl3+)))
352 (define-public cxxtest
358 (uri (string-append "mirror://sourceforge/cxxtest/cxxtest/"
359 version "/cxxtest-" version ".tar.gz"))
362 "1n7pbj4z9ivx005hqvivj9ddhq8awynzg6jishfbypf6j7ply58w"))))
363 (build-system python-build-system)
366 (modify-phases %standard-phases
367 (add-after 'unpack 'chdir-to-source
371 (add-after 'install 'install-headers
372 (lambda* (#:key outputs #:allow-other-keys)
373 (let* ((out (assoc-ref outputs "out"))
374 (include-dir (string-append out "/include/cxxtest")))
375 (for-each (lambda (header-file)
376 (install-file header-file include-dir))
377 (find-files "../cxxtest"))
379 (add-after 'install 'install-doc
380 (lambda* (#:key outputs #:allow-other-keys)
381 (let* ((out (assoc-ref outputs "out"))
382 (doc-dir (string-append out "/share/doc/cxxtest")))
383 (install-file "../README" doc-dir)
384 (install-file "../doc/guide.txt" doc-dir)
385 (copy-recursively "../sample" (string-append doc-dir "/sample"))
388 `(("python-ply" ,python-ply)))
389 (home-page "https://cxxtest.com/")
390 (synopsis "Unit testing framework for C++")
391 (description "CxxTest is a unit testing framework for C++ that is similar
392 in spirit to JUnit, CppUnit, and xUnit. CxxTest does not require precompiling
393 a CxxTest testing library, it employs no advanced features of C++ (e.g. RTTI)
394 and it supports a very flexible form of test discovery.")
395 (license license:lgpl3+)))
397 (define-public doctest
401 (home-page "https://github.com/onqtam/doctest")
404 (uri (git-reference (url home-page) (commit version)))
405 (file-name (git-file-name name version))
408 "16w907750jnp98vdzkn72lzwy1zyryaqvfi80lbdp398pj23rq65"))))
409 (build-system cmake-build-system)
410 (synopsis "C++ test framework")
412 "doctest is a single-header testing framework for C++11 and later. It
413 has been designed to be fast, light and unintrusive.")
414 (license license:expat)))
416 (define-public go-gopkg.in-check.v1
417 (let ((commit "788fd78401277ebd861206a03c884797c6ec5541")
420 (name "go-gopkg.in-check.v1")
421 (version (git-version "0.0.0" revision commit))
425 (url "https://github.com/go-check/check.git")
427 (file-name (git-file-name name version))
430 "0v3bim0j375z81zrpr5qv42knqs0y2qv2vkjiqi5axvb78slki1a"))))
431 (build-system go-build-system)
433 '(#:import-path "gopkg.in/check.v1"))
435 `(("go-github-com-kr-pretty" ,go-github-com-kr-pretty)))
436 (synopsis "Rich testing extension for Go's testing package")
438 "@code{check} is a rich testing extension for Go's testing package.")
439 (home-page "https://github.com/go-check/check")
440 (license license:bsd-2))))
442 (define-public go-github.com-smartystreets-gunit
444 (name "go-github.com-smartystreets-gunit")
449 (url "https://github.com/smartystreets/gunit")
451 (file-name (git-file-name name version))
454 "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
455 (build-system go-build-system)
457 '(;; TODO: This package depends on go-github.com-smartystreets-assertions
458 ;; for running the tests, but go-github.com-smartystreets-assertions
459 ;; depends on this package, so break this loop by not running the tests
462 #:import-path "github.com/smartystreets/gunit"))
463 (synopsis "Testing tool for Go, in the style of xUnit")
465 "@code{gunit} allows the test author to use a struct as the scope for a
466 group of related test cases, in the style of xUnit fixtures. This makes
467 extraction of setup/teardown behavior (as well as invoking the system under
468 test) much simpler.")
469 (home-page "https://github.com/smartystreets/gunit")
470 (license license:expat)))
472 (define-public go-github.com-smartystreets-assertions
474 (name "go-github.com-smartystreets-assertions")
479 (url "https://github.com/smartystreets/assertions")
481 (file-name (git-file-name name version))
484 "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
485 (build-system go-build-system)
487 '(#:import-path "github.com/smartystreets/assertions"))
489 `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
490 (synopsis "Assertions for testing with Go")
492 "The @code{assertions} package provides convenient assertion functions
493 for writing tests in Go.")
494 (home-page "https://github.com/smartystreets/assertions")
495 (license license:expat)))
497 (define-public go-github.com-smartystreets-goconvey
499 (name "go-github.com-smartystreets-goconvey")
504 (url "https://github.com/smartystreets/goconvey")
506 (file-name (git-file-name name version))
509 "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
510 (build-system go-build-system)
512 '(#:import-path "github.com/smartystreets/goconvey"))
514 `(("go-github.com-jtolds-gls" ,go-github.com-jtolds-gls)
515 ("go-github.com-smartystreets-assertions" ,go-github.com-smartystreets-assertions)))
516 (synopsis "Go testing tool with both a web and terminal user interface")
518 "GoConvey is a testing tool for Go. It integrates with go test, can show
519 test coverage and has a web user interface that will refresh automatically.")
520 (home-page "https://github.com/smartystreets/goconvey")
521 (license license:expat)))
523 (define-public googletest
531 (url "https://github.com/google/googletest.git")
532 (commit (string-append "release-" version))))
533 (file-name (git-file-name name version))
535 (base32 "1zbmab9295scgg4z2vclgfgjchfjailjnvzc6f5x9jvlsdi3dpwz"))))
536 (build-system cmake-build-system)
538 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
540 `(("python" ,python-wrapper)))
541 (home-page "https://github.com/google/googletest/")
542 (synopsis "Test discovery and XUnit test framework")
543 (description "Google Test features an XUnit test framework, automated test
544 discovery, death tests, assertions, parameterized tests and XML test report
546 (license license:bsd-3)))
548 (define-public googletest-1.8
555 (url "https://github.com/google/googletest.git")
556 (commit (string-append "release-" version))))
557 (file-name (git-file-name "googletest" version))
560 "0270msj6n7mggh4xqqjp54kswbl7mkcc8px1p5dqdpmw5ngh9fzk"))))))
562 (define-public cpputest
569 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
570 version "/cpputest-" version ".tar.gz"))
573 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
574 (build-system gnu-build-system)
576 `(("googletest" ,googletest)))
577 (home-page "https://cpputest.github.io/")
578 (synopsis "Unit testing and mocking framework for C/C++")
580 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
581 C++ but is used in C and C++ projects and frequently used in embedded systems
582 but it works for any C/C++ project.")
583 (license license:bsd-3)))
585 (define-public python-parameterized
587 (name "python-parameterized")
592 (uri (pypi-uri "parameterized" version))
594 (base32 "1444fdz5bj0k10nmhxv0bv2gfrfisi7hfzqdndb0pvhf4g3qq3qr"))))
595 (build-system python-build-system)
597 '(#:phases (modify-phases %standard-phases
599 (lambda* (#:key tests? #:allow-other-keys)
601 (invoke "nosetests" "-v")
602 (format #t "test suite not run~%"))
605 `(("python-mock" ,python-mock)
606 ("python-nose" ,python-nose)))
607 (home-page "https://github.com/wolever/parameterized")
608 (synopsis "Parameterized testing with any Python test framework")
610 "Parameterized is a Python library that aims to fix parameterized testing
611 for every Python test framework. It supports nose, py.test, and unittest.")
612 (properties `((python2-variant . ,(delay python2-parameterized))))
613 (license license:bsd-2)))
615 (define-public python2-parameterized
616 (let ((base (package-with-python2 (strip-python2-variant
617 python-parameterized))))
622 (inherit (package-source base))
623 (patches (search-patches "python2-parameterized-docstring-test.patch")))))))
625 (define-public python-minimock
627 (name "python-minimock")
632 (uri (pypi-uri "MiniMock" version))
635 "0k2sxb1ibnyg05iblz7zhbv825f1zk9906rab7883iqgvzmdzpsz"))))
636 (build-system python-build-system)
637 (home-page "https://pypi.org/project/MiniMock")
638 (synopsis "Simple Python library for using mock objects")
639 (description "MiniMock is a simple library for building mock objects with
641 (license license:expat)))
643 (define-public python2-minimock
644 (package-with-python2 python-minimock))
646 (define-public python-mock
653 (uri (pypi-uri "mock" version))
656 "1hrp6j0yrx2xzylfv02qa8kph661m6yq4p0mc8fnimch9j4psrc3"))))
658 `(("python-six" ,python-six)))
659 (build-system python-build-system)
661 ;; FIXME: Tests require "pytest", which depends on this package.
663 (home-page "https://github.com/testing-cabal/mock")
664 (synopsis "Python mocking and patching library for testing")
666 "Mock is a library for testing in Python. It allows you to replace parts
667 of your system under test with mock objects and make assertions about how they
669 (properties `((python2-variant . ,(delay python2-mock))))
670 (license license:expat)))
672 (define-public python2-mock
673 (let ((base (package-with-python2
674 (strip-python2-variant python-mock))))
675 (package (inherit base)
677 `(("python2-functools32" ,python2-functools32)
678 ("python2-funcsigs" ,python2-funcsigs)
679 ,@(package-propagated-inputs base))))))
681 (define-public python-nose
688 (uri (pypi-uri "nose" version))
691 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
692 (build-system python-build-system)
694 '(#:tests? #f)) ; FIXME: test suite fails
695 (home-page "http://readthedocs.org/docs/nose/")
696 (synopsis "Python testing library")
698 "Nose extends the unittest library to make testing easier.")
699 (license license:lgpl2.0+)))
701 (define-public python2-nose
702 (package-with-python2 python-nose))
704 (define-public python-nose2
706 (name "python-nose2")
711 (uri (pypi-uri "nose2" version))
714 "0pmbb6nk31yhgh4zkcblzxsznml7f7pf5q1ihgrwvbxv4mwzfql7"))))
715 (build-system python-build-system)
716 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
718 `(("python-cov-core" ,python-cov-core)
719 ("python-pytest-cov" ,python-pytest-cov)
720 ("python-six" ,python-six)))
721 (home-page "https://github.com/nose-devs/nose2")
722 (synopsis "Next generation of nicer testing for Python")
724 "Nose2 is the next generation of nicer testing for Python, based on the
725 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
726 better plugin api, being easier for users to configure, and simplifying internal
727 interfaces and processes.")
728 (license license:bsd-2)))
730 (define-public python2-nose2
731 (package-with-python2 python-nose2))
733 (define-public python-unittest2
735 (name "python-unittest2")
740 (uri (pypi-uri "unittest2" version))
742 (search-patches "python-unittest2-python3-compat.patch"
743 "python-unittest2-remove-argparse.patch"))
746 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
747 (build-system python-build-system)
750 (modify-phases %standard-phases
753 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
755 `(("python-six" ,python-six)
756 ("python-traceback2" ,python-traceback2)))
757 (home-page "https://pypi.org/project/unittest2/")
758 (synopsis "Python unit testing library")
760 "Unittest2 is a replacement for the unittest module in the Python
762 (license license:psfl)))
764 (define-public python2-unittest2
765 (package-with-python2 python-unittest2))
767 (define-public python-pytest
769 (name "python-pytest")
774 (uri (pypi-uri "pytest" version))
777 "139i9cjhrv5aici3skq8iihvfb3lq0d8xb5j7qycr2hlk8cfjpqd"))))
778 (build-system python-build-system)
781 (modify-phases %standard-phases
783 (lambda* (#:key (tests? #t) #:allow-other-keys)
785 (invoke "pytest" "-vv" "-k"
787 ;; These tests involve the /usr directory, and fails.
788 "not test_remove_dir_prefix"
789 " and not test_argcomplete"
790 ;; This test tries to override PYTHONPATH, and
791 ;; subsequently fails to locate the test libraries.
792 " and not test_collection"))
793 (format #t "test suite not run~%"))
796 `(("python-atomicwrites" ,python-atomicwrites)
797 ("python-attrs" ,python-attrs-bootstrap)
798 ("python-more-itertools" ,python-more-itertools)
799 ("python-packaging" ,python-packaging-bootstrap)
800 ("python-pluggy" ,python-pluggy)
801 ("python-py" ,python-py)
802 ("python-six" ,python-six-bootstrap)
803 ("python-wcwidth" ,python-wcwidth)))
805 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
807 ("python-hypothesis" ,python-hypothesis)
808 ("python-nose" ,python-nose)
809 ("python-mock" ,python-mock)
810 ("python-pytest" ,python-pytest-bootstrap)
811 ("python-setuptools-scm" ,python-setuptools-scm)
812 ("python-xmlschema" ,python-xmlschema)))
813 (home-page "https://docs.pytest.org/en/latest/")
814 (synopsis "Python testing library")
816 "Pytest is a testing tool that provides auto-discovery of test modules
817 and functions, detailed info on failing assert statements, modular fixtures,
818 and many external plugins.")
819 (license license:expat)
820 (properties `((python2-variant . ,(delay python2-pytest))))))
822 ;; Pytest 4.x are the last versions that support Python 2.
823 (define-public python2-pytest
825 (inherit (strip-python2-variant python-pytest))
826 (name "python2-pytest")
830 (uri (pypi-uri "pytest" version))
833 "0fgkmpc31nzy97fxfrkqbzycigdwxwwmninx3qhkzp81migggs0r"))))
834 (build-system python-build-system)
837 ,@(package-arguments python-pytest)))
839 `(("python-atomicwrites" ,python2-atomicwrites)
840 ("python-attrs" ,python2-attrs-bootstrap)
841 ("python-funcsigs" ,python2-funcsigs)
842 ("python-importlib-metadata" ,python2-importlib-metadata-bootstrap)
843 ("python-more-itertools" ,python2-more-itertools)
844 ("python-packaging" ,python2-packaging-bootstrap)
845 ("python-pathlib2" ,python2-pathlib2)
846 ("python-pluggy" ,python2-pluggy)
847 ("python-py" ,python2-py)
848 ("python-six" ,python2-six-bootstrap)
849 ("python-wcwidth" ,python2-wcwidth)))
851 `(("bash" ,bash) ;tests require 'compgen'
852 ("python-hypothesis" ,python2-hypothesis)
853 ("python-nose" ,python2-nose)
854 ("python-mock" ,python2-mock)
855 ("python-pytest" ,python2-pytest-bootstrap)
856 ("python-setuptools-scm" ,python2-setuptools-scm)))))
858 (define-public python-pytest-bootstrap
860 (inherit (strip-python2-variant python-pytest))
861 (name "python-pytest-bootstrap")
862 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
863 (arguments `(#:tests? #f))
864 (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
866 (define-public python2-pytest-bootstrap
870 (name "python2-pytest-bootstrap")
872 (substitute-keyword-arguments (package-arguments python2-pytest)
873 ((#:tests? _ #f) #f)))
875 `(("python-setuptools-scm" ,python2-setuptools-scm)))
877 `(("python-atomicwrites" ,python2-atomicwrites)
878 ("python-attrs" ,python2-attrs-bootstrap)
879 ("python-funcsigs" ,python2-funcsigs-bootstrap)
880 ("python-importlib-metadata" ,python2-importlib-metadata-bootstrap)
881 ("python-more-itertools" ,python2-more-itertools)
882 ("python-packaging" ,python2-packaging-bootstrap)
883 ("python-pathlib2" ,python2-pathlib2-bootstrap)
884 ("python-pluggy" ,python2-pluggy-bootstrap)
885 ("python-py" ,python2-py)
886 ("python-wcwidth" ,python2-wcwidth))))))
888 (define-public python-pytest-cov
890 (name "python-pytest-cov")
895 (uri (pypi-uri "pytest-cov" version))
897 (base32 "0avzlk9p4nc44k7lpx9109dybq71xqnggxb9f4hp0l64pbc44ryc"))))
898 (build-system python-build-system)
901 (modify-phases %standard-phases
904 ;; Options taken from tox.ini.
905 ;; TODO: make "--restructuredtext" tests pass. They currently fail
906 ;; with "Duplicate implicit target name".
907 (invoke "python" "./setup.py" "check"
908 "--strict" "--metadata"))))))
910 `(("python-coverage" ,python-coverage)
911 ("python-pytest" ,python-pytest)))
912 (home-page "https://github.com/pytest-dev/pytest-cov")
913 (synopsis "Pytest plugin for measuring coverage")
915 "Pytest-cov produces coverage reports. It supports centralised testing and
916 distributed testing in both @code{load} and @code{each} modes. It also
917 supports coverage of subprocesses.")
918 (license license:expat)))
920 (define-public python2-pytest-cov
921 (package-with-python2 python-pytest-cov))
923 (define-public python-pytest-runner
925 (name "python-pytest-runner")
930 (uri (pypi-uri "pytest-runner" version))
933 "0awll1bva5zy8cspsxcpv7pjcrdf5c6pf56nqn4f74vvmlzfgiwn"))))
934 (build-system python-build-system)
936 '(;; FIXME: The test suite requires 'python-flake8' and 'python-black',
937 ;; but that introduces a circular dependency.
939 #:phases (modify-phases %standard-phases
941 (lambda* (#:key tests? #:allow-other-keys)
943 (invoke "pytest" "-vv")
944 (format #t "test suite not run~%"))
947 `(("python-setuptools-scm" ,python-setuptools-scm)))
948 (home-page "https://github.com/pytest-dev/pytest-runner")
949 (synopsis "Invoke py.test as a distutils command")
951 "This package provides a @command{pytest-runner} command that
952 @file{setup.py} files can use to run tests.")
953 (license license:expat)))
955 (define-public python2-pytest-runner
956 (package-with-python2 python-pytest-runner))
958 ;; python-bleach 3.1.0 requires this ancient version of pytest-runner.
959 ;; Remove once no longer needed.
960 (define-public python-pytest-runner-2
966 (uri (pypi-uri "pytest-runner" version))
969 "11ivjj9hfphkv4yfb2g74av4yy86y8gcbf7gbif0p1hcdfnxg3w6"))))))
971 (define-public python2-pytest-runner-2
972 (package-with-python2 python-pytest-runner-2))
974 (define-public python-pytest-lazy-fixture
976 (name "python-pytest-lazy-fixture")
981 (uri (pypi-uri "pytest-lazy-fixture" version))
983 (base32 "1b0hmnsxw4s2wf9pks8dg6dfy5cx3zcbzs8517lfccxsfizhqz8f"))))
984 (build-system python-build-system)
987 (modify-phases %standard-phases
989 (lambda* (#:key inputs outputs #:allow-other-keys)
990 ;; Make the installed plugin discoverable by Pytest.
991 (add-installed-pythonpath inputs outputs)
992 (invoke "pytest" "-vv"))))))
994 `(("python-pytest" ,python-pytest)))
995 (home-page "https://github.com/tvorog/pytest-lazy-fixture")
996 (synopsis "Use fixtures in @code{pytest.mark.parametrize}")
997 (description "This plugin helps to use fixtures in
998 @code{pytest.mark.parametrize}.")
999 (license license:expat)))
1001 (define-public python-pytest-mock
1003 (name "python-pytest-mock")
1008 (uri (pypi-uri "pytest-mock" version))
1011 "1i5mg3ff1qk0wqfcxfz60hwy3q5dskdp36i10ckigkzffg8hc3ad"))))
1012 (build-system python-build-system)
1014 `(("python-setuptools-scm" ,python-setuptools-scm)))
1016 `(("python-pytest" ,python-pytest)))
1017 (home-page "https://github.com/pytest-dev/pytest-mock/")
1018 (synopsis "Thin-wrapper around the mock package for easier use with py.test")
1020 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
1021 around the patching API provided by the @code{mock} package, but with the
1022 benefit of not having to worry about undoing patches at the end of a test.
1023 The mocker fixture has the same API as @code{mock.patch}, supporting the
1025 (properties `((python2-variant . ,(delay python2-pytest-mock))))
1026 (license license:expat)))
1028 (define-public python2-pytest-mock
1029 (let ((base (package-with-python2
1030 (strip-python2-variant python-pytest-mock))))
1031 (package (inherit base)
1033 `(("python2-mock" ,python2-mock)
1034 ,@(package-propagated-inputs base))))))
1036 (define-public python-pytest-xdist
1038 (name "python-pytest-xdist")
1043 (uri (pypi-uri "pytest-xdist" version))
1046 "1d812apvcmshh2l8f38spqwb3bpp0x43yy7lyfpxxzc99h4r7y4n"))
1047 (modules '((guix build utils)))
1050 ;; Remove pre-compiled .pyc files from source.
1051 (for-each delete-file-recursively
1052 (find-files "." "__pycache__" #:directories? #t))
1053 (for-each delete-file (find-files "." "\\.pyc$"))
1055 (build-system python-build-system)
1057 '(#:tests? #f)) ;FIXME: Some tests are failing.
1059 ;; (modify-phases %standard-phases
1061 ;; (add-after 'install 'check
1062 ;; (lambda* (#:key inputs outputs #:allow-other-keys)
1063 ;; (add-installed-pythonpath inputs outputs)
1064 ;; (zero? (system* "py.test" "-v")))))
1066 `(("python-setuptools-scm" ,python-setuptools-scm)))
1068 `(("python-execnet" ,python-execnet)
1069 ("python-pytest" ,python-pytest)
1070 ("python-py" ,python-py)))
1072 "https://github.com/pytest-dev/pytest-xdist")
1074 "Plugin for py.test with distributed testing and loop-on-failing modes")
1076 "The pytest-xdist plugin extends py.test with some unique test execution
1077 modes: parallelization, running tests in boxed subprocesses, the ability
1078 to run tests repeatedly when failed, and the ability to run tests on multiple
1079 Python interpreters or platforms. It uses rsync to copy the existing
1080 program code to a remote location, executes there, and then syncs the
1082 (license license:expat)))
1084 (define-public python2-pytest-xdist
1085 (package-with-python2 python-pytest-xdist))
1087 (define-public python-pytest-timeout
1089 (name "python-pytest-timeout")
1094 (uri (pypi-uri "pytest-timeout" version))
1097 "13n42azbvs5slvy2n1a9nw17r4qdq10dd68nln3jp925safa3yl0"))))
1098 (build-system python-build-system)
1100 '(#:phases (modify-phases %standard-phases
1102 (lambda* (#:key inputs outputs #:allow-other-keys)
1103 ;; Make the installed plugin discoverable by Pytest.
1104 (add-installed-pythonpath inputs outputs)
1105 (invoke "pytest" "-vv"))))))
1107 `(("python-pytest" ,python-pytest)))
1109 `(("python-pexpect" ,python-pexpect)))
1110 (home-page "http://bitbucket.org/pytest-dev/pytest-timeout/")
1111 (synopsis "Plugin for py.test to abort hanging tests")
1113 "This package provides a py.test plugin that aborts hanging tests after a
1114 timeout has been exceeded.")
1115 (license license:expat)))
1117 (define-public python-pytest-forked
1119 (name "python-pytest-forked")
1124 (uri (pypi-uri "pytest-forked" version))
1127 "000i4q7my2fq4l49n8idx2c812dql97qv6qpm2vhrrn9v6g6j18q"))))
1128 (build-system python-build-system)
1130 `(("python-pytest" ,python-pytest)))
1132 `(("python-setuptools-scm" ,python-setuptools-scm)))
1134 "https://github.com/pytest-dev/pytest-forked")
1136 "Run tests in isolated forked subprocesses")
1138 "Pytest plugin which will run each test in a subprocess and will report if
1139 a test crashed the process.")
1140 (license license:expat)))
1142 (define-public python-scripttest
1144 (name "python-scripttest")
1149 (uri (pypi-uri "scripttest" version))
1152 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
1153 (build-system python-build-system)
1155 `(("python-pytest" ,python-pytest)))
1156 (home-page (string-append "https://web.archive.org/web/20161029233413/"
1157 "http://pythonpaste.org/scripttest/"))
1158 (synopsis "Python library to test command-line scripts")
1159 (description "Scripttest is a Python helper library for testing
1160 interactive command-line applications. With it you can run a script in a
1161 subprocess and see the output as well as any file modifications.")
1162 (license license:expat)))
1164 (define-public python2-scripttest
1165 (package-with-python2 python-scripttest))
1167 (define-public python-testtools-bootstrap
1169 (name "python-testtools-bootstrap")
1174 (uri (pypi-uri "testtools" version))
1177 "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
1178 (patches (search-patches "python-testtools.patch"))))
1179 (build-system python-build-system)
1180 (arguments '(#:tests? #f))
1182 `(("python-extras" ,python-extras)
1183 ("python-fixtures" ,python-fixtures-bootstrap)
1184 ("python-mimeparse" ,python-mimeparse)
1185 ("python-pbr" ,python-pbr-minimal)
1186 ("python-six" ,python-six)
1187 ("python-traceback2" ,python-traceback2)
1188 ("python-unittest2" ,python-unittest2)))
1189 (home-page "https://github.com/testing-cabal/testtools")
1191 "Extensions to the Python standard library unit testing framework")
1193 "This package is only for bootstrapping. Do not use this.")
1194 (license license:psfl)))
1196 (define-public python2-testtools-bootstrap
1197 (package-with-python2 python-testtools-bootstrap))
1199 (define-public python-testtools
1201 (inherit python-testtools-bootstrap)
1202 (name "python-testtools")
1204 `(#:phases (modify-phases %standard-phases
1207 (invoke "python" "-m" "testtools.run"
1208 "testtools.tests.test_suite"))))))
1210 `(("python-extras" ,python-extras)
1211 ("python-fixtures" ,python-fixtures)
1212 ("python-mimeparse" ,python-mimeparse)
1213 ("python-pbr" ,python-pbr)
1214 ("python-six" ,python-six)
1215 ("python-traceback2" ,python-traceback2)
1216 ("python-unittest2" ,python-unittest2)))
1218 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
1220 "Testtools extends the Python standard library unit testing framework to
1221 provide matchers, more debugging information, and cross-Python
1224 (define-public python2-testtools
1225 (package-with-python2 python-testtools))
1227 (define-public python-testscenarios-bootstrap
1229 (name "python-testscenarios-bootstrap")
1234 (uri (pypi-uri "testscenarios" version))
1237 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
1238 (build-system python-build-system)
1240 `(#:phases (modify-phases %standard-phases
1243 (invoke "python" "-m" "testtools.run"
1244 "testscenarios.test_suite"))))))
1246 `(("python-pbr" ,python-pbr-minimal)
1247 ("python-testtools" ,python-testtools-bootstrap)))
1248 (home-page "https://launchpad.net/testscenarios")
1249 (synopsis "Pyunit extension for dependency injection")
1251 "This package is only for bootstrapping. Don't use this.")
1252 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1254 (define-public python2-testscenarios-bootstrap
1255 (package-with-python2 python-testscenarios-bootstrap))
1257 (define-public python-testscenarios
1259 (inherit python-testscenarios-bootstrap)
1260 (name "python-testscenarios")
1262 `(("python-pbr" ,python-pbr)
1263 ("python-testtools" ,python-testtools)))
1265 "Testscenarios provides clean dependency injection for Python unittest
1268 (define-public python2-testscenarios
1269 (package-with-python2 python-testscenarios))
1271 ;; Testresources requires python-pbr at runtime, but pbr needs it for its
1272 ;; own tests. Hence this bootstrap variant.
1273 (define-public python-testresources-bootstrap
1275 (name "python-testresources-bootstrap")
1279 (uri (pypi-uri "testresources" version))
1282 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
1283 (build-system python-build-system)
1284 (arguments '(#:tests? #f))
1286 `(("python-pbr" ,python-pbr-minimal)))
1287 (home-page "https://launchpad.net/testresources")
1289 "Pyunit extension for managing test resources")
1291 "This package is only here for bootstrapping purposes. Use the regular
1292 testresources package instead.")
1293 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1295 (define-public python2-testresources-bootstrap
1296 (package-with-python2 python-testresources-bootstrap))
1298 (define-public python-testresources
1300 (inherit python-testresources-bootstrap)
1301 (name "python-testresources")
1303 `(("python-pbr" ,python-pbr)))
1306 `(("python-fixtures" ,python-fixtures)
1307 ("python-testtols" ,python-testtools)))
1309 "Testresources is an extension to Python's unittest to allow declarative
1310 use of resources by test cases.")))
1312 (define-public python2-testresources
1313 (package-with-python2 python-testresources))
1315 (define-public python-subunit-bootstrap
1317 (name "python-subunit-bootstrap")
1322 (uri (pypi-uri "python-subunit" version))
1325 "1fsw8rsn1s3nklx06mayrg5rn2zbky6wwjc5z07s7rf1wjzfs1wn"))))
1326 (build-system python-build-system)
1328 `(("python-extras" ,python-extras)
1329 ("python-testtools" ,python-testtools-bootstrap)))
1331 `(("python-fixtures" ,python-fixtures-bootstrap)
1332 ("python-hypothesis" ,python-hypothesis)
1333 ("python-testscenarios" ,python-testscenarios-bootstrap)))
1334 (home-page "https://launchpad.net/subunit")
1335 (synopsis "Python implementation of the subunit protocol")
1337 "This package is here for bootstrapping purposes only. Use the regular
1338 python-subunit package instead.")
1339 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1341 (define-public python2-subunit-bootstrap
1342 (package-with-python2 python-subunit-bootstrap))
1344 (define-public python-subunit
1346 (inherit python-subunit-bootstrap)
1347 (name "python-subunit")
1349 `(("python-extras" ,python-extras)
1350 ("python-testtools" ,python-testtools)))
1352 `(("python-fixtures" ,python-fixtures)
1353 ("python-hypothesis" ,python-hypothesis)
1354 ("python-testscenarios" ,python-testscenarios)))
1356 "Python-subunit is a Python implementation of the subunit test streaming
1359 (define-public python2-subunit
1360 (package-with-python2 python-subunit))
1362 ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
1363 ;; own tests. Hence this bootstrap variant.
1364 (define-public python-fixtures-bootstrap
1366 (name "python-fixtures-bootstrap")
1370 (uri (pypi-uri "fixtures" version))
1373 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
1374 (build-system python-build-system)
1375 (arguments `(#:tests? #f))
1377 `(("python-pbr-minimal" ,python-pbr-minimal)
1378 ("python-six" ,python-six)))
1379 (home-page "https://launchpad.net/python-fixtures")
1380 (synopsis "Python test fixture library")
1382 "This package is only used for bootstrapping. Use the regular
1383 python-fixtures package instead.")
1384 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1386 (define-public python2-fixtures-bootstrap
1387 (package-with-python2 python-fixtures-bootstrap))
1389 (define-public python-fixtures
1391 (inherit python-fixtures-bootstrap)
1392 (name "python-fixtures")
1395 (modify-phases %standard-phases
1398 (invoke "python" "-m" "testtools.run"
1399 "fixtures.test_suite"))))))
1401 ;; Fixtures uses pbr at runtime to check versions, etc.
1402 `(("python-pbr" ,python-pbr)
1403 ("python-six" ,python-six)))
1405 `(("python-mock" ,python-mock)
1406 ("python-testtools" ,python-testtools-bootstrap)))
1408 "Fixtures provides a way to create reusable state, useful when writing
1411 (define-public python2-fixtures
1412 (package-with-python2 python-fixtures))
1414 (define-public python-testrepository-bootstrap
1416 (name "python-testrepository-bootstrap")
1421 (uri (pypi-uri "testrepository" version))
1424 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1425 (build-system python-build-system)
1426 (arguments '(#:tests? #f))
1428 `(("python-fixtures" ,python-fixtures-bootstrap)
1429 ("python-subunit" ,python-subunit-bootstrap)
1430 ("python-testtools" ,python-testtools-bootstrap)))
1432 `(("python-mimeparse" ,python-mimeparse)))
1433 (home-page "https://launchpad.net/testrepository")
1434 (synopsis "Database for Python test results")
1436 "Bootstrap package for python-testrepository. Don't use this.")
1437 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1439 (define-public python2-testrepository-bootstrap
1440 (package-with-python2 python-testrepository-bootstrap))
1442 (define-public python-testrepository
1444 (inherit python-testrepository-bootstrap)
1445 (name "python-testrepository")
1447 ;; FIXME: Many tests are failing.
1450 `(("python-fixtures" ,python-fixtures)
1451 ("python-subunit" ,python-subunit)
1452 ("python-testtools" ,python-testtools)))
1454 `(("python-mimeparse" ,python-mimeparse)))
1455 (description "Testrepository provides a database of test results which can
1456 be used as part of a developer's workflow to check things such as what tests
1457 have failed since the last commit or what tests are currently failing.")))
1459 (define-public python2-testrepository
1460 (package-with-python2 python-testrepository))
1462 (define-public python-coverage
1464 (name "python-coverage")
1469 (uri (pypi-uri "coverage" version))
1472 "1vrg8panqw79pswg52ygbrff3wdnxarrd9qz6c64ah0c4h2cmbvp"))))
1473 (build-system python-build-system)
1475 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1477 (home-page "http://nedbatchelder.com/code/coverage")
1478 (synopsis "Code coverage measurement for Python")
1480 "Coverage measures code coverage, typically during test execution. It
1481 uses the code analysis tools and tracing hooks provided in the Python standard
1482 library to determine which lines are executable, and which have been
1484 (license license:bsd-3)))
1486 (define-public python2-coverage
1487 (package-with-python2 python-coverage))
1489 (define-public python-pytest-asyncio
1491 (name "python-pytest-asyncio")
1496 (uri (pypi-uri "pytest-asyncio" version))
1498 (base32 "1bysy4nii13bm7h345wxf8fxcjhab7l374pqdv7vwv3izl053b4z"))))
1499 (build-system python-build-system)
1501 `(("python-coverage" ,python-coverage)
1502 ("python-async-generator" ,python-async-generator)
1503 ("python-hypothesis" ,python-hypothesis)
1504 ("python-pytest" ,python-pytest)))
1505 (home-page "https://github.com/pytest-dev/pytest-asyncio")
1506 (synopsis "Pytest support for asyncio")
1507 (description "Python asyncio code is usually written in the form of
1508 coroutines, which makes it slightly more difficult to test using normal
1509 testing tools. @code{pytest-asyncio} provides useful fixtures and markers
1510 to make testing async code easier.")
1511 (license license:asl2.0)))
1513 (define-public python-cov-core
1515 (name "python-cov-core")
1520 (uri (pypi-uri "cov-core" version))
1523 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1524 (build-system python-build-system)
1526 `(("python-coverage" ,python-coverage)))
1527 (home-page "https://github.com/schlamar/cov-core")
1528 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
1530 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1531 and @code{nose2-cov}. It is useful for developing coverage plugins for these
1532 testing frameworks.")
1533 (license license:expat)))
1535 (define-public python2-cov-core
1536 (package-with-python2 python-cov-core))
1538 (define-public python-codecov
1540 (name "python-codecov")
1545 (uri (pypi-uri "codecov" version))
1548 "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1549 (build-system python-build-system)
1551 `(("python-unittest2" ,python-unittest2)))
1553 `(("python-coverage" ,python-coverage)
1554 ("python-requests" ,python-requests)))
1555 (home-page "http://github.com/codecov/codecov-python")
1556 (synopsis "Upload code coverage reports to @code{codecov.io}")
1558 "Codecov collects code coverage reports from code written in Python, Java,
1559 C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
1560 (license license:asl2.0)))
1562 (define-public python-testpath
1564 (name "python-testpath")
1570 (url "https://github.com/jupyter/testpath")
1572 (file-name (git-file-name name version))
1575 "0r4iiizjql6ny1ln7ciw7rrbjadz1s9zrf2hl0xkgnh3ypd8936f"))))
1576 (build-system python-build-system)
1578 `(#:tests? #f ; this package does not even have a setup.py
1579 #:modules ((guix build python-build-system)
1583 (modify-phases %standard-phases
1586 (lambda* (#:key inputs outputs #:allow-other-keys)
1587 (let* ((version (last
1588 (string-split (assoc-ref inputs "python") #\-)))
1589 (x.y (string-join (take (string-split version #\.) 2)
1592 (assoc-ref outputs "out")
1593 "/lib/python" x.y "/site-packages/testpath")))
1595 (copy-recursively "testpath" dir))
1597 (home-page "https://github.com/takluyver/testpath")
1598 (synopsis "Test utilities for code working with files and commands")
1600 "Testpath is a collection of utilities for Python code working with files
1601 and commands. It contains functions to check things on the file system, and
1602 tools for mocking system commands and recording calls to those.")
1603 (license license:expat)))
1605 (define-public python2-testpath
1606 (package-with-python2 python-testpath))
1608 (define-public python-testlib
1610 (name "python-testlib")
1615 (uri (pypi-uri "testlib" version ".zip"))
1617 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1618 (build-system python-build-system)
1620 `(("unzip" ,unzip))) ; for unpacking the source
1621 (synopsis "Python micro test suite harness")
1622 (description "A micro unittest suite harness for Python.")
1623 (home-page "https://github.com/trentm/testlib")
1624 (license license:expat)))
1626 (define-public python2-testlib
1627 (package-with-python2 python-testlib))
1629 ;;; The software provided by this package was integrated into pytest 2.8.
1630 (define-public python-pytest-cache
1632 (name "python-pytest-cache")
1636 (uri (pypi-uri "pytest-cache" version))
1639 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1640 (build-system python-build-system)
1642 `(("python-apipkg" ,python-apipkg)
1643 ("python-execnet" ,python-execnet)
1644 ("python-py" ,python-py)
1645 ("python-pytest" ,python-pytest)))
1646 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1647 (description "The pytest-cache plugin provides tools to rerun failures from
1648 the last py.test invocation.")
1649 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1650 (license license:expat)))
1652 (define-public python2-pytest-cache
1653 (package-with-python2 python-pytest-cache))
1655 (define-public python-pytest-localserver
1657 (name "python-pytest-localserver")
1661 (uri (pypi-uri "pytest-localserver" version))
1664 "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
1665 (build-system python-build-system)
1668 (modify-phases %standard-phases
1671 (invoke "py.test" "-v"))))))
1673 `(("python-pytest" ,python-pytest)
1674 ("python-requests" ,python-requests)
1675 ("python-six" ,python-six)))
1677 `(("python-werkzeug" ,python-werkzeug)))
1678 (synopsis "Py.test plugin to test server connections locally")
1679 (description "Pytest-localserver is a plugin for the pytest testing
1680 framework which enables you to test server connections locally.")
1681 (home-page "https://pypi.org/project/pytest-localserver/")
1682 (license license:expat)))
1684 (define-public python-pytest-xprocess
1686 (name "python-pytest-xprocess")
1690 (uri (pypi-uri "pytest-xprocess" version))
1693 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1694 (build-system python-build-system)
1696 `(("python-pytest" ,python-pytest)
1697 ("python-pytest-cache" ,python-pytest-cache)
1698 ("python-psutil" ,python-psutil)))
1699 (synopsis "Pytest plugin to manage external processes across test runs")
1700 (description "Pytest-xprocess is an experimental py.test plugin for managing
1701 processes across test runs.")
1702 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1703 (license license:expat)))
1705 (define-public python-pytest-subtesthack
1707 (name "python-pytest-subtesthack")
1711 (uri (pypi-uri "pytest-subtesthack" version))
1714 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1715 (build-system python-build-system)
1717 `(("python-pytest" ,python-pytest)))
1718 (synopsis "Set-up and tear-down fixtures for unit tests")
1719 (description "This plugin allows you to set up and tear down fixtures within
1720 unit test functions that use @code{py.test}. This is useful for using
1721 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1722 function multiple times, without setting up or tearing down fixture state as is
1723 normally the case.")
1724 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1725 (license license:unlicense)))
1727 (define-public python2-pytest-subtesthack
1728 (package-with-python2 python-pytest-subtesthack))
1730 (define-public python-pytest-sugar
1732 (name "python-pytest-sugar")
1737 (uri (pypi-uri "pytest-sugar" version))
1739 (base32 "1i0hv3h49zvl62jbiyjag84carbrp3zprqzxffdr291nxavvac0n"))))
1740 (build-system python-build-system)
1742 `(("python-packaging" ,python-packaging)
1743 ("python-pytest" ,python-pytest)
1744 ("python-termcolor" ,python-termcolor)))
1745 (home-page "https://pivotfinland.com/pytest-sugar/")
1746 (synopsis "Plugin for pytest that changes the default look and feel")
1748 "@code{pytest-sugar} is a plugin for py.test that changes the default
1749 look and feel of py.test, using a progress bar and showing failures and errors
1751 (license license:bsd-3)))
1753 (define-public python-hypothesis
1755 (name "python-hypothesis")
1759 (uri (pypi-uri "hypothesis" version))
1762 "0zn09bn6hadk4vxl6jy8bkjr5fz8mrhin3z46w7pq5qgbaycr89p"))))
1763 (build-system python-build-system)
1765 ;; XXX: Tests are not distributed with the PyPI archive.
1768 `(("python-attrs" ,python-attrs-bootstrap)
1769 ("python-sortedcontainers" ,python-sortedcontainers)))
1770 (synopsis "Library for property based testing")
1771 (description "Hypothesis is a library for testing your Python code against a
1772 much larger range of examples than you would ever want to write by hand. It’s
1773 based on the Haskell library, Quickcheck, and is designed to integrate
1774 seamlessly into your existing Python unit testing work flow.")
1775 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
1776 (license license:mpl2.0)
1777 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1779 ;; This is the last version of Hypothesis that supports Python 2.
1780 (define-public python2-hypothesis
1781 (let ((hypothesis (package-with-python2
1782 (strip-python2-variant python-hypothesis))))
1783 (package (inherit hypothesis)
1787 (uri (pypi-uri "hypothesis" version))
1790 "183gpxbfcdhdqzlahkji5a71n6lmvgqsbkcb0ihqad51n2j6jhrw"))))
1792 `(("python2-enum34" ,python2-enum34)
1793 ,@(package-propagated-inputs hypothesis))))))
1795 (define-public python-lit
1802 (uri (pypi-uri "lit" version))
1805 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
1806 (build-system python-build-system)
1809 (modify-phases %standard-phases
1812 (invoke "python" "lit.py" "tests"))))))
1815 (home-page "https://llvm.org/")
1816 (synopsis "LLVM Software Testing Tool")
1817 (description "@code{lit} is a portable tool for executing LLVM and Clang
1818 style test suites, summarizing their results, and providing indication of
1820 (license license:ncsa)))
1822 (define-public python2-lit
1823 (package-with-python2 python-lit))
1825 (define-public python-pytest-pep8
1827 (name "python-pytest-pep8")
1831 (uri (pypi-uri "pytest-pep8" version))
1834 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
1835 (build-system python-build-system)
1837 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
1839 `(("python-pytest" ,python-pytest)))
1841 `(("python-pep8" ,python-pep8)))
1842 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
1843 (synopsis "Py.test plugin to check PEP8 requirements")
1844 (description "Pytest plugin for checking PEP8 compliance.")
1845 (license license:expat)))
1847 (define-public python2-pytest-pep8
1848 (package-with-python2 python-pytest-pep8))
1850 (define-public python-pytest-flakes
1852 (name "python-pytest-flakes")
1856 (uri (pypi-uri "pytest-flakes" version))
1859 "0hyind0gb950v9kfy0v97x66fb33slbqmxhrjvgbvsv0ayzn869l"))))
1860 (build-system python-build-system)
1863 (modify-phases %standard-phases
1865 (add-after 'install 'check
1866 (lambda* (#:key outputs inputs #:allow-other-keys)
1867 ;; It's easier to run tests after install.
1868 ;; Make installed package available for running the tests
1869 (add-installed-pythonpath inputs outputs)
1870 (invoke "py.test" "-vv" "-k" "not test_syntax_error"))))))
1872 `(("python-coverage" ,python-coverage)
1873 ("python-pytest" ,python-pytest)
1874 ("python-pytest-cache" ,python-pytest-cache)
1875 ("python-pytest-pep8" ,python-pytest-pep8)))
1877 `(("python-pyflakes" ,python-pyflakes)))
1878 (home-page "https://github.com/fschulze/pytest-flakes")
1879 (synopsis "Py.test plugin to check source code with pyflakes")
1880 (description "Pytest plugin for checking Python source code with pyflakes.")
1881 (license license:expat)))
1883 (define-public python2-pytest-flakes
1884 (package-with-python2 python-pytest-flakes))
1886 (define-public python2-coverage-test-runner
1888 (name "python2-coverage-test-runner")
1894 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
1895 "coverage-test-runner/snapshot/coverage-test-runner-"
1899 "1kjjb9llckycnfxag8zcvqsn4z1s3dwyw6b1n0avxydihgf30rny"))))
1900 (build-system python-build-system)
1902 `(#:python ,python-2
1904 (modify-phases %standard-phases
1907 (invoke "./testrun"))))))
1909 `(("python2-coverage" ,python2-coverage)))
1910 (home-page "https://liw.fi/coverage-test-runner/")
1911 (synopsis "Python module for running unit tests")
1912 (description "@code{CoverageTestRunner} is a python module for running
1913 unit tests and failing them if the unit test module does not exercise all
1914 statements in the module it tests.")
1915 (license license:gpl3+)))
1917 (define-public python-pylint
1919 (name "python-pylint")
1925 (url "https://github.com/PyCQA/pylint")
1926 (commit (string-append "pylint-" version))))
1927 (file-name (git-file-name name version))
1929 (base32 "04cgbh2z1mygar63plzziyz34yg6bdr4i0g63jp256fgnqwb1bi3"))))
1930 (build-system python-build-system)
1931 ;; FIXME: Tests are failing since version 2.4.3, see:
1932 ;; https://github.com/PyCQA/pylint/issues/3198.
1933 (arguments '(#:tests? #f))
1935 `(("python-pytest" ,python-pytest)
1936 ("python-pytest-runner" ,python-pytest-runner)
1937 ("python-tox" ,python-tox)))
1939 `(("python-astroid" ,python-astroid)
1940 ("python-isort" ,python-isort)
1941 ("python-mccabe" ,python-mccabe)
1942 ("python-six" ,python-six)
1943 ("python-toml" ,python-toml)))
1944 (home-page "https://github.com/PyCQA/pylint")
1945 (synopsis "Python source code analyzer which looks for coding standard
1947 (description "Pylint is a Python source code analyzer which looks
1948 for programming errors, helps enforcing a coding standard and sniffs
1949 for some code smells (as defined in Martin Fowler's Refactoring book).
1951 Pylint has many rules enabled by default, way too much to silence them
1952 all on a minimally sized program. It's highly configurable and handle
1953 pragmas to control it from within your code. Additionally, it is
1954 possible to write plugins to add your own checks.")
1955 (properties `((python2-variant . ,(delay python2-pylint))))
1956 (license license:gpl2+)))
1958 ;; Python2 is not supported anymore by Pylint. See:
1959 ;; https://github.com/PyCQA/pylint/issues/1763.
1960 (define-public python2-pylint
1961 (let ((pylint (package-with-python2
1962 (strip-python2-variant python-pylint))))
1963 (package (inherit pylint)
1969 (url "https://github.com/PyCQA/pylint")
1970 (commit (string-append "pylint-" version))))
1971 (file-name (git-file-name (package-name pylint) version))
1974 "02a89d8a47s7nfiv1ady3j0sg2sbyja3np145brarfp5x9qxz9x2"))))
1976 `(,@(strip-keyword-arguments '(#:tests?) (package-arguments pylint))
1978 (modify-phases %standard-phases
1981 ;; Somehow, tests fail if run from the build directory.
1982 (let ((work "/tmp/work"))
1984 (setenv "PYTHONPATH"
1985 (string-append (getenv "PYTHONPATH") ":" work))
1986 (copy-recursively "." work)
1987 (with-directory-excursion "/tmp"
1988 (invoke "python" "-m" "unittest" "discover"
1989 "-s" (string-append work "/pylint/test")
1990 "-p" "*test_*.py"))))))))
1992 `(("python2-futures" ,python2-futures)
1993 ,@(package-native-inputs pylint)))
1995 `(("python2-backports-functools-lru-cache"
1996 ,python2-backports-functools-lru-cache)
1997 ("python2-configparser" ,python2-configparser)
1998 ,@(package-propagated-inputs pylint))))))
2000 (define-public python-paramunittest
2002 (name "python-paramunittest")
2007 (uri (pypi-uri "ParamUnittest" version))
2010 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
2011 (build-system python-build-system)
2013 "https://github.com/rik0/ParamUnittest")
2015 "Simple extension to have parametrized unit tests")
2017 "This package creates parameterized unit-tests that work with the standard
2018 unittest package. A parameterized test case is automatically converted to multiple test
2019 cases. Since they are TestCase subclasses, they work with other test suites that
2020 recognize TestCases.")
2021 (license license:bsd-2)))
2023 (define-public python2-python-paramunittest
2024 (package-with-python2 python-paramunittest))
2026 (define-public python-pytest-warnings
2028 (name "python-pytest-warnings")
2033 (uri (pypi-uri "pytest-warnings" version))
2036 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
2037 (build-system python-build-system)
2039 `(("pytest" ,python-pytest)))
2040 (home-page "https://github.com/fschulze/pytest-warnings")
2041 (synopsis "Pytest plugin to list Python warnings in pytest report")
2043 "Python-pytest-warnings is a pytest plugin to list Python warnings in
2045 (license license:expat)
2046 (properties `((python2-variant . ,(delay python2-pytest-warnings))
2047 ;; This package is part of pytest as of version 3.1.0.
2048 (superseded . ,python-pytest)))))
2050 (define-public python2-pytest-warnings
2051 (package (inherit (package-with-python2
2052 (strip-python2-variant python-pytest-warnings)))
2053 (properties `((superseded . ,python2-pytest)))))
2055 (define-public python-pytest-capturelog
2057 (name "python-pytest-capturelog")
2062 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
2065 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
2066 (build-system python-build-system)
2068 `(("pytest" ,python-pytest)))
2069 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
2070 (synopsis "Pytest plugin to catch log messages")
2072 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
2073 (license license:expat)))
2075 (define-public python2-pytest-capturelog
2076 (package-with-python2 python-pytest-capturelog))
2078 (define-public python-pytest-catchlog
2080 (name "python-pytest-catchlog")
2085 (uri (pypi-uri "pytest-catchlog" version ".zip"))
2088 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
2089 (build-system python-build-system)
2091 `(("unzip" ,unzip)))
2093 `(("pytest" ,python-pytest)))
2094 (home-page "https://github.com/eisensheng/pytest-catchlog")
2095 (synopsis "Pytest plugin to catch log messages")
2097 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
2098 a fork of pytest-capturelog.")
2099 (license license:expat)))
2101 (define-public python2-pytest-catchlog
2102 (package-with-python2 python-pytest-catchlog))
2104 (define-public python-nosexcover
2106 (name "python-nosexcover")
2110 (uri (pypi-uri "nosexcover" version))
2113 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
2114 (build-system python-build-system)
2116 `(("python-coverage" ,python-coverage)
2117 ("python-nose" ,python-nose)))
2118 (home-page "http://github.com/cmheisel/nose-xcover")
2119 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
2120 (description "Nose-xcover is a companion to the built-in
2121 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
2122 to a file named coverage.xml.
2124 It will honor all the options you pass to the Nose coverage plugin,
2125 especially -cover-package.")
2126 (license license:expat)))
2128 (define-public python2-nosexcover
2129 (package-with-python2 python-nosexcover))
2131 (define-public python-discover
2133 (name "python-discover")
2138 (uri (pypi-uri "discover" version))
2141 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
2142 (build-system python-build-system)
2143 (home-page "https://pypi.org/project/discover/")
2145 "Python test discovery for unittest")
2147 "Discover provides test discovery for unittest, a feature that has been
2148 backported from Python 2.7 for Python 2.4+.")
2149 (license license:bsd-3)))
2151 (define-public python2-discover
2152 (package-with-python2 python-discover))
2154 (define-public behave
2160 (uri (pypi-uri "behave" version))
2163 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))
2164 (patches (search-patches
2165 "behave-skip-a-couple-of-tests.patch"))))
2166 (build-system python-build-system)
2168 `(("python-mock" ,python-mock)
2169 ("python-nose" ,python-nose)
2170 ("python-pathpy" ,python-pathpy)
2171 ("python-pyhamcrest" ,python-pyhamcrest)
2172 ("python-pytest" ,python-pytest)))
2174 `(("python-importlib-metadata" ,python-importlib-metadata)
2175 ("python-six" ,python-six)
2176 ("python-parse" ,python-parse)
2177 ("python-parse-type" ,python-parse-type)))
2179 '(#:test-target "behave_test"
2181 (modify-phases %standard-phases
2182 (add-before 'check 'fix-library-loading
2184 ;; Otherwise, tests fail with no module named 'path'
2185 (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH") ":"
2186 (getcwd) "/tasks/_vendor"))
2188 (home-page "https://github.com/behave/behave")
2189 (synopsis "Python behavior-driven development")
2191 "Behave is a tool for behavior-driven development in python.
2192 Behavior-driven development (or BDD) is an agile software development
2193 technique that encourages collaboration between developers, QA and
2194 non-technical or business participants in a software project. Behave uses
2195 tests written in a natural language style, backed up by Python code.")
2196 (license license:x11)))
2198 (define-public python-behave-web-api
2200 (name "python-behave-web-api")
2205 (uri (pypi-uri "behave-web-api" version))
2208 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
2209 (build-system python-build-system)
2212 (modify-phases %standard-phases
2213 (add-after 'unpack 'fix-dependencies
2215 (substitute* "setup.py"
2216 (("'wheel'") "") ; We don't use it.
2217 (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
2220 `(("behave" ,behave)
2221 ("python-requests" ,python-requests)))
2222 (home-page "https://github.com/jefersondaniel/behave-web-api")
2223 (synopsis "Provides testing for JSON APIs with Behave for Python")
2224 (description "This package provides testing utility modules for testing
2225 JSON APIs with Behave.")
2226 (license license:expat)))
2228 (define-public python2-behave-web-api
2229 (package-with-python2 python-behave-web-api))
2231 (define-public python-rednose
2233 (name "python-rednose")
2238 (uri (pypi-uri "rednose" version))
2241 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
2242 (build-system python-build-system)
2244 `(#:phases (modify-phases %standard-phases
2245 (add-after 'unpack 'patch-setup.py
2247 ;; Six is only required for tests and later versions
2249 (substitute* "setup.py"
2250 (("six==1.10.0") "six"))
2253 `(("python-colorama" ,python-colorama)
2254 ("python-termstyle" ,python-termstyle)))
2256 `(("python-six" ,python-six)
2257 ("python-nose" ,python-nose)))
2258 (home-page "https://github.com/JBKahn/rednose")
2259 (synopsis "Colored output for Python nosetests")
2260 (description "This package provides colored output for the
2261 @command{nosetests} command of the Python Nose unit test framework.")
2262 (license license:bsd-3)))
2264 (define-public python2-rednose
2265 (package-with-python2 python-rednose))
2267 (define-public python-nose-random
2269 (name "python-nose-random")
2275 (url "https://github.com/fzumstein/nose-random")
2277 (file-name (git-file-name name version))
2280 "1dvip61r2frjv35mv6mmfjc07402z73pjbndfp3mhxyjn2zhksw2"))))
2281 (build-system python-build-system)
2283 `(("python-nose" ,python-nose)))
2284 (home-page "https://github.com/fzumstein/nose-random")
2285 (synopsis "Nose plugin to facilitate randomized unit testing with
2287 (description "Python nose-random is designed to facilitate
2288 Monte-Carlo style unit testing. The idea is to improve testing by
2289 running your code against a large number of randomly generated input
2291 (license license:expat)))
2293 (define-public python-nose-randomly
2295 (name "python-nose-randomly")
2300 (uri (pypi-uri "nose-randomly" version))
2302 (base32 "0z662rqhfk4bjmg806mn4frb8nz4gbh7mrddsrhfffp1g4yklj3y"))))
2303 (build-system python-build-system)
2305 `(("python-nose" ,python-nose)
2306 ("python-numpy" ,python-numpy)))
2307 (home-page "https://github.com/adamchainz/nose-randomly")
2309 "Nose plugin to randomly order tests and control random.seed")
2311 "This is a @code{Nose} plugin to randomly order tests which can be quite
2312 powerful in discovering hidden flaws in the tests themselves, while helping to
2313 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
2314 by resetting it to a repeatable number for each test, enabling the tests to
2315 create data based on random numbers and yet remain repeatable.")
2316 (license license:bsd-3)))
2318 (define-public python2-nose-randomly
2319 (package-with-python2 python-nose-randomly))
2321 (define-public python-nose-timer
2323 (name "python-nose-timer")
2328 (uri (pypi-uri "nose-timer" version))
2330 (base32 "05wzkc88vbzw62pqkvhl33211b90kns0lny70b7qw62rcg4flzk4"))))
2331 (build-system python-build-system)
2333 `(("python-nose" ,python-nose)
2334 ("python-termcolor" ,python-termcolor)))
2335 (home-page "https://github.com/mahmoudimus/nose-timer")
2336 (synopsis "Timer plugin for nosetests")
2337 (description "Shows how much time was needed to run individual tests.")
2338 (license license:expat)))
2340 (define-public python2-nose-timer
2341 (package-with-python2 python-nose-timer))
2343 (define-public python-freezegun
2345 (name "python-freezegun")
2350 (uri (pypi-uri "freezegun" version))
2352 (base32 "0al75mk829j1izxi760b7yjnknjihyfhp2mvi5qiyrxb9cpxwqk2"))))
2353 (build-system python-build-system)
2355 `(("python-mock" ,python-mock)
2356 ("python-pytest" ,python-pytest)))
2358 `(("python-six" ,python-six)
2359 ("python-dateutil" ,python-dateutil)))
2362 (modify-phases %standard-phases
2363 ;; The tests are normally executed via `make test`, but the PyPi
2364 ;; package does not include the Makefile.
2367 (invoke "pytest" "-vv"))))))
2368 (home-page "https://github.com/spulec/freezegun")
2369 (synopsis "Test utility for mocking the datetime module")
2371 "FreezeGun is a library that allows your python tests to travel through
2372 time by mocking the datetime module.")
2373 (license license:asl2.0)))
2375 (define-public python2-freezegun
2376 (package-with-python2 python-freezegun))
2378 (define-public python-flexmock
2380 (name "python-flexmock")
2384 (uri (pypi-uri "flexmock" version))
2387 "0b6qw3grhgx58kxlkj7mdma7xdvlj02zabvcf7w2qifnfjwwwcsh"))))
2388 (build-system python-build-system)
2389 (home-page "https://flexmock.readthedocs.org")
2390 (synopsis "Testing library for Python")
2392 "flexmock is a testing library for Python that makes it easy to create
2393 mocks, stubs and fakes.")
2394 (license license:bsd-3)))
2396 (define-public python2-flexmock
2397 (package-with-python2 python-flexmock))
2399 (define-public python-flaky
2401 (name "python-flaky")
2405 (uri (pypi-uri "flaky" version))
2408 "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j"))))
2409 (build-system python-build-system)
2411 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2413 (home-page "https://github.com/box/flaky")
2414 (synopsis "Automatically rerun flaky tests")
2416 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2419 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2420 on components that aren't 100% reliable. With flaky, instead of removing
2421 those tests or marking them to @code{@@skip}, they can be automatically
2423 (license license:asl2.0)))
2425 (define-public python2-flaky
2426 (package-with-python2 python-flaky))
2428 (define-public python-pyhamcrest
2429 ;; The latest release was in 2016 and its test suite does not work with recent
2430 ;; versions of Pytest. Just take the master branch for now, which seems stable.
2431 (let ((commit "25fdc5f00bdf3084335353bc9247253098ec4cf2")
2434 (name "python-pyhamcrest")
2435 (version (git-version "1.9.0" revision commit))
2437 ;; Tests not distributed from pypi release.
2440 (url "https://github.com/hamcrest/PyHamcrest")
2442 (file-name (git-file-name name version))
2445 "1miqmhhi68vaix8sqc1lvpvbm27bacffxh5anm5cbfsvk7g9n6f3"))))
2446 (native-inputs ;all native inputs are for tests
2447 `(("python-pytest-cov" ,python-pytest-cov)
2448 ("python-mock" ,python-mock)
2449 ("python-pytest" ,python-pytest)
2450 ("python-hypothesis" ,python-hypothesis)))
2452 `(("python-six" ,python-six)))
2453 (build-system python-build-system)
2455 `(#:phases (modify-phases %standard-phases
2458 (setenv "PYTHONPATH"
2459 (string-append "build/lib:"
2460 (getenv "PYTHONPATH")))
2461 (invoke "pytest" "-vv"))))))
2462 (home-page "http://hamcrest.org/")
2463 (synopsis "Hamcrest matchers for Python")
2465 "PyHamcrest is a framework for writing matcher objects,
2466 allowing you to declaratively define \"match\" rules.")
2467 (license license:bsd-3))))
2469 (define-public python2-pyhamcrest
2470 (package-with-python2 python-pyhamcrest))
2472 (define-public unittest-cpp
2474 (name "unittest-cpp")
2479 (url "https://github.com/unittest-cpp/unittest-cpp")
2480 (commit (string-append "v" version))))
2481 (file-name (git-file-name name version))
2483 (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
2485 `(#:tests? #f)) ; It's run after build automatically.
2486 (build-system cmake-build-system)
2487 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2488 (synopsis "Lightweight unit testing framework for C++")
2489 (description "UnitTest++ is a lightweight unit testing framework for C++.
2490 It was designed to do test-driven development on a wide variety of platforms.
2491 Simplicity, portability, speed, and small footprint are all very important
2492 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2493 of advanced library and language features, which means it should be easily
2494 portable to just about any platform.")
2495 (license license:expat)))
2497 (define-public libfaketime
2499 (name "libfaketime")
2501 (home-page "https://github.com/wolfcw/libfaketime")
2506 (commit (string-append "v" version))))
2509 "1mfdl82ppgbdvy1ny8mb7xii7p0g7awvn4bn36jb8v4r545slmjc"))
2510 (file-name (git-file-name name version))))
2511 (build-system gnu-build-system)
2513 '(#:phases (modify-phases %standard-phases
2515 (lambda* (#:key outputs #:allow-other-keys)
2516 (let ((out (assoc-ref outputs "out")))
2518 (setenv "PREFIX" out)
2520 ;; XXX: Without this flag, the CLOCK_REALTIME test hangs
2521 ;; indefinitely. See README.packagers for more information.
2522 ;; Try removing this for future versions of libfaketime.
2523 (setenv "FAKETIME_COMPILE_CFLAGS" "-DFORCE_MONOTONIC_FIX")
2526 (add-before 'check 'pre-check
2528 (substitute* "test/functests/test_exclude_mono.sh"
2529 (("/bin/bash") (which "bash")))
2531 ;; Do not fail due to use of 'ftime', which was deprecated in
2532 ;; glibc 2.31. Remove this for later versions of libfaketime.
2533 (setenv "FAKETIME_COMPILE_CFLAGS" "-Wno-deprecated-declarations")
2535 #:test-target "test"))
2537 `(("perl" ,perl))) ;for tests
2538 (synopsis "Fake the system time for single applications")
2540 "The libfaketime library allows users to modify the system time that an
2541 application \"sees\". It is meant to be loaded using the dynamic linker's
2542 @code{LD_PRELOAD} environment variable. The @command{faketime} command
2543 provides a simple way to achieve this.")
2544 (license license:gpl2)))
2546 (define-public umockdev
2552 (uri (string-append "https://github.com/martinpitt/umockdev/"
2553 "releases/download/" version "/"
2554 "umockdev-" version ".tar.xz"))
2557 "1g78jcrvb7yyh0q5kv5409wjqf8nlfqnw1rknm3a247mcx317dpz"))))
2558 (build-system gnu-build-system)
2561 (modify-phases %standard-phases
2562 (add-after 'unpack 'fix-test
2564 (substitute* "tests/test-umockdev.c"
2569 ("gobject-introspection" ,gobject-introspection)
2570 ("gtk-doc" ,gtk-doc)
2571 ("pkg-config" ,pkg-config)
2579 ("libgudev" ,libgudev)))
2580 (home-page "https://github.com/martinpitt/umockdev/")
2581 (synopsis "Mock hardware devices for creating unit tests")
2582 (description "umockdev mocks hardware devices for creating integration
2583 tests for hardware related libraries and programs. It also provides tools to
2584 record the properties and behaviour of particular devices, and to run a
2585 program or test suite under a test bed with the previously recorded devices
2587 (license license:lgpl2.1+)))
2589 (define-public virtest
2590 ;; No releases yet, so we take the commit that "vc" expects.
2591 (let ((commit "f7d03ef39fceba168745bd29e1b20af6e7971e04")
2595 (version (git-version "0.0" revision commit))
2596 (home-page "https://github.com/mattkretz/virtest")
2599 (uri (git-reference (url home-page) (commit commit)))
2600 (file-name (git-file-name name version))
2603 "07pjyb0mk7y2w1dg1bhl26nb7416xa1mw16ifj6mmps5y6aq054l"))))
2604 (build-system cmake-build-system)
2606 `(#:phases (modify-phases %standard-phases
2607 (add-after 'unpack 'adjust-install-directory
2609 ;; Vc is the only consumer of this library, and expects
2610 ;; to find it in "virtest/vir/" instead of "vir/vir/".
2611 (substitute* "CMakeLists.txt"
2612 (("DESTINATION include/vir")
2613 "DESTINATION include/virtest"))
2615 (synopsis "Header-only test framework")
2617 "@code{virtest} is a small header-only test framework for C++. It
2618 grew out of the @dfn{Vc} project.")
2619 (license license:bsd-3))))
2621 (define-public python-pyfakefs
2623 (name "python-pyfakefs")
2627 ;; We use the PyPI URL because there is no proper release
2628 ;; available from GitHub. The GitHub project only provides
2629 ;; autogenerated tarballs, which are known to change in place.
2630 (uri (pypi-uri "pyfakefs" version))
2633 "1cp2yw96fa2qkgi39xa3nlr3inf8wb5rgh9kdq53256ca2r8pdhy"))
2634 (patches (search-patches
2635 "python-pyfakefs-remove-bad-test.patch"))
2636 (file-name (string-append name "-" version ".tar.gz"))))
2639 (modify-phases %standard-phases
2640 ;; The default test suite does not run these extra tests.
2641 (add-after 'check 'check-pytest-plugin
2644 "python" "-m" "pytest"
2645 "pyfakefs/pytest_tests/pytest_plugin_test.py")
2648 `(("python-pytest" ,python-pytest)))
2649 (build-system python-build-system)
2650 ;; Guix lint doesn't like that this is a permanent redirect to the GitHub
2651 ;; page, but the pyfakefs documentation asks us to use this specific URL
2652 ;; when linking to the project. Honor their request.
2653 (home-page "http://pyfakefs.org/")
2654 ;; TRANSLATORS: In the synopsis, "Mock" is a verb.
2655 (synopsis "Mock file system interactions in tests")
2657 "This package provides a Python library intended for use in automated
2658 tests. One difficulty when testing software is that the code under test might
2659 need to read or write to files in the local file system. If the file system
2660 is not set up in just the right way, it might cause a spurious error during
2661 the test. The pyfakefs library provides a solution to problems like this by
2662 mocking file system interactions. In other words, it arranges for the code
2663 under test to interact with a fake file system instead of the real file
2664 system. The code under test requires no modification to work with pyfakefs.")
2665 (license license:asl2.0)))
2667 (define-public python2-pyfakefs
2668 (package-with-python2 python-pyfakefs))
2670 ;; This minimal variant is used to avoid a circular dependency between
2671 ;; python2-importlib-metadata, which requires pyfakefs for its tests, and
2672 ;; python2-pytest, which requires python2-importlib-metadata.
2673 (define-public python2-pyfakefs-bootstrap
2676 (inherit python2-pyfakefs)
2677 (name "python2-pyfakefs-bootstrap")
2680 `(#:python ,python-2
2683 (define-public python-aiounittest
2685 (name "python-aiounittest")
2690 (uri (pypi-uri "aiounittest" version))
2693 "1q4bhmi80smaa1lknvdna0sx3915naczlfna1fp435nf6cjyrjl1"))))
2694 (build-system python-build-system)
2696 `(("python-coverage" ,python-coverage)
2697 ("python-nose" ,python-nose)))
2699 "https://github.com/kwarunek/aiounittest")
2700 (synopsis "Test asyncio code more easily")
2701 (description "Aiounittest is a library that helps write tests using
2702 asynchronous code in Python (asyncio).")
2703 (license license:expat)))