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"))))))
120 (define-public clitest
124 (home-page "https://github.com/aureliojargas/clitest")
129 (commit (string-append "v" version))))
130 (file-name (git-file-name name version))
133 "0zw5wra9hc717srmcar1wm4i34kyj8c49ny4bb7y3nrvkjp2pdb5"))))
134 (build-system gnu-build-system)
137 (modify-phases %standard-phases
138 ;; This package is distributed as a single shell script and comes
139 ;; without a proper build system.
144 (substitute* "test.md"
145 ;; One test looks for an error from grep in the form "grep: foo",
146 ;; but our grep returns the absolute file name on errors. Adjust
147 ;; the test to cope with that.
148 (("sed 's/\\^e\\*grep: \\.\\*/")
149 "sed 's/.*e*grep: .*/"))
151 (setenv "HOME" "/tmp")
152 (invoke "./clitest" "test.md")))
154 (lambda* (#:key outputs #:allow-other-keys)
155 (let ((out (assoc-ref outputs "out")))
156 (install-file "clitest" (string-append out "/bin"))
157 (install-file "README.md"
158 (string-append out "/share/doc/clitest-" ,version))
161 `(("perl" ,perl))) ;for tests
162 (synopsis "Command line test tool")
164 "@command{clitest} is a portable shell script that performs automatic
165 testing of Unix command lines.")
166 (license license:expat)))
175 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
176 version "/CUnit-" version ".tar.bz2"))
179 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
180 (build-system gnu-build-system)
181 (arguments '(#:phases
182 (modify-phases %standard-phases
183 ;; XXX: The "bootstrap" phase detects the "bootstrap"
184 ;; script, but fails to execute it, so we bootstrap
187 (lambda _ (invoke "autoreconf" "-vfi"))))))
189 `(("automake" ,automake)
190 ("autoconf" ,autoconf)
191 ("libtool" ,libtool)))
192 (home-page "http://cunit.sourceforge.net/")
193 (synopsis "Automated testing framework for C")
195 "CUnit is a lightweight system for writing, administering, and running
196 unit tests in C. It provides C programmers with basic testing functionality
197 with a flexible variety of user interfaces.")
198 (license license:gpl2+)))
200 (define-public cppunit
206 (uri (string-append "http://dev-www.libreoffice.org/src/"
207 name "-" version ".tar.gz"))
210 "1027cyfx5gsjkdkaf6c2wnjh68882grw8n672018cj3vs9lrhmix"))))
211 ;; Explicitly link with libdl. This is expected to be done by packages
212 ;; relying on cppunit for their tests. However, not all of them do.
213 ;; If we added the linker flag to such packages, we would pollute all
214 ;; binaries, not only those used for testing.
216 `(#:make-flags '("LDFLAGS=-ldl")))
217 (build-system gnu-build-system)
218 (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
219 (synopsis "Unit testing framework for C++")
220 (description "CppUnit is the C++ port of the famous JUnit framework for
221 unit testing. Test output is in XML for automatic testing and GUI based for
223 (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
225 ;; When dependent packages upgraded to use newer version of catch, this one should
227 (define-public catch-framework
230 (version "1.3.5") ;Sub-minor is the build number
234 (url "https://github.com/philsquared/Catch")
236 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
237 (file-name (string-append name "-" version))
240 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
241 (build-system trivial-build-system)
243 `(#:modules ((guix build utils))
245 (use-modules (guix build utils))
246 (let* ((source (assoc-ref %build-inputs "source"))
247 (output (assoc-ref %outputs "out"))
248 (incdir (string-append output "/include"))
249 (docdir (string-append output "/share/doc/catch-"
251 (for-each mkdir-p (list incdir docdir))
252 (install-file (string-append source
253 "/single_include/catch.hpp")
255 (copy-recursively (string-append source "/docs")
258 (home-page "http://catch-lib.net/")
259 (synopsis "Automated test framework for C++ and Objective-C")
261 "Catch stands for C++ Automated Test Cases in Headers and is a
262 multi-paradigm automated test framework for C++ and Objective-C.")
263 (license license:boost1.0)))
265 (define-public catch-framework2-1
269 (home-page "https://github.com/catchorg/Catch2")
273 (url "https://github.com/catchorg/Catch2")
274 (commit (string-append "v" version))))
275 (file-name (git-file-name name version))
278 "1gdp5wm8khn02g2miz381llw3191k7309qj8s3jd6sasj01rhf23"))))
279 (build-system cmake-build-system)
280 (synopsis "Automated test framework for C++ and Objective-C")
281 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
282 a multi-paradigm automated test framework for C++ and Objective-C.")
283 (license license:boost1.0)))
285 (define-public catch-framework2
289 (home-page "https://github.com/catchorg/Catch2")
293 (url "https://github.com/catchorg/Catch2")
294 (commit (string-append "v" version))))
295 (file-name (git-file-name name version))
298 "14vcckqmbydjsg40ngi6iv999zimysh2l7fmrqj1d7xl990qz233"))))
299 (build-system cmake-build-system)
301 `(("python" ,python-wrapper)))
302 (synopsis "Automated test framework for C++ and Objective-C")
303 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
304 a multi-paradigm automated test framework for C++ and Objective-C.")
305 (license license:boost1.0)))
307 (define-public cmdtest
313 (uri (string-append "http://git.liw.fi/cmdtest/snapshot/"
314 name "-" version ".tar.gz"))
317 "1jmfiyrrqmpvwdb273bkb8hjaf4rwx9njblx29pmr7giyahskwi5"))))
318 (build-system python-build-system)
322 (modify-phases %standard-phases
323 ;; check phase needs to be run before the build phase. If not, the
324 ;; coverage test runner looks for tests for the built source files,
327 (add-before 'build 'check
330 (("/bin/sh") (which "sh")))
331 ;; yarn uses python2-ttystatus to print messages.
332 ;; python2-ttystatus requires /dev/tty which is not present in
333 ;; the build environment. Hence assuming-failure test fails.
334 (delete-file "yarn.tests/assuming-failure.script")
335 (delete-file "yarn.tests/assuming-failure.stdout")
336 (invoke "python" "setup.py" "check"))))))
338 `(("python2-coverage-test-runner" ,python2-coverage-test-runner)))
340 `(("python2-cliapp" ,python2-cliapp)
341 ("python2-markdown" ,python2-markdown)
342 ("python2-ttystatus" ,python2-ttystatus)))
343 (home-page "https://liw.fi/cmdtest/")
344 (synopsis "Black box Unix program tester")
346 "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
347 given a command line and input files, and the expected output, and it verifies
348 that the command line produces the expected output. If not, it reports a
349 problem, and shows the differences.")
350 (license license:gpl3+)))
352 (define-public cmocka
358 (uri (string-append "https://cmocka.org/files/"
359 (version-major+minor version) "/cmocka-"
363 "1dm8pdvkyfa8dsbz9bpq7wwgixjij4sii9bbn5sgvqjm5ljdik7h"))))
364 (build-system cmake-build-system)
366 `(#:tests? #f)) ; no test target
367 (home-page "https://cmocka.org/")
368 (synopsis "Unit testing framework for C")
369 (description "Cmocka is a unit testing framework for C with support for
370 mock objects. It only requires the standard C library, and works with
371 different compilers. Cmocka supports several different message output formats
372 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
374 (license license:asl2.0)))
376 (define-public cppcheck
383 (url "https://github.com/danmar/cppcheck")
385 (file-name (git-file-name name version))
387 (base32 "0h7ir2x0k005fm586dxmaphgv5cyz25k3k4sh02p7zb78gzx398h"))))
388 (build-system cmake-build-system)
390 '(#:configure-flags '("-DBUILD_TESTS=ON")))
391 (home-page "http://cppcheck.sourceforge.net")
392 (synopsis "Static C/C++ code analyzer")
393 (description "Cppcheck is a static code analyzer for C and C++. Unlike
394 C/C++ compilers and many other analysis tools it does not detect syntax errors
395 in the code. Cppcheck primarily detects the types of bugs that the compilers
396 normally do not detect. The goal is to detect only real errors in the code
397 (i.e. have zero false positives).")
398 (license license:gpl3+)))
400 (define-public cxxtest
406 (uri (string-append "mirror://sourceforge/cxxtest/cxxtest/"
407 version "/cxxtest-" version ".tar.gz"))
410 "1n7pbj4z9ivx005hqvivj9ddhq8awynzg6jishfbypf6j7ply58w"))))
411 (build-system python-build-system)
414 (modify-phases %standard-phases
415 (add-after 'unpack 'chdir-to-source
419 (add-after 'install 'install-headers
420 (lambda* (#:key outputs #:allow-other-keys)
421 (let* ((out (assoc-ref outputs "out"))
422 (include-dir (string-append out "/include/cxxtest")))
423 (for-each (lambda (header-file)
424 (install-file header-file include-dir))
425 (find-files "../cxxtest"))
427 (add-after 'install 'install-doc
428 (lambda* (#:key outputs #:allow-other-keys)
429 (let* ((out (assoc-ref outputs "out"))
430 (doc-dir (string-append out "/share/doc/cxxtest")))
431 (install-file "../README" doc-dir)
432 (install-file "../doc/guide.txt" doc-dir)
433 (copy-recursively "../sample" (string-append doc-dir "/sample"))
436 `(("python-ply" ,python-ply)))
437 (home-page "https://cxxtest.com/")
438 (synopsis "Unit testing framework for C++")
439 (description "CxxTest is a unit testing framework for C++ that is similar
440 in spirit to JUnit, CppUnit, and xUnit. CxxTest does not require precompiling
441 a CxxTest testing library, it employs no advanced features of C++ (e.g. RTTI)
442 and it supports a very flexible form of test discovery.")
443 (license license:lgpl3+)))
445 (define-public doctest
449 (home-page "https://github.com/onqtam/doctest")
452 (uri (git-reference (url home-page) (commit version)))
453 (file-name (git-file-name name version))
456 "1yi95saqv8qb3ix6w8d7ffvs7qbwvqmq6wblckhxhicxxdxk85cd"))))
457 (build-system cmake-build-system)
458 (synopsis "C++ test framework")
460 "doctest is a single-header testing framework for C++11 and later. It
461 has been designed to be fast, light and unintrusive.")
462 (license license:expat)))
464 (define-public go-gopkg.in-check.v1
465 (let ((commit "788fd78401277ebd861206a03c884797c6ec5541")
468 (name "go-gopkg.in-check.v1")
469 (version (git-version "0.0.0" revision commit))
473 (url "https://github.com/go-check/check")
475 (file-name (git-file-name name version))
478 "0v3bim0j375z81zrpr5qv42knqs0y2qv2vkjiqi5axvb78slki1a"))))
479 (build-system go-build-system)
481 '(#:import-path "gopkg.in/check.v1"))
483 `(("go-github-com-kr-pretty" ,go-github-com-kr-pretty)))
484 (synopsis "Rich testing extension for Go's testing package")
486 "@code{check} is a rich testing extension for Go's testing package.")
487 (home-page "https://github.com/go-check/check")
488 (license license:bsd-2))))
490 (define-public go-github.com-smartystreets-gunit
492 (name "go-github.com-smartystreets-gunit")
497 (url "https://github.com/smartystreets/gunit")
499 (file-name (git-file-name name version))
502 "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
503 (build-system go-build-system)
505 '(;; TODO: This package depends on go-github.com-smartystreets-assertions
506 ;; for running the tests, but go-github.com-smartystreets-assertions
507 ;; depends on this package, so break this loop by not running the tests
510 #:import-path "github.com/smartystreets/gunit"))
511 (synopsis "Testing tool for Go, in the style of xUnit")
513 "@code{gunit} allows the test author to use a struct as the scope for a
514 group of related test cases, in the style of xUnit fixtures. This makes
515 extraction of setup/teardown behavior (as well as invoking the system under
516 test) much simpler.")
517 (home-page "https://github.com/smartystreets/gunit")
518 (license license:expat)))
520 (define-public go-github.com-smartystreets-assertions
522 (name "go-github.com-smartystreets-assertions")
527 (url "https://github.com/smartystreets/assertions")
529 (file-name (git-file-name name version))
532 "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
533 (build-system go-build-system)
535 '(#:import-path "github.com/smartystreets/assertions"))
537 `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
538 (synopsis "Assertions for testing with Go")
540 "The @code{assertions} package provides convenient assertion functions
541 for writing tests in Go.")
542 (home-page "https://github.com/smartystreets/assertions")
543 (license license:expat)))
545 (define-public go-github.com-smartystreets-goconvey
547 (name "go-github.com-smartystreets-goconvey")
552 (url "https://github.com/smartystreets/goconvey")
554 (file-name (git-file-name name version))
557 "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
558 (build-system go-build-system)
560 '(#:import-path "github.com/smartystreets/goconvey"))
562 `(("go-github.com-jtolds-gls" ,go-github.com-jtolds-gls)
563 ("go-github.com-smartystreets-assertions" ,go-github.com-smartystreets-assertions)))
564 (synopsis "Go testing tool with both a web and terminal user interface")
566 "GoConvey is a testing tool for Go. It integrates with go test, can show
567 test coverage and has a web user interface that will refresh automatically.")
568 (home-page "https://github.com/smartystreets/goconvey")
569 (license license:expat)))
571 (define-public googletest
579 (url "https://github.com/google/googletest")
580 (commit (string-append "release-" version))))
581 (file-name (git-file-name name version))
583 (base32 "1zbmab9295scgg4z2vclgfgjchfjailjnvzc6f5x9jvlsdi3dpwz"))))
584 (build-system cmake-build-system)
586 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
588 `(("python" ,python-wrapper)))
589 (home-page "https://github.com/google/googletest/")
590 (synopsis "Test discovery and XUnit test framework")
591 (description "Google Test features an XUnit test framework, automated test
592 discovery, death tests, assertions, parameterized tests and XML test report
594 (license license:bsd-3)))
596 (define-public googletest-1.8
603 (url "https://github.com/google/googletest")
604 (commit (string-append "release-" version))))
605 (file-name (git-file-name "googletest" version))
608 "0270msj6n7mggh4xqqjp54kswbl7mkcc8px1p5dqdpmw5ngh9fzk"))))))
610 (define-public cpputest
617 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
618 version "/cpputest-" version ".tar.gz"))
621 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
622 (build-system gnu-build-system)
624 `(("googletest" ,googletest)))
625 (home-page "https://cpputest.github.io/")
626 (synopsis "Unit testing and mocking framework for C/C++")
628 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
629 C++ but is used in C and C++ projects and frequently used in embedded systems
630 but it works for any C/C++ project.")
631 (license license:bsd-3)))
633 (define-public python-parameterized
635 (name "python-parameterized")
640 (uri (pypi-uri "parameterized" version))
642 (base32 "1444fdz5bj0k10nmhxv0bv2gfrfisi7hfzqdndb0pvhf4g3qq3qr"))))
643 (build-system python-build-system)
645 '(#:phases (modify-phases %standard-phases
647 (lambda* (#:key tests? #:allow-other-keys)
649 (invoke "nosetests" "-v")
650 (format #t "test suite not run~%"))
653 `(("python-mock" ,python-mock)
654 ("python-nose" ,python-nose)))
655 (home-page "https://github.com/wolever/parameterized")
656 (synopsis "Parameterized testing with any Python test framework")
658 "Parameterized is a Python library that aims to fix parameterized testing
659 for every Python test framework. It supports nose, py.test, and unittest.")
660 (properties `((python2-variant . ,(delay python2-parameterized))))
661 (license license:bsd-2)))
663 (define-public python2-parameterized
664 (let ((base (package-with-python2 (strip-python2-variant
665 python-parameterized))))
670 (inherit (package-source base))
671 (patches (search-patches "python2-parameterized-docstring-test.patch")))))))
673 (define-public python-minimock
675 (name "python-minimock")
680 (uri (pypi-uri "MiniMock" version))
683 "0k2sxb1ibnyg05iblz7zhbv825f1zk9906rab7883iqgvzmdzpsz"))))
684 (build-system python-build-system)
685 (home-page "https://pypi.org/project/MiniMock")
686 (synopsis "Simple Python library for using mock objects")
687 (description "MiniMock is a simple library for building mock objects with
689 (license license:expat)))
691 (define-public python2-minimock
692 (package-with-python2 python-minimock))
694 (define-public python-mock
701 (uri (pypi-uri "mock" version))
704 "1hrp6j0yrx2xzylfv02qa8kph661m6yq4p0mc8fnimch9j4psrc3"))))
706 `(("python-six" ,python-six)))
707 (build-system python-build-system)
709 ;; FIXME: Tests require "pytest", which depends on this package.
711 (home-page "https://github.com/testing-cabal/mock")
712 (synopsis "Python mocking and patching library for testing")
714 "Mock is a library for testing in Python. It allows you to replace parts
715 of your system under test with mock objects and make assertions about how they
717 (properties `((python2-variant . ,(delay python2-mock))))
718 (license license:expat)))
720 (define-public python2-mock
721 (let ((base (package-with-python2
722 (strip-python2-variant python-mock))))
723 (package (inherit base)
725 `(("python2-functools32" ,python2-functools32)
726 ("python2-funcsigs" ,python2-funcsigs)
727 ,@(package-propagated-inputs base))))))
729 (define-public python-nose
736 (uri (pypi-uri "nose" version))
739 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
740 (build-system python-build-system)
742 '(#:tests? #f)) ; FIXME: test suite fails
743 (home-page "http://readthedocs.org/docs/nose/")
744 (synopsis "Python testing library")
746 "Nose extends the unittest library to make testing easier.")
747 (license license:lgpl2.0+)))
749 (define-public python2-nose
750 (package-with-python2 python-nose))
752 (define-public python-nose2
754 (name "python-nose2")
759 (uri (pypi-uri "nose2" version))
762 "0pmbb6nk31yhgh4zkcblzxsznml7f7pf5q1ihgrwvbxv4mwzfql7"))))
763 (build-system python-build-system)
764 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
766 `(("python-cov-core" ,python-cov-core)
767 ("python-pytest-cov" ,python-pytest-cov)
768 ("python-six" ,python-six)))
769 (home-page "https://github.com/nose-devs/nose2")
770 (synopsis "Next generation of nicer testing for Python")
772 "Nose2 is the next generation of nicer testing for Python, based on the
773 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
774 better plugin api, being easier for users to configure, and simplifying internal
775 interfaces and processes.")
776 (license license:bsd-2)))
778 (define-public python2-nose2
779 (package-with-python2 python-nose2))
781 (define-public python-unittest2
783 (name "python-unittest2")
788 (uri (pypi-uri "unittest2" version))
790 (search-patches "python-unittest2-python3-compat.patch"
791 "python-unittest2-remove-argparse.patch"))
794 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
795 (build-system python-build-system)
798 (modify-phases %standard-phases
801 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
803 `(("python-six" ,python-six)
804 ("python-traceback2" ,python-traceback2)))
805 (home-page "https://pypi.org/project/unittest2/")
806 (synopsis "Python unit testing library")
808 "Unittest2 is a replacement for the unittest module in the Python
810 (license license:psfl)))
812 (define-public python2-unittest2
813 (package-with-python2 python-unittest2))
815 (define-public python-pytest
817 (name "python-pytest")
822 (uri (pypi-uri "pytest" version))
825 "139i9cjhrv5aici3skq8iihvfb3lq0d8xb5j7qycr2hlk8cfjpqd"))))
826 (build-system python-build-system)
829 (modify-phases %standard-phases
831 (lambda* (#:key (tests? #t) #:allow-other-keys)
833 (invoke "pytest" "-vv" "-k"
835 ;; These tests involve the /usr directory, and fails.
836 "not test_remove_dir_prefix"
837 " and not test_argcomplete"
838 ;; This test tries to override PYTHONPATH, and
839 ;; subsequently fails to locate the test libraries.
840 " and not test_collection"))
841 (format #t "test suite not run~%"))
844 `(("python-atomicwrites" ,python-atomicwrites)
845 ("python-attrs" ,python-attrs-bootstrap)
846 ("python-more-itertools" ,python-more-itertools)
847 ("python-packaging" ,python-packaging-bootstrap)
848 ("python-pluggy" ,python-pluggy)
849 ("python-py" ,python-py)
850 ("python-six" ,python-six-bootstrap)
851 ("python-wcwidth" ,python-wcwidth)))
853 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
855 ("python-hypothesis" ,python-hypothesis)
856 ("python-nose" ,python-nose)
857 ("python-mock" ,python-mock)
858 ("python-pytest" ,python-pytest-bootstrap)
859 ("python-setuptools-scm" ,python-setuptools-scm)
860 ("python-xmlschema" ,python-xmlschema)))
861 (home-page "https://docs.pytest.org/en/latest/")
862 (synopsis "Python testing library")
864 "Pytest is a testing tool that provides auto-discovery of test modules
865 and functions, detailed info on failing assert statements, modular fixtures,
866 and many external plugins.")
867 (license license:expat)
868 (properties `((python2-variant . ,(delay python2-pytest))))))
870 ;; Pytest 4.x are the last versions that support Python 2.
871 (define-public python2-pytest
873 (inherit (strip-python2-variant python-pytest))
874 (name "python2-pytest")
878 (uri (pypi-uri "pytest" version))
881 "0fgkmpc31nzy97fxfrkqbzycigdwxwwmninx3qhkzp81migggs0r"))))
882 (build-system python-build-system)
885 ,@(package-arguments python-pytest)))
887 `(("python-atomicwrites" ,python2-atomicwrites)
888 ("python-attrs" ,python2-attrs-bootstrap)
889 ("python-funcsigs" ,python2-funcsigs)
890 ("python-importlib-metadata" ,python2-importlib-metadata-bootstrap)
891 ("python-more-itertools" ,python2-more-itertools)
892 ("python-packaging" ,python2-packaging-bootstrap)
893 ("python-pathlib2" ,python2-pathlib2)
894 ("python-pluggy" ,python2-pluggy)
895 ("python-py" ,python2-py)
896 ("python-six" ,python2-six-bootstrap)
897 ("python-wcwidth" ,python2-wcwidth)))
899 `(("bash" ,bash) ;tests require 'compgen'
900 ("python-hypothesis" ,python2-hypothesis)
901 ("python-nose" ,python2-nose)
902 ("python-mock" ,python2-mock)
903 ("python-pytest" ,python2-pytest-bootstrap)
904 ("python-setuptools-scm" ,python2-setuptools-scm)))))
906 (define-public python-pytest-bootstrap
908 (inherit (strip-python2-variant python-pytest))
909 (name "python-pytest-bootstrap")
910 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
911 (arguments `(#:tests? #f))
912 (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
914 (define-public python2-pytest-bootstrap
918 (name "python2-pytest-bootstrap")
920 (substitute-keyword-arguments (package-arguments python2-pytest)
921 ((#:tests? _ #f) #f)))
923 `(("python-setuptools-scm" ,python2-setuptools-scm)))
925 `(("python-atomicwrites" ,python2-atomicwrites)
926 ("python-attrs" ,python2-attrs-bootstrap)
927 ("python-funcsigs" ,python2-funcsigs-bootstrap)
928 ("python-importlib-metadata" ,python2-importlib-metadata-bootstrap)
929 ("python-more-itertools" ,python2-more-itertools)
930 ("python-packaging" ,python2-packaging-bootstrap)
931 ("python-pathlib2" ,python2-pathlib2-bootstrap)
932 ("python-pluggy" ,python2-pluggy-bootstrap)
933 ("python-py" ,python2-py)
934 ("python-wcwidth" ,python2-wcwidth))))))
936 (define-public python-pytest-cov
938 (name "python-pytest-cov")
943 (uri (pypi-uri "pytest-cov" version))
945 (base32 "0avzlk9p4nc44k7lpx9109dybq71xqnggxb9f4hp0l64pbc44ryc"))))
946 (build-system python-build-system)
949 (modify-phases %standard-phases
952 ;; Options taken from tox.ini.
953 ;; TODO: make "--restructuredtext" tests pass. They currently fail
954 ;; with "Duplicate implicit target name".
955 (invoke "python" "./setup.py" "check"
956 "--strict" "--metadata"))))))
958 `(("python-coverage" ,python-coverage)
959 ("python-pytest" ,python-pytest)))
960 (home-page "https://github.com/pytest-dev/pytest-cov")
961 (synopsis "Pytest plugin for measuring coverage")
963 "Pytest-cov produces coverage reports. It supports centralised testing and
964 distributed testing in both @code{load} and @code{each} modes. It also
965 supports coverage of subprocesses.")
966 (license license:expat)))
968 (define-public python2-pytest-cov
969 (package-with-python2 python-pytest-cov))
971 (define-public python-pytest-runner
973 (name "python-pytest-runner")
978 (uri (pypi-uri "pytest-runner" version))
981 "0awll1bva5zy8cspsxcpv7pjcrdf5c6pf56nqn4f74vvmlzfgiwn"))))
982 (build-system python-build-system)
984 '(;; FIXME: The test suite requires 'python-flake8' and 'python-black',
985 ;; but that introduces a circular dependency.
987 #:phases (modify-phases %standard-phases
989 (lambda* (#:key tests? #:allow-other-keys)
991 (invoke "pytest" "-vv")
992 (format #t "test suite not run~%"))
995 `(("python-setuptools-scm" ,python-setuptools-scm)))
996 (home-page "https://github.com/pytest-dev/pytest-runner")
997 (synopsis "Invoke py.test as a distutils command")
999 "This package provides a @command{pytest-runner} command that
1000 @file{setup.py} files can use to run tests.")
1001 (license license:expat)))
1003 (define-public python2-pytest-runner
1004 (package-with-python2 python-pytest-runner))
1006 ;; python-bleach 3.1.0 requires this ancient version of pytest-runner.
1007 ;; Remove once no longer needed.
1008 (define-public python-pytest-runner-2
1010 python-pytest-runner
1014 (uri (pypi-uri "pytest-runner" version))
1017 "11ivjj9hfphkv4yfb2g74av4yy86y8gcbf7gbif0p1hcdfnxg3w6"))))))
1019 (define-public python2-pytest-runner-2
1020 (package-with-python2 python-pytest-runner-2))
1022 (define-public python-pytest-lazy-fixture
1024 (name "python-pytest-lazy-fixture")
1029 (uri (pypi-uri "pytest-lazy-fixture" version))
1031 (base32 "1b0hmnsxw4s2wf9pks8dg6dfy5cx3zcbzs8517lfccxsfizhqz8f"))))
1032 (build-system python-build-system)
1035 (modify-phases %standard-phases
1037 (lambda* (#:key inputs outputs #:allow-other-keys)
1038 ;; Make the installed plugin discoverable by Pytest.
1039 (add-installed-pythonpath inputs outputs)
1040 (invoke "pytest" "-vv"))))))
1042 `(("python-pytest" ,python-pytest)))
1043 (home-page "https://github.com/tvorog/pytest-lazy-fixture")
1044 (synopsis "Use fixtures in @code{pytest.mark.parametrize}")
1045 (description "This plugin helps to use fixtures in
1046 @code{pytest.mark.parametrize}.")
1047 (license license:expat)))
1049 (define-public python-pytest-mock
1051 (name "python-pytest-mock")
1056 (uri (pypi-uri "pytest-mock" version))
1059 "1i5mg3ff1qk0wqfcxfz60hwy3q5dskdp36i10ckigkzffg8hc3ad"))))
1060 (build-system python-build-system)
1062 `(("python-setuptools-scm" ,python-setuptools-scm)))
1064 `(("python-pytest" ,python-pytest)))
1065 (home-page "https://github.com/pytest-dev/pytest-mock/")
1066 (synopsis "Thin-wrapper around the mock package for easier use with py.test")
1068 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
1069 around the patching API provided by the @code{mock} package, but with the
1070 benefit of not having to worry about undoing patches at the end of a test.
1071 The mocker fixture has the same API as @code{mock.patch}, supporting the
1073 (properties `((python2-variant . ,(delay python2-pytest-mock))))
1074 (license license:expat)))
1076 (define-public python2-pytest-mock
1077 (let ((base (package-with-python2
1078 (strip-python2-variant python-pytest-mock))))
1079 (package (inherit base)
1081 `(("python2-mock" ,python2-mock)
1082 ,@(package-propagated-inputs base))))))
1084 (define-public python-pytest-xdist
1086 (name "python-pytest-xdist")
1091 (uri (pypi-uri "pytest-xdist" version))
1094 "1d812apvcmshh2l8f38spqwb3bpp0x43yy7lyfpxxzc99h4r7y4n"))
1095 (modules '((guix build utils)))
1098 ;; Remove pre-compiled .pyc files from source.
1099 (for-each delete-file-recursively
1100 (find-files "." "__pycache__" #:directories? #t))
1101 (for-each delete-file (find-files "." "\\.pyc$"))
1103 (build-system python-build-system)
1105 '(#:tests? #f)) ;FIXME: Some tests are failing.
1107 ;; (modify-phases %standard-phases
1109 ;; (add-after 'install 'check
1110 ;; (lambda* (#:key inputs outputs #:allow-other-keys)
1111 ;; (add-installed-pythonpath inputs outputs)
1112 ;; (zero? (system* "py.test" "-v")))))
1114 `(("python-setuptools-scm" ,python-setuptools-scm)))
1116 `(("python-execnet" ,python-execnet)
1117 ("python-pytest" ,python-pytest)
1118 ("python-py" ,python-py)))
1120 "https://github.com/pytest-dev/pytest-xdist")
1122 "Plugin for py.test with distributed testing and loop-on-failing modes")
1124 "The pytest-xdist plugin extends py.test with some unique test execution
1125 modes: parallelization, running tests in boxed subprocesses, the ability
1126 to run tests repeatedly when failed, and the ability to run tests on multiple
1127 Python interpreters or platforms. It uses rsync to copy the existing
1128 program code to a remote location, executes there, and then syncs the
1130 (license license:expat)))
1132 (define-public python2-pytest-xdist
1133 (package-with-python2 python-pytest-xdist))
1135 (define-public python-pytest-timeout
1137 (name "python-pytest-timeout")
1142 (uri (pypi-uri "pytest-timeout" version))
1145 "13n42azbvs5slvy2n1a9nw17r4qdq10dd68nln3jp925safa3yl0"))))
1146 (build-system python-build-system)
1148 '(#:phases (modify-phases %standard-phases
1150 (lambda* (#:key inputs outputs #:allow-other-keys)
1151 ;; Make the installed plugin discoverable by Pytest.
1152 (add-installed-pythonpath inputs outputs)
1153 (invoke "pytest" "-vv"))))))
1155 `(("python-pytest" ,python-pytest)))
1157 `(("python-pexpect" ,python-pexpect)))
1158 (home-page "http://bitbucket.org/pytest-dev/pytest-timeout/")
1159 (synopsis "Plugin for py.test to abort hanging tests")
1161 "This package provides a py.test plugin that aborts hanging tests after a
1162 timeout has been exceeded.")
1163 (license license:expat)))
1165 (define-public python-pytest-forked
1167 (name "python-pytest-forked")
1172 (uri (pypi-uri "pytest-forked" version))
1175 "000i4q7my2fq4l49n8idx2c812dql97qv6qpm2vhrrn9v6g6j18q"))))
1176 (build-system python-build-system)
1178 `(("python-pytest" ,python-pytest)))
1180 `(("python-setuptools-scm" ,python-setuptools-scm)))
1182 "https://github.com/pytest-dev/pytest-forked")
1184 "Run tests in isolated forked subprocesses")
1186 "Pytest plugin which will run each test in a subprocess and will report if
1187 a test crashed the process.")
1188 (license license:expat)))
1190 (define-public python-scripttest
1192 (name "python-scripttest")
1197 (uri (pypi-uri "scripttest" version))
1200 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
1201 (build-system python-build-system)
1203 `(("python-pytest" ,python-pytest)))
1204 (home-page (string-append "https://web.archive.org/web/20161029233413/"
1205 "http://pythonpaste.org/scripttest/"))
1206 (synopsis "Python library to test command-line scripts")
1207 (description "Scripttest is a Python helper library for testing
1208 interactive command-line applications. With it you can run a script in a
1209 subprocess and see the output as well as any file modifications.")
1210 (license license:expat)))
1212 (define-public python2-scripttest
1213 (package-with-python2 python-scripttest))
1215 (define-public python-testtools-bootstrap
1217 (name "python-testtools-bootstrap")
1222 (uri (pypi-uri "testtools" version))
1225 "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
1226 (patches (search-patches "python-testtools.patch"))))
1227 (build-system python-build-system)
1228 (arguments '(#:tests? #f))
1230 `(("python-extras" ,python-extras)
1231 ("python-fixtures" ,python-fixtures-bootstrap)
1232 ("python-mimeparse" ,python-mimeparse)
1233 ("python-pbr" ,python-pbr-minimal)
1234 ("python-six" ,python-six)
1235 ("python-traceback2" ,python-traceback2)
1236 ("python-unittest2" ,python-unittest2)))
1237 (home-page "https://github.com/testing-cabal/testtools")
1239 "Extensions to the Python standard library unit testing framework")
1241 "This package is only for bootstrapping. Do not use this.")
1242 (license license:psfl)))
1244 (define-public python2-testtools-bootstrap
1245 (package-with-python2 python-testtools-bootstrap))
1247 (define-public python-testtools
1249 (inherit python-testtools-bootstrap)
1250 (name "python-testtools")
1252 `(#:phases (modify-phases %standard-phases
1255 (invoke "python" "-m" "testtools.run"
1256 "testtools.tests.test_suite"))))))
1258 `(("python-extras" ,python-extras)
1259 ("python-fixtures" ,python-fixtures)
1260 ("python-mimeparse" ,python-mimeparse)
1261 ("python-pbr" ,python-pbr)
1262 ("python-six" ,python-six)
1263 ("python-traceback2" ,python-traceback2)
1264 ("python-unittest2" ,python-unittest2)))
1266 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
1268 "Testtools extends the Python standard library unit testing framework to
1269 provide matchers, more debugging information, and cross-Python
1272 (define-public python2-testtools
1273 (package-with-python2 python-testtools))
1275 (define-public python-testscenarios-bootstrap
1277 (name "python-testscenarios-bootstrap")
1282 (uri (pypi-uri "testscenarios" version))
1285 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
1286 (build-system python-build-system)
1288 `(#:phases (modify-phases %standard-phases
1291 (invoke "python" "-m" "testtools.run"
1292 "testscenarios.test_suite"))))))
1294 `(("python-pbr" ,python-pbr-minimal)
1295 ("python-testtools" ,python-testtools-bootstrap)))
1296 (home-page "https://launchpad.net/testscenarios")
1297 (synopsis "Pyunit extension for dependency injection")
1299 "This package is only for bootstrapping. Don't use this.")
1300 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1302 (define-public python2-testscenarios-bootstrap
1303 (package-with-python2 python-testscenarios-bootstrap))
1305 (define-public python-testscenarios
1307 (inherit python-testscenarios-bootstrap)
1308 (name "python-testscenarios")
1310 `(("python-pbr" ,python-pbr)
1311 ("python-testtools" ,python-testtools)))
1313 "Testscenarios provides clean dependency injection for Python unittest
1316 (define-public python2-testscenarios
1317 (package-with-python2 python-testscenarios))
1319 ;; Testresources requires python-pbr at runtime, but pbr needs it for its
1320 ;; own tests. Hence this bootstrap variant.
1321 (define-public python-testresources-bootstrap
1323 (name "python-testresources-bootstrap")
1327 (uri (pypi-uri "testresources" version))
1330 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
1331 (build-system python-build-system)
1332 (arguments '(#:tests? #f))
1334 `(("python-pbr" ,python-pbr-minimal)))
1335 (home-page "https://launchpad.net/testresources")
1337 "Pyunit extension for managing test resources")
1339 "This package is only here for bootstrapping purposes. Use the regular
1340 testresources package instead.")
1341 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1343 (define-public python2-testresources-bootstrap
1344 (package-with-python2 python-testresources-bootstrap))
1346 (define-public python-testresources
1348 (inherit python-testresources-bootstrap)
1349 (name "python-testresources")
1351 `(("python-pbr" ,python-pbr)))
1354 `(("python-fixtures" ,python-fixtures)
1355 ("python-testtols" ,python-testtools)))
1357 "Testresources is an extension to Python's unittest to allow declarative
1358 use of resources by test cases.")))
1360 (define-public python2-testresources
1361 (package-with-python2 python-testresources))
1363 (define-public python-subunit-bootstrap
1365 (name "python-subunit-bootstrap")
1370 (uri (pypi-uri "python-subunit" version))
1373 "1fsw8rsn1s3nklx06mayrg5rn2zbky6wwjc5z07s7rf1wjzfs1wn"))))
1374 (build-system python-build-system)
1376 `(("python-extras" ,python-extras)
1377 ("python-testtools" ,python-testtools-bootstrap)))
1379 `(("python-fixtures" ,python-fixtures-bootstrap)
1380 ("python-hypothesis" ,python-hypothesis)
1381 ("python-testscenarios" ,python-testscenarios-bootstrap)))
1382 (home-page "https://launchpad.net/subunit")
1383 (synopsis "Python implementation of the subunit protocol")
1385 "This package is here for bootstrapping purposes only. Use the regular
1386 python-subunit package instead.")
1387 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1389 (define-public python2-subunit-bootstrap
1390 (package-with-python2 python-subunit-bootstrap))
1392 (define-public python-subunit
1394 (inherit python-subunit-bootstrap)
1395 (name "python-subunit")
1397 `(("python-extras" ,python-extras)
1398 ("python-testtools" ,python-testtools)))
1400 `(("python-fixtures" ,python-fixtures)
1401 ("python-hypothesis" ,python-hypothesis)
1402 ("python-testscenarios" ,python-testscenarios)))
1404 "Python-subunit is a Python implementation of the subunit test streaming
1407 (define-public python2-subunit
1408 (package-with-python2 python-subunit))
1410 ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
1411 ;; own tests. Hence this bootstrap variant.
1412 (define-public python-fixtures-bootstrap
1414 (name "python-fixtures-bootstrap")
1418 (uri (pypi-uri "fixtures" version))
1421 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
1422 (build-system python-build-system)
1423 (arguments `(#:tests? #f))
1425 `(("python-pbr-minimal" ,python-pbr-minimal)
1426 ("python-six" ,python-six)))
1427 (home-page "https://launchpad.net/python-fixtures")
1428 (synopsis "Python test fixture library")
1430 "This package is only used for bootstrapping. Use the regular
1431 python-fixtures package instead.")
1432 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1434 (define-public python2-fixtures-bootstrap
1435 (package-with-python2 python-fixtures-bootstrap))
1437 (define-public python-fixtures
1439 (inherit python-fixtures-bootstrap)
1440 (name "python-fixtures")
1443 (modify-phases %standard-phases
1446 (invoke "python" "-m" "testtools.run"
1447 "fixtures.test_suite"))))))
1449 ;; Fixtures uses pbr at runtime to check versions, etc.
1450 `(("python-pbr" ,python-pbr)
1451 ("python-six" ,python-six)))
1453 `(("python-mock" ,python-mock)
1454 ("python-testtools" ,python-testtools-bootstrap)))
1456 "Fixtures provides a way to create reusable state, useful when writing
1459 (define-public python2-fixtures
1460 (package-with-python2 python-fixtures))
1462 (define-public python-testrepository-bootstrap
1464 (name "python-testrepository-bootstrap")
1469 (uri (pypi-uri "testrepository" version))
1472 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1473 (build-system python-build-system)
1474 (arguments '(#:tests? #f))
1476 `(("python-fixtures" ,python-fixtures-bootstrap)
1477 ("python-subunit" ,python-subunit-bootstrap)
1478 ("python-testtools" ,python-testtools-bootstrap)))
1480 `(("python-mimeparse" ,python-mimeparse)))
1481 (home-page "https://launchpad.net/testrepository")
1482 (synopsis "Database for Python test results")
1484 "Bootstrap package for python-testrepository. Don't use this.")
1485 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1487 (define-public python2-testrepository-bootstrap
1488 (package-with-python2 python-testrepository-bootstrap))
1490 (define-public python-testrepository
1492 (inherit python-testrepository-bootstrap)
1493 (name "python-testrepository")
1495 ;; FIXME: Many tests are failing.
1498 `(("python-fixtures" ,python-fixtures)
1499 ("python-subunit" ,python-subunit)
1500 ("python-testtools" ,python-testtools)))
1502 `(("python-mimeparse" ,python-mimeparse)))
1503 (description "Testrepository provides a database of test results which can
1504 be used as part of a developer's workflow to check things such as what tests
1505 have failed since the last commit or what tests are currently failing.")))
1507 (define-public python2-testrepository
1508 (package-with-python2 python-testrepository))
1510 (define-public python-coverage
1512 (name "python-coverage")
1517 (uri (pypi-uri "coverage" version))
1520 "1vrg8panqw79pswg52ygbrff3wdnxarrd9qz6c64ah0c4h2cmbvp"))))
1521 (build-system python-build-system)
1523 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1525 (home-page "https://coverage.readthedocs.io")
1526 (synopsis "Code coverage measurement for Python")
1528 "Coverage measures code coverage, typically during test execution. It
1529 uses the code analysis tools and tracing hooks provided in the Python standard
1530 library to determine which lines are executable, and which have been
1532 (license license:bsd-3)))
1534 (define-public python2-coverage
1535 (package-with-python2 python-coverage))
1537 (define-public python-pytest-asyncio
1539 (name "python-pytest-asyncio")
1544 (uri (pypi-uri "pytest-asyncio" version))
1546 (base32 "1bysy4nii13bm7h345wxf8fxcjhab7l374pqdv7vwv3izl053b4z"))))
1547 (build-system python-build-system)
1549 `(("python-coverage" ,python-coverage)
1550 ("python-async-generator" ,python-async-generator)
1551 ("python-hypothesis" ,python-hypothesis)
1552 ("python-pytest" ,python-pytest)))
1553 (home-page "https://github.com/pytest-dev/pytest-asyncio")
1554 (synopsis "Pytest support for asyncio")
1555 (description "Python asyncio code is usually written in the form of
1556 coroutines, which makes it slightly more difficult to test using normal
1557 testing tools. @code{pytest-asyncio} provides useful fixtures and markers
1558 to make testing async code easier.")
1559 (license license:asl2.0)))
1561 (define-public python-cov-core
1563 (name "python-cov-core")
1568 (uri (pypi-uri "cov-core" version))
1571 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1572 (build-system python-build-system)
1574 `(("python-coverage" ,python-coverage)))
1575 (home-page "https://github.com/schlamar/cov-core")
1576 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
1578 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1579 and @code{nose2-cov}. It is useful for developing coverage plugins for these
1580 testing frameworks.")
1581 (license license:expat)))
1583 (define-public python2-cov-core
1584 (package-with-python2 python-cov-core))
1586 (define-public python-codecov
1588 (name "python-codecov")
1593 (uri (pypi-uri "codecov" version))
1596 "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1597 (build-system python-build-system)
1599 `(("python-unittest2" ,python-unittest2)))
1601 `(("python-coverage" ,python-coverage)
1602 ("python-requests" ,python-requests)))
1603 (home-page "http://github.com/codecov/codecov-python")
1604 (synopsis "Upload code coverage reports to @code{codecov.io}")
1606 "Codecov collects code coverage reports from code written in Python, Java,
1607 C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
1608 (license license:asl2.0)))
1610 (define-public python-testpath
1612 (name "python-testpath")
1618 (url "https://github.com/jupyter/testpath")
1620 (file-name (git-file-name name version))
1623 "0r4iiizjql6ny1ln7ciw7rrbjadz1s9zrf2hl0xkgnh3ypd8936f"))))
1624 (build-system python-build-system)
1626 `(#:tests? #f ; this package does not even have a setup.py
1627 #:modules ((guix build python-build-system)
1631 (modify-phases %standard-phases
1634 (lambda* (#:key inputs outputs #:allow-other-keys)
1635 (let* ((version (last
1636 (string-split (assoc-ref inputs "python") #\-)))
1637 (x.y (string-join (take (string-split version #\.) 2)
1640 (assoc-ref outputs "out")
1641 "/lib/python" x.y "/site-packages/testpath")))
1643 (copy-recursively "testpath" dir))
1645 (home-page "https://github.com/takluyver/testpath")
1646 (synopsis "Test utilities for code working with files and commands")
1648 "Testpath is a collection of utilities for Python code working with files
1649 and commands. It contains functions to check things on the file system, and
1650 tools for mocking system commands and recording calls to those.")
1651 (license license:expat)))
1653 (define-public python2-testpath
1654 (package-with-python2 python-testpath))
1656 (define-public python-testlib
1658 (name "python-testlib")
1663 (uri (pypi-uri "testlib" version ".zip"))
1665 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1666 (build-system python-build-system)
1668 `(("unzip" ,unzip))) ; for unpacking the source
1669 (synopsis "Python micro test suite harness")
1670 (description "A micro unittest suite harness for Python.")
1671 (home-page "https://github.com/trentm/testlib")
1672 (license license:expat)))
1674 (define-public python2-testlib
1675 (package-with-python2 python-testlib))
1677 ;;; The software provided by this package was integrated into pytest 2.8.
1678 (define-public python-pytest-cache
1680 (name "python-pytest-cache")
1684 (uri (pypi-uri "pytest-cache" version))
1687 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1688 (build-system python-build-system)
1690 `(("python-apipkg" ,python-apipkg)
1691 ("python-execnet" ,python-execnet)
1692 ("python-py" ,python-py)
1693 ("python-pytest" ,python-pytest)))
1694 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1695 (description "The pytest-cache plugin provides tools to rerun failures from
1696 the last py.test invocation.")
1697 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1698 (license license:expat)))
1700 (define-public python2-pytest-cache
1701 (package-with-python2 python-pytest-cache))
1703 (define-public python-pytest-localserver
1705 (name "python-pytest-localserver")
1709 (uri (pypi-uri "pytest-localserver" version))
1712 "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
1713 (build-system python-build-system)
1716 (modify-phases %standard-phases
1719 (invoke "py.test" "-v"))))))
1721 `(("python-pytest" ,python-pytest)
1722 ("python-requests" ,python-requests)
1723 ("python-six" ,python-six)))
1725 `(("python-werkzeug" ,python-werkzeug)))
1726 (synopsis "Py.test plugin to test server connections locally")
1727 (description "Pytest-localserver is a plugin for the pytest testing
1728 framework which enables you to test server connections locally.")
1729 (home-page "https://pypi.org/project/pytest-localserver/")
1730 (license license:expat)))
1732 (define-public python-pytest-xprocess
1734 (name "python-pytest-xprocess")
1738 (uri (pypi-uri "pytest-xprocess" version))
1741 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1742 (build-system python-build-system)
1744 `(("python-pytest" ,python-pytest)
1745 ("python-pytest-cache" ,python-pytest-cache)
1746 ("python-psutil" ,python-psutil)))
1747 (synopsis "Pytest plugin to manage external processes across test runs")
1748 (description "Pytest-xprocess is an experimental py.test plugin for managing
1749 processes across test runs.")
1750 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1751 (license license:expat)))
1753 (define-public python-pytest-subtesthack
1755 (name "python-pytest-subtesthack")
1759 (uri (pypi-uri "pytest-subtesthack" version))
1762 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1763 (build-system python-build-system)
1765 `(("python-pytest" ,python-pytest)))
1766 (synopsis "Set-up and tear-down fixtures for unit tests")
1767 (description "This plugin allows you to set up and tear down fixtures within
1768 unit test functions that use @code{py.test}. This is useful for using
1769 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1770 function multiple times, without setting up or tearing down fixture state as is
1771 normally the case.")
1772 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1773 (license license:unlicense)))
1775 (define-public python2-pytest-subtesthack
1776 (package-with-python2 python-pytest-subtesthack))
1778 (define-public python-pytest-sugar
1780 (name "python-pytest-sugar")
1785 (uri (pypi-uri "pytest-sugar" version))
1787 (base32 "1i0hv3h49zvl62jbiyjag84carbrp3zprqzxffdr291nxavvac0n"))))
1788 (build-system python-build-system)
1790 `(("python-packaging" ,python-packaging)
1791 ("python-pytest" ,python-pytest)
1792 ("python-termcolor" ,python-termcolor)))
1793 (home-page "https://pivotfinland.com/pytest-sugar/")
1794 (synopsis "Plugin for pytest that changes the default look and feel")
1796 "@code{pytest-sugar} is a plugin for py.test that changes the default
1797 look and feel of py.test, using a progress bar and showing failures and errors
1799 (license license:bsd-3)))
1801 (define-public python-hypothesis
1803 (name "python-hypothesis")
1807 (uri (pypi-uri "hypothesis" version))
1810 "0zn09bn6hadk4vxl6jy8bkjr5fz8mrhin3z46w7pq5qgbaycr89p"))))
1811 (build-system python-build-system)
1813 ;; XXX: Tests are not distributed with the PyPI archive.
1816 `(("python-attrs" ,python-attrs-bootstrap)
1817 ("python-sortedcontainers" ,python-sortedcontainers)))
1818 (synopsis "Library for property based testing")
1819 (description "Hypothesis is a library for testing your Python code against a
1820 much larger range of examples than you would ever want to write by hand. It’s
1821 based on the Haskell library, Quickcheck, and is designed to integrate
1822 seamlessly into your existing Python unit testing work flow.")
1823 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
1824 (license license:mpl2.0)
1825 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1827 ;; This is the last version of Hypothesis that supports Python 2.
1828 (define-public python2-hypothesis
1829 (let ((hypothesis (package-with-python2
1830 (strip-python2-variant python-hypothesis))))
1831 (package (inherit hypothesis)
1835 (uri (pypi-uri "hypothesis" version))
1838 "183gpxbfcdhdqzlahkji5a71n6lmvgqsbkcb0ihqad51n2j6jhrw"))))
1840 `(("python2-enum34" ,python2-enum34)
1841 ,@(package-propagated-inputs hypothesis))))))
1843 (define-public python-lit
1850 (uri (pypi-uri "lit" version))
1853 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
1854 (build-system python-build-system)
1857 (modify-phases %standard-phases
1860 (invoke "python" "lit.py" "tests"))))))
1863 (home-page "https://llvm.org/")
1864 (synopsis "LLVM Software Testing Tool")
1865 (description "@code{lit} is a portable tool for executing LLVM and Clang
1866 style test suites, summarizing their results, and providing indication of
1868 (license license:ncsa)))
1870 (define-public python2-lit
1871 (package-with-python2 python-lit))
1873 (define-public python-pytest-pep8
1875 (name "python-pytest-pep8")
1879 (uri (pypi-uri "pytest-pep8" version))
1882 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
1883 (build-system python-build-system)
1885 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
1887 `(("python-pytest" ,python-pytest)))
1889 `(("python-pep8" ,python-pep8)))
1890 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
1891 (synopsis "Py.test plugin to check PEP8 requirements")
1892 (description "Pytest plugin for checking PEP8 compliance.")
1893 (license license:expat)))
1895 (define-public python2-pytest-pep8
1896 (package-with-python2 python-pytest-pep8))
1898 (define-public python-pytest-flakes
1900 (name "python-pytest-flakes")
1904 (uri (pypi-uri "pytest-flakes" version))
1907 "0hyind0gb950v9kfy0v97x66fb33slbqmxhrjvgbvsv0ayzn869l"))))
1908 (build-system python-build-system)
1911 (modify-phases %standard-phases
1913 (add-after 'install 'check
1914 (lambda* (#:key outputs inputs #:allow-other-keys)
1915 ;; It's easier to run tests after install.
1916 ;; Make installed package available for running the tests
1917 (add-installed-pythonpath inputs outputs)
1918 (invoke "py.test" "-vv" "-k" "not test_syntax_error"))))))
1920 `(("python-coverage" ,python-coverage)
1921 ("python-pytest" ,python-pytest)
1922 ("python-pytest-cache" ,python-pytest-cache)
1923 ("python-pytest-pep8" ,python-pytest-pep8)))
1925 `(("python-pyflakes" ,python-pyflakes)))
1926 (home-page "https://github.com/fschulze/pytest-flakes")
1927 (synopsis "Py.test plugin to check source code with pyflakes")
1928 (description "Pytest plugin for checking Python source code with pyflakes.")
1929 (license license:expat)))
1931 (define-public python2-pytest-flakes
1932 (package-with-python2 python-pytest-flakes))
1934 (define-public python2-coverage-test-runner
1936 (name "python2-coverage-test-runner")
1942 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
1943 "coverage-test-runner/snapshot/coverage-test-runner-"
1947 "1kjjb9llckycnfxag8zcvqsn4z1s3dwyw6b1n0avxydihgf30rny"))))
1948 (build-system python-build-system)
1950 `(#:python ,python-2
1952 (modify-phases %standard-phases
1955 (invoke "./testrun"))))))
1957 `(("python2-coverage" ,python2-coverage)))
1958 (home-page "https://liw.fi/coverage-test-runner/")
1959 (synopsis "Python module for running unit tests")
1960 (description "@code{CoverageTestRunner} is a python module for running
1961 unit tests and failing them if the unit test module does not exercise all
1962 statements in the module it tests.")
1963 (license license:gpl3+)))
1965 (define-public python-pylint
1967 (name "python-pylint")
1973 (url "https://github.com/PyCQA/pylint")
1974 (commit (string-append "pylint-" version))))
1975 (file-name (git-file-name name version))
1977 (base32 "04cgbh2z1mygar63plzziyz34yg6bdr4i0g63jp256fgnqwb1bi3"))))
1978 (build-system python-build-system)
1979 ;; FIXME: Tests are failing since version 2.4.3, see:
1980 ;; https://github.com/PyCQA/pylint/issues/3198.
1981 (arguments '(#:tests? #f))
1983 `(("python-pytest" ,python-pytest)
1984 ("python-pytest-runner" ,python-pytest-runner)
1985 ("python-tox" ,python-tox)))
1987 `(("python-astroid" ,python-astroid)
1988 ("python-isort" ,python-isort)
1989 ("python-mccabe" ,python-mccabe)
1990 ("python-six" ,python-six)
1991 ("python-toml" ,python-toml)))
1992 (home-page "https://github.com/PyCQA/pylint")
1993 (synopsis "Python source code analyzer which looks for coding standard
1995 (description "Pylint is a Python source code analyzer which looks
1996 for programming errors, helps enforcing a coding standard and sniffs
1997 for some code smells (as defined in Martin Fowler's Refactoring book).
1999 Pylint has many rules enabled by default, way too much to silence them
2000 all on a minimally sized program. It's highly configurable and handle
2001 pragmas to control it from within your code. Additionally, it is
2002 possible to write plugins to add your own checks.")
2003 (properties `((python2-variant . ,(delay python2-pylint))))
2004 (license license:gpl2+)))
2006 ;; Python2 is not supported anymore by Pylint. See:
2007 ;; https://github.com/PyCQA/pylint/issues/1763.
2008 (define-public python2-pylint
2009 (let ((pylint (package-with-python2
2010 (strip-python2-variant python-pylint))))
2011 (package (inherit pylint)
2017 (url "https://github.com/PyCQA/pylint")
2018 (commit (string-append "pylint-" version))))
2019 (file-name (git-file-name (package-name pylint) version))
2022 "02a89d8a47s7nfiv1ady3j0sg2sbyja3np145brarfp5x9qxz9x2"))))
2024 `(,@(strip-keyword-arguments '(#:tests?) (package-arguments pylint))
2026 (modify-phases %standard-phases
2029 ;; Somehow, tests fail if run from the build directory.
2030 (let ((work "/tmp/work"))
2032 (setenv "PYTHONPATH"
2033 (string-append (getenv "PYTHONPATH") ":" work))
2034 (copy-recursively "." work)
2035 (with-directory-excursion "/tmp"
2036 (invoke "python" "-m" "unittest" "discover"
2037 "-s" (string-append work "/pylint/test")
2038 "-p" "*test_*.py"))))))))
2040 `(("python2-futures" ,python2-futures)
2041 ,@(package-native-inputs pylint)))
2043 `(("python2-backports-functools-lru-cache"
2044 ,python2-backports-functools-lru-cache)
2045 ("python2-configparser" ,python2-configparser)
2046 ,@(package-propagated-inputs pylint))))))
2048 (define-public python-paramunittest
2050 (name "python-paramunittest")
2055 (uri (pypi-uri "ParamUnittest" version))
2058 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
2059 (build-system python-build-system)
2061 "https://github.com/rik0/ParamUnittest")
2063 "Simple extension to have parametrized unit tests")
2065 "This package creates parameterized unit-tests that work with the standard
2066 unittest package. A parameterized test case is automatically converted to multiple test
2067 cases. Since they are TestCase subclasses, they work with other test suites that
2068 recognize TestCases.")
2069 (license license:bsd-2)))
2071 (define-public python2-python-paramunittest
2072 (package-with-python2 python-paramunittest))
2074 (define-public python-pytest-warnings
2076 (name "python-pytest-warnings")
2081 (uri (pypi-uri "pytest-warnings" version))
2084 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
2085 (build-system python-build-system)
2087 `(("pytest" ,python-pytest)))
2088 (home-page "https://github.com/fschulze/pytest-warnings")
2089 (synopsis "Pytest plugin to list Python warnings in pytest report")
2091 "Python-pytest-warnings is a pytest plugin to list Python warnings in
2093 (license license:expat)
2094 (properties `((python2-variant . ,(delay python2-pytest-warnings))
2095 ;; This package is part of pytest as of version 3.1.0.
2096 (superseded . ,python-pytest)))))
2098 (define-public python2-pytest-warnings
2099 (package (inherit (package-with-python2
2100 (strip-python2-variant python-pytest-warnings)))
2101 (properties `((superseded . ,python2-pytest)))))
2103 (define-public python-pytest-capturelog
2105 (name "python-pytest-capturelog")
2110 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
2113 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
2114 (build-system python-build-system)
2116 `(("pytest" ,python-pytest)))
2117 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
2118 (synopsis "Pytest plugin to catch log messages")
2120 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
2121 (license license:expat)))
2123 (define-public python2-pytest-capturelog
2124 (package-with-python2 python-pytest-capturelog))
2126 (define-public python-pytest-catchlog
2128 (name "python-pytest-catchlog")
2133 (uri (pypi-uri "pytest-catchlog" version ".zip"))
2136 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
2137 (build-system python-build-system)
2139 `(("unzip" ,unzip)))
2141 `(("pytest" ,python-pytest)))
2142 (home-page "https://github.com/eisensheng/pytest-catchlog")
2143 (synopsis "Pytest plugin to catch log messages")
2145 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
2146 a fork of pytest-capturelog.")
2147 (license license:expat)))
2149 (define-public python2-pytest-catchlog
2150 (package-with-python2 python-pytest-catchlog))
2152 (define-public python-nosexcover
2154 (name "python-nosexcover")
2158 (uri (pypi-uri "nosexcover" version))
2161 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
2162 (build-system python-build-system)
2164 `(("python-coverage" ,python-coverage)
2165 ("python-nose" ,python-nose)))
2166 (home-page "http://github.com/cmheisel/nose-xcover")
2167 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
2168 (description "Nose-xcover is a companion to the built-in
2169 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
2170 to a file named coverage.xml.
2172 It will honor all the options you pass to the Nose coverage plugin,
2173 especially -cover-package.")
2174 (license license:expat)))
2176 (define-public python2-nosexcover
2177 (package-with-python2 python-nosexcover))
2179 (define-public python-discover
2181 (name "python-discover")
2186 (uri (pypi-uri "discover" version))
2189 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
2190 (build-system python-build-system)
2191 (home-page "https://pypi.org/project/discover/")
2193 "Python test discovery for unittest")
2195 "Discover provides test discovery for unittest, a feature that has been
2196 backported from Python 2.7 for Python 2.4+.")
2197 (license license:bsd-3)))
2199 (define-public python2-discover
2200 (package-with-python2 python-discover))
2202 (define-public behave
2208 (uri (pypi-uri "behave" version))
2211 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))
2212 (patches (search-patches
2213 "behave-skip-a-couple-of-tests.patch"))))
2214 (build-system python-build-system)
2216 `(("python-mock" ,python-mock)
2217 ("python-nose" ,python-nose)
2218 ("python-pathpy" ,python-pathpy)
2219 ("python-pyhamcrest" ,python-pyhamcrest)
2220 ("python-pytest" ,python-pytest)))
2222 `(("python-importlib-metadata" ,python-importlib-metadata)
2223 ("python-six" ,python-six)
2224 ("python-parse" ,python-parse)
2225 ("python-parse-type" ,python-parse-type)))
2227 '(#:test-target "behave_test"
2229 (modify-phases %standard-phases
2230 (add-before 'check 'fix-library-loading
2232 ;; Otherwise, tests fail with no module named 'path'
2233 (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH") ":"
2234 (getcwd) "/tasks/_vendor"))
2236 (home-page "https://github.com/behave/behave")
2237 (synopsis "Python behavior-driven development")
2239 "Behave is a tool for behavior-driven development in python.
2240 Behavior-driven development (or BDD) is an agile software development
2241 technique that encourages collaboration between developers, QA and
2242 non-technical or business participants in a software project. Behave uses
2243 tests written in a natural language style, backed up by Python code.")
2244 (license license:x11)))
2246 (define-public python-behave-web-api
2248 (name "python-behave-web-api")
2253 (uri (pypi-uri "behave-web-api" version))
2256 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
2257 (build-system python-build-system)
2260 (modify-phases %standard-phases
2261 (add-after 'unpack 'fix-dependencies
2263 (substitute* "setup.py"
2264 (("'wheel'") "") ; We don't use it.
2265 (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
2268 `(("behave" ,behave)
2269 ("python-requests" ,python-requests)))
2270 (home-page "https://github.com/jefersondaniel/behave-web-api")
2271 (synopsis "Provides testing for JSON APIs with Behave for Python")
2272 (description "This package provides testing utility modules for testing
2273 JSON APIs with Behave.")
2274 (license license:expat)))
2276 (define-public python2-behave-web-api
2277 (package-with-python2 python-behave-web-api))
2279 (define-public python-rednose
2281 (name "python-rednose")
2286 (uri (pypi-uri "rednose" version))
2289 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
2290 (build-system python-build-system)
2292 `(#:phases (modify-phases %standard-phases
2293 (add-after 'unpack 'patch-setup.py
2295 ;; Six is only required for tests and later versions
2297 (substitute* "setup.py"
2298 (("six==1.10.0") "six"))
2301 `(("python-colorama" ,python-colorama)
2302 ("python-termstyle" ,python-termstyle)))
2304 `(("python-six" ,python-six)
2305 ("python-nose" ,python-nose)))
2306 (home-page "https://github.com/JBKahn/rednose")
2307 (synopsis "Colored output for Python nosetests")
2308 (description "This package provides colored output for the
2309 @command{nosetests} command of the Python Nose unit test framework.")
2310 (license license:bsd-3)))
2312 (define-public python2-rednose
2313 (package-with-python2 python-rednose))
2315 (define-public python-nose-random
2317 (name "python-nose-random")
2323 (url "https://github.com/fzumstein/nose-random")
2325 (file-name (git-file-name name version))
2328 "1dvip61r2frjv35mv6mmfjc07402z73pjbndfp3mhxyjn2zhksw2"))))
2329 (build-system python-build-system)
2331 `(("python-nose" ,python-nose)))
2332 (home-page "https://github.com/fzumstein/nose-random")
2333 (synopsis "Nose plugin to facilitate randomized unit testing with
2335 (description "Python nose-random is designed to facilitate
2336 Monte-Carlo style unit testing. The idea is to improve testing by
2337 running your code against a large number of randomly generated input
2339 (license license:expat)))
2341 (define-public python-nose-randomly
2343 (name "python-nose-randomly")
2348 (uri (pypi-uri "nose-randomly" version))
2350 (base32 "0z662rqhfk4bjmg806mn4frb8nz4gbh7mrddsrhfffp1g4yklj3y"))))
2351 (build-system python-build-system)
2353 `(("python-nose" ,python-nose)
2354 ("python-numpy" ,python-numpy)))
2355 (home-page "https://github.com/adamchainz/nose-randomly")
2357 "Nose plugin to randomly order tests and control random.seed")
2359 "This is a @code{Nose} plugin to randomly order tests which can be quite
2360 powerful in discovering hidden flaws in the tests themselves, while helping to
2361 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
2362 by resetting it to a repeatable number for each test, enabling the tests to
2363 create data based on random numbers and yet remain repeatable.")
2364 (license license:bsd-3)))
2366 (define-public python2-nose-randomly
2367 (package-with-python2 python-nose-randomly))
2369 (define-public python-nose-timer
2371 (name "python-nose-timer")
2376 (uri (pypi-uri "nose-timer" version))
2378 (base32 "05wzkc88vbzw62pqkvhl33211b90kns0lny70b7qw62rcg4flzk4"))))
2379 (build-system python-build-system)
2381 `(("python-nose" ,python-nose)
2382 ("python-termcolor" ,python-termcolor)))
2383 (home-page "https://github.com/mahmoudimus/nose-timer")
2384 (synopsis "Timer plugin for nosetests")
2385 (description "Shows how much time was needed to run individual tests.")
2386 (license license:expat)))
2388 (define-public python2-nose-timer
2389 (package-with-python2 python-nose-timer))
2391 (define-public python-freezegun
2393 (name "python-freezegun")
2398 (uri (pypi-uri "freezegun" version))
2400 (base32 "0al75mk829j1izxi760b7yjnknjihyfhp2mvi5qiyrxb9cpxwqk2"))))
2401 (build-system python-build-system)
2403 `(("python-mock" ,python-mock)
2404 ("python-pytest" ,python-pytest)))
2406 `(("python-six" ,python-six)
2407 ("python-dateutil" ,python-dateutil)))
2410 (modify-phases %standard-phases
2411 ;; The tests are normally executed via `make test`, but the PyPi
2412 ;; package does not include the Makefile.
2415 (invoke "pytest" "-vv"))))))
2416 (home-page "https://github.com/spulec/freezegun")
2417 (synopsis "Test utility for mocking the datetime module")
2419 "FreezeGun is a library that allows your python tests to travel through
2420 time by mocking the datetime module.")
2421 (license license:asl2.0)))
2423 (define-public python2-freezegun
2424 (package-with-python2 python-freezegun))
2426 (define-public python-flexmock
2428 (name "python-flexmock")
2432 (uri (pypi-uri "flexmock" version))
2435 "0b6qw3grhgx58kxlkj7mdma7xdvlj02zabvcf7w2qifnfjwwwcsh"))))
2436 (build-system python-build-system)
2437 (home-page "https://flexmock.readthedocs.org")
2438 (synopsis "Testing library for Python")
2440 "flexmock is a testing library for Python that makes it easy to create
2441 mocks, stubs and fakes.")
2442 (license license:bsd-3)))
2444 (define-public python2-flexmock
2445 (package-with-python2 python-flexmock))
2447 (define-public python-flaky
2449 (name "python-flaky")
2453 (uri (pypi-uri "flaky" version))
2456 "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j"))))
2457 (build-system python-build-system)
2459 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2461 (home-page "https://github.com/box/flaky")
2462 (synopsis "Automatically rerun flaky tests")
2464 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2467 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2468 on components that aren't 100% reliable. With flaky, instead of removing
2469 those tests or marking them to @code{@@skip}, they can be automatically
2471 (license license:asl2.0)))
2473 (define-public python2-flaky
2474 (package-with-python2 python-flaky))
2476 (define-public python-pyhamcrest
2477 ;; The latest release was in 2016 and its test suite does not work with recent
2478 ;; versions of Pytest. Just take the master branch for now, which seems stable.
2479 (let ((commit "25fdc5f00bdf3084335353bc9247253098ec4cf2")
2482 (name "python-pyhamcrest")
2483 (version (git-version "1.9.0" revision commit))
2485 ;; Tests not distributed from pypi release.
2488 (url "https://github.com/hamcrest/PyHamcrest")
2490 (file-name (git-file-name name version))
2493 "1miqmhhi68vaix8sqc1lvpvbm27bacffxh5anm5cbfsvk7g9n6f3"))))
2494 (native-inputs ;all native inputs are for tests
2495 `(("python-pytest-cov" ,python-pytest-cov)
2496 ("python-mock" ,python-mock)
2497 ("python-pytest" ,python-pytest)
2498 ("python-hypothesis" ,python-hypothesis)))
2500 `(("python-six" ,python-six)))
2501 (build-system python-build-system)
2503 `(#:phases (modify-phases %standard-phases
2506 (setenv "PYTHONPATH"
2507 (string-append "build/lib:"
2508 (getenv "PYTHONPATH")))
2509 (invoke "pytest" "-vv"))))))
2510 (home-page "http://hamcrest.org/")
2511 (synopsis "Hamcrest matchers for Python")
2513 "PyHamcrest is a framework for writing matcher objects,
2514 allowing you to declaratively define \"match\" rules.")
2515 (license license:bsd-3))))
2517 (define-public python2-pyhamcrest
2518 (package-with-python2 python-pyhamcrest))
2520 (define-public unittest-cpp
2522 (name "unittest-cpp")
2527 (url "https://github.com/unittest-cpp/unittest-cpp")
2528 (commit (string-append "v" version))))
2529 (file-name (git-file-name name version))
2531 (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
2533 `(#:tests? #f)) ; It's run after build automatically.
2534 (build-system cmake-build-system)
2535 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2536 (synopsis "Lightweight unit testing framework for C++")
2537 (description "UnitTest++ is a lightweight unit testing framework for C++.
2538 It was designed to do test-driven development on a wide variety of platforms.
2539 Simplicity, portability, speed, and small footprint are all very important
2540 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2541 of advanced library and language features, which means it should be easily
2542 portable to just about any platform.")
2543 (license license:expat)))
2545 (define-public libfaketime
2547 (name "libfaketime")
2549 (home-page "https://github.com/wolfcw/libfaketime")
2554 (commit (string-append "v" version))))
2557 "1mfdl82ppgbdvy1ny8mb7xii7p0g7awvn4bn36jb8v4r545slmjc"))
2558 (file-name (git-file-name name version))))
2559 (build-system gnu-build-system)
2561 '(#:phases (modify-phases %standard-phases
2563 (lambda* (#:key outputs #:allow-other-keys)
2564 (let ((out (assoc-ref outputs "out")))
2566 (setenv "PREFIX" out)
2568 ;; XXX: Without this flag, the CLOCK_REALTIME test hangs
2569 ;; indefinitely. See README.packagers for more information.
2570 ;; Try removing this for future versions of libfaketime.
2571 (setenv "FAKETIME_COMPILE_CFLAGS" "-DFORCE_MONOTONIC_FIX")
2574 (add-before 'check 'pre-check
2576 (substitute* "test/functests/test_exclude_mono.sh"
2577 (("/bin/bash") (which "bash")))
2579 ;; Do not fail due to use of 'ftime', which was deprecated in
2580 ;; glibc 2.31. Remove this for later versions of libfaketime.
2581 (setenv "FAKETIME_COMPILE_CFLAGS" "-Wno-deprecated-declarations")
2583 #:test-target "test"))
2585 `(("perl" ,perl))) ;for tests
2586 (synopsis "Fake the system time for single applications")
2588 "The libfaketime library allows users to modify the system time that an
2589 application \"sees\". It is meant to be loaded using the dynamic linker's
2590 @code{LD_PRELOAD} environment variable. The @command{faketime} command
2591 provides a simple way to achieve this.")
2592 (license license:gpl2)))
2594 (define-public umockdev
2600 (uri (string-append "https://github.com/martinpitt/umockdev/"
2601 "releases/download/" version "/"
2602 "umockdev-" version ".tar.xz"))
2605 "1g78jcrvb7yyh0q5kv5409wjqf8nlfqnw1rknm3a247mcx317dpz"))))
2606 (build-system gnu-build-system)
2609 (modify-phases %standard-phases
2610 (add-after 'unpack 'fix-test
2612 (substitute* "tests/test-umockdev.c"
2617 ("gobject-introspection" ,gobject-introspection)
2618 ("gtk-doc" ,gtk-doc)
2619 ("pkg-config" ,pkg-config)
2627 ("libgudev" ,libgudev)))
2628 (home-page "https://github.com/martinpitt/umockdev/")
2629 (synopsis "Mock hardware devices for creating unit tests")
2630 (description "umockdev mocks hardware devices for creating integration
2631 tests for hardware related libraries and programs. It also provides tools to
2632 record the properties and behaviour of particular devices, and to run a
2633 program or test suite under a test bed with the previously recorded devices
2635 (license license:lgpl2.1+)))
2637 (define-public virtest
2638 ;; No releases yet, so we take the commit that "vc" expects.
2639 (let ((commit "f7d03ef39fceba168745bd29e1b20af6e7971e04")
2643 (version (git-version "0.0" revision commit))
2644 (home-page "https://github.com/mattkretz/virtest")
2647 (uri (git-reference (url home-page) (commit commit)))
2648 (file-name (git-file-name name version))
2651 "07pjyb0mk7y2w1dg1bhl26nb7416xa1mw16ifj6mmps5y6aq054l"))))
2652 (build-system cmake-build-system)
2654 `(#:phases (modify-phases %standard-phases
2655 (add-after 'unpack 'adjust-install-directory
2657 ;; Vc is the only consumer of this library, and expects
2658 ;; to find it in "virtest/vir/" instead of "vir/vir/".
2659 (substitute* "CMakeLists.txt"
2660 (("DESTINATION include/vir")
2661 "DESTINATION include/virtest"))
2663 (synopsis "Header-only test framework")
2665 "@code{virtest} is a small header-only test framework for C++. It
2666 grew out of the @dfn{Vc} project.")
2667 (license license:bsd-3))))
2669 (define-public python-pyfakefs
2671 (name "python-pyfakefs")
2675 ;; We use the PyPI URL because there is no proper release
2676 ;; available from GitHub. The GitHub project only provides
2677 ;; autogenerated tarballs, which are known to change in place.
2678 (uri (pypi-uri "pyfakefs" version))
2681 "1cp2yw96fa2qkgi39xa3nlr3inf8wb5rgh9kdq53256ca2r8pdhy"))
2682 (patches (search-patches
2683 "python-pyfakefs-remove-bad-test.patch"))
2684 (file-name (string-append name "-" version ".tar.gz"))))
2687 (modify-phases %standard-phases
2688 ;; The default test suite does not run these extra tests.
2689 (add-after 'check 'check-pytest-plugin
2692 "python" "-m" "pytest"
2693 "pyfakefs/pytest_tests/pytest_plugin_test.py")
2696 `(("python-pytest" ,python-pytest)))
2697 (build-system python-build-system)
2698 ;; Guix lint doesn't like that this is a permanent redirect to the GitHub
2699 ;; page, but the pyfakefs documentation asks us to use this specific URL
2700 ;; when linking to the project. Honor their request.
2701 (home-page "http://pyfakefs.org/")
2702 ;; TRANSLATORS: In the synopsis, "Mock" is a verb.
2703 (synopsis "Mock file system interactions in tests")
2705 "This package provides a Python library intended for use in automated
2706 tests. One difficulty when testing software is that the code under test might
2707 need to read or write to files in the local file system. If the file system
2708 is not set up in just the right way, it might cause a spurious error during
2709 the test. The pyfakefs library provides a solution to problems like this by
2710 mocking file system interactions. In other words, it arranges for the code
2711 under test to interact with a fake file system instead of the real file
2712 system. The code under test requires no modification to work with pyfakefs.")
2713 (license license:asl2.0)))
2715 (define-public python2-pyfakefs
2716 (package-with-python2 python-pyfakefs))
2718 ;; This minimal variant is used to avoid a circular dependency between
2719 ;; python2-importlib-metadata, which requires pyfakefs for its tests, and
2720 ;; python2-pytest, which requires python2-importlib-metadata.
2721 (define-public python2-pyfakefs-bootstrap
2724 (inherit python2-pyfakefs)
2725 (name "python2-pyfakefs-bootstrap")
2728 `(#:python ,python-2
2731 (define-public python-aiounittest
2733 (name "python-aiounittest")
2738 (uri (pypi-uri "aiounittest" version))
2741 "1q4bhmi80smaa1lknvdna0sx3915naczlfna1fp435nf6cjyrjl1"))))
2742 (build-system python-build-system)
2744 `(("python-coverage" ,python-coverage)
2745 ("python-nose" ,python-nose)))
2747 "https://github.com/kwarunek/aiounittest")
2748 (synopsis "Test asyncio code more easily")
2749 (description "Aiounittest is a library that helps write tests using
2750 asynchronous code in Python (asyncio).")
2751 (license license:expat)))