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 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 Mathieu Othacehe <m.othacehe@gmail.com>
25 ;;; Copyright © 2017, 2019 Kei Kebreau <kkebreau@posteo.net>
26 ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
27 ;;; Copyright © 2015, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
28 ;;; Copyright © 2016, 2017, 2018 Marius Bakke <mbakke@fastmail.com>
29 ;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
30 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
32 ;;; This file is part of GNU Guix.
34 ;;; GNU Guix is free software; you can redistribute it and/or modify it
35 ;;; under the terms of the GNU General Public License as published by
36 ;;; the Free Software Foundation; either version 3 of the License, or (at
37 ;;; your option) any later version.
39 ;;; GNU Guix is distributed in the hope that it will be useful, but
40 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
41 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42 ;;; GNU General Public License for more details.
44 ;;; You should have received a copy of the GNU General Public License
45 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
47 (define-module (gnu packages check)
48 #:use-module (gnu packages)
49 #:use-module (gnu packages autotools)
50 #:use-module (gnu packages base)
51 #:use-module (gnu packages bash)
52 #:use-module (gnu packages compression)
53 #:use-module (gnu packages linux)
54 #:use-module (gnu packages llvm)
55 #:use-module (gnu packages glib)
56 #:use-module (gnu packages gnome)
57 #:use-module (gnu packages golang)
58 #:use-module (gnu packages gtk)
59 #:use-module (gnu packages perl)
60 #:use-module (gnu packages pkg-config)
61 #:use-module (gnu packages python)
62 #:use-module (gnu packages python-web)
63 #:use-module (gnu packages python-xyz)
64 #:use-module (gnu packages time)
65 #:use-module (guix utils)
66 #:use-module ((guix licenses) #:prefix license:)
67 #:use-module (guix packages)
68 #:use-module (guix download)
69 #:use-module (guix git-download)
70 #:use-module (guix build-system cmake)
71 #:use-module (guix build-system gnu)
72 #:use-module (guix build-system go)
73 #:use-module (guix build-system python)
74 #:use-module (guix build-system trivial))
83 (uri (string-append "https://github.com/libcheck/check/releases/download/"
84 version "/check-" version ".tar.gz"))
87 "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6"))))
88 (build-system gnu-build-system)
89 (home-page "https://libcheck.github.io/check/")
90 (synopsis "Unit test framework for C")
92 "Check is a unit testing framework for C. It features a simple
93 interface for defining unit tests, putting little in the way of the
94 developer. Tests are run in a separate address space, so Check can
95 catch both assertion failures and code errors that cause segmentation
96 faults or other signals. The output from unit tests can be used within
97 source code editors and IDEs.")
98 (license license:lgpl2.1+)))
107 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
108 version "/CUnit-" version ".tar.bz2"))
111 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
112 (build-system gnu-build-system)
113 (arguments '(#:phases
114 (modify-phases %standard-phases
115 ;; XXX: The "bootstrap" phase detects the "bootstrap"
116 ;; script, but fails to execute it, so we bootstrap
119 (lambda _ (invoke "autoreconf" "-vfi"))))))
121 `(("automake" ,automake)
122 ("autoconf" ,autoconf)
123 ("libtool" ,libtool)))
124 (home-page "http://cunit.sourceforge.net/")
125 (synopsis "Automated testing framework for C")
127 "CUnit is a lightweight system for writing, administering, and running
128 unit tests in C. It provides C programmers with basic testing functionality
129 with a flexible variety of user interfaces.")
130 (license license:gpl2+)))
132 (define-public cppunit
138 (uri (string-append "http://dev-www.libreoffice.org/src/"
139 name "-" version ".tar.gz"))
142 "1027cyfx5gsjkdkaf6c2wnjh68882grw8n672018cj3vs9lrhmix"))))
143 ;; Explicitly link with libdl. This is expected to be done by packages
144 ;; relying on cppunit for their tests. However, not all of them do.
145 ;; If we added the linker flag to such packages, we would pollute all
146 ;; binaries, not only those used for testing.
148 `(#:make-flags '("LDFLAGS=-ldl")))
149 (build-system gnu-build-system)
150 (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
151 (synopsis "Unit testing framework for C++")
152 (description "CppUnit is the C++ port of the famous JUnit framework for
153 unit testing. Test output is in XML for automatic testing and GUI based for
155 (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
157 ;; When dependent packages upgraded to use newer version of catch, this one should
159 (define-public catch-framework
162 (version "1.3.5") ;Sub-minor is the build number
166 (url "https://github.com/philsquared/Catch")
168 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
169 (file-name (string-append name "-" version))
172 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
173 (build-system trivial-build-system)
175 `(#:modules ((guix build utils))
177 (use-modules (guix build utils))
178 (let* ((source (assoc-ref %build-inputs "source"))
179 (output (assoc-ref %outputs "out"))
180 (incdir (string-append output "/include"))
181 (docdir (string-append output "/share/doc/catch-"
183 (for-each mkdir-p (list incdir docdir))
184 (install-file (string-append source
185 "/single_include/catch.hpp")
187 (copy-recursively (string-append source "/docs")
190 (home-page "http://catch-lib.net/")
191 (synopsis "Automated test framework for C++ and Objective-C")
193 "Catch stands for C++ Automated Test Cases in Headers and is a
194 multi-paradigm automated test framework for C++ and Objective-C.")
195 (license license:boost1.0)))
197 (define-public catch-framework2
201 (home-page "https://github.com/catchorg/Catch2")
205 (url "https://github.com/catchorg/Catch2")
206 (commit (string-append "v" version))))
207 (file-name (git-file-name name version))
210 "1gdp5wm8khn02g2miz381llw3191k7309qj8s3jd6sasj01rhf23"))))
211 (build-system cmake-build-system)
212 (synopsis "Automated test framework for C++ and Objective-C")
213 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
214 a multi-paradigm automated test framework for C++ and Objective-C.")
215 (license license:boost1.0)))
217 (define-public cmdtest
223 (uri (string-append "http://git.liw.fi/cmdtest/snapshot/"
224 name "-" version ".tar.gz"))
227 "1jmfiyrrqmpvwdb273bkb8hjaf4rwx9njblx29pmr7giyahskwi5"))))
228 (build-system python-build-system)
232 (modify-phases %standard-phases
233 ;; check phase needs to be run before the build phase. If not, the
234 ;; coverage test runner looks for tests for the built source files,
237 (add-before 'build 'check
240 (("/bin/sh") (which "sh")))
241 ;; yarn uses python2-ttystatus to print messages.
242 ;; python2-ttystatus requires /dev/tty which is not present in
243 ;; the build environment. Hence assuming-failure test fails.
244 (delete-file "yarn.tests/assuming-failure.script")
245 (delete-file "yarn.tests/assuming-failure.stdout")
246 (invoke "python" "setup.py" "check"))))))
248 `(("python2-coverage-test-runner" ,python2-coverage-test-runner)))
250 `(("python2-cliapp" ,python2-cliapp)
251 ("python2-markdown" ,python2-markdown)
252 ("python2-ttystatus" ,python2-ttystatus)))
253 (home-page "https://liw.fi/cmdtest/")
254 (synopsis "Black box Unix program tester")
256 "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
257 given a command line and input files, and the expected output, and it verifies
258 that the command line produces the expected output. If not, it reports a
259 problem, and shows the differences.")
260 (license license:gpl3+)))
262 (define-public cmocka
268 (uri (string-append "https://cmocka.org/files/"
269 (version-major+minor version) "/cmocka-"
273 "1bxzzafjlwzgldcb07hjnlnqvh88wh21r2kw7z8f704w5bvvrsj3"))))
274 (build-system cmake-build-system)
276 `(#:tests? #f)) ; no test target
277 (home-page "https://cmocka.org/")
278 (synopsis "Unit testing framework for C")
279 (description "Cmocka is a unit testing framework for C with support for
280 mock objects. It only requires the standard C library, and works with
281 different compilers. Cmocka supports several different message output formats
282 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
284 (license license:asl2.0)))
286 (define-public cppcheck
293 (url "https://github.com/danmar/cppcheck")
295 (file-name (git-file-name name version))
297 (base32 "1xiy54rz99nzbpwj35jiyssd2nc6k5k0lw5ml6nh2qnmbfkl8swl"))))
298 (build-system cmake-build-system)
300 '(#:configure-flags '("-DBUILD_TESTS=ON")))
301 (home-page "http://cppcheck.sourceforge.net")
302 (synopsis "Static C/C++ code analyzer")
303 (description "Cppcheck is a static code analyzer for C and C++. Unlike
304 C/C++ compilers and many other analysis tools it does not detect syntax errors
305 in the code. Cppcheck primarily detects the types of bugs that the compilers
306 normally do not detect. The goal is to detect only real errors in the code
307 (i.e. have zero false positives).")
308 (license license:gpl3+)))
310 (define-public cxxtest
316 (uri (string-append "mirror://sourceforge/cxxtest/cxxtest/"
317 version "/cxxtest-" version ".tar.gz"))
320 "1n7pbj4z9ivx005hqvivj9ddhq8awynzg6jishfbypf6j7ply58w"))))
321 (build-system python-build-system)
324 (modify-phases %standard-phases
325 (add-after 'unpack 'chdir-to-source
329 (add-after 'install 'install-headers
330 (lambda* (#:key outputs #:allow-other-keys)
331 (let* ((out (assoc-ref outputs "out"))
332 (include-dir (string-append out "/include/cxxtest")))
333 (for-each (lambda (header-file)
334 (install-file header-file include-dir))
335 (find-files "../cxxtest"))
337 (add-after 'install 'install-doc
338 (lambda* (#:key outputs #:allow-other-keys)
339 (let* ((out (assoc-ref outputs "out"))
340 (doc-dir (string-append out "/share/doc/cxxtest")))
341 (install-file "../README" doc-dir)
342 (install-file "../doc/guide.txt" doc-dir)
343 (copy-recursively "../sample" (string-append doc-dir "/sample"))
346 `(("python-ply" ,python-ply)))
347 (home-page "https://cxxtest.com/")
348 (synopsis "Unit testing framework for C++")
349 (description "CxxTest is a unit testing framework for C++ that is similar
350 in spirit to JUnit, CppUnit, and xUnit. CxxTest does not require precompiling
351 a CxxTest testing library, it employs no advanced features of C++ (e.g. RTTI)
352 and it supports a very flexible form of test discovery.")
353 (license license:lgpl3+)))
355 (define-public go-gopkg.in-check.v1
356 (let ((commit "20d25e2804050c1cd24a7eea1e7a6447dd0e74ec")
359 (name "go-gopkg.in-check.v1")
360 (version (git-version "0.0.0" revision commit))
364 (url "https://github.com/go-check/check.git")
366 (file-name (git-file-name name version))
369 "0k1m83ji9l1a7ng8a7v40psbymxasmssbrrhpdv2wl4rhs0nc3np"))))
370 (build-system go-build-system)
372 '(#:import-path "gopkg.in/check.v1"))
373 (synopsis "Rich testing extension for Go's testing package")
375 "@code{check} is a rich testing extension for Go's testing package.")
376 (home-page "https://github.com/go-check/check")
377 (license license:bsd-2))))
379 (define-public go-github.com-smartystreets-gunit
381 (name "go-github.com-smartystreets-gunit")
386 (url "https://github.com/smartystreets/gunit")
388 (file-name (git-file-name name version))
391 "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
392 (build-system go-build-system)
394 '(;; TODO: This package depends on go-github.com-smartystreets-assertions
395 ;; for running the tests, but go-github.com-smartystreets-assertions
396 ;; depends on this package, so break this loop by not running the tests
399 #:import-path "github.com/smartystreets/gunit"))
400 (synopsis "Testing tool for Go, in the style of xUnit")
402 "@code{gunit} allows the test author to use a struct as the scope for a
403 group of related test cases, in the style of xUnit fixtures. This makes
404 extraction of setup/teardown behavior (as well as invoking the system under
405 test) much simpler.")
406 (home-page "https://github.com/smartystreets/gunit")
407 (license license:expat)))
409 (define-public go-github.com-smartystreets-assertions
411 (name "go-github.com-smartystreets-assertions")
416 (url "https://github.com/smartystreets/assertions")
418 (file-name (git-file-name name version))
421 "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
422 (build-system go-build-system)
424 '(#:import-path "github.com/smartystreets/assertions"))
426 `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
427 (synopsis "Assertions for testing with Go")
429 "The @code{assertions} package provides convinient assertion functions
430 for writing tests in Go.")
431 (home-page "https://github.com/smartystreets/assertions")
432 (license license:expat)))
434 (define-public go-github.com-smartystreets-goconvey
436 (name "go-github.com-smartystreets-goconvey")
441 (url "https://github.com/smartystreets/goconvey")
443 (file-name (git-file-name name version))
446 "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
447 (build-system go-build-system)
449 '(#:import-path "github.com/smartystreets/goconvey"))
451 `(("go-github.com-jtolds-gls" ,go-github.com-jtolds-gls)
452 ("go-github.com-smartystreets-assertions" ,go-github.com-smartystreets-assertions)))
453 (synopsis "Go testing tool with both a web and terminal user interface")
455 "GoConvey is a testing tool for Go. It integrates with go test, can show
456 test coverage and has a web user interface that will refresh automatically.")
457 (home-page "https://github.com/smartystreets/goconvey")
458 (license license:expat)))
460 ;; XXX When updating, check whether ZNC's GOOGLETEST-SOURCES can be
461 ;; switched back to simply using (PACKAGE-SOURCE ...).
462 (define-public googletest
469 (uri (string-append "https://github.com/google/googletest/archive/"
470 "release-" version ".tar.gz"))
471 (file-name (string-append name "-" version ".tar.gz"))
474 "1n5p1m2m3fjrjdj752lf92f9wq3pl5cbsfrb49jqbg52ghkz99jq"))))
475 (build-system cmake-build-system)
477 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
479 `(("python-2" ,python-2)))
480 (home-page "https://github.com/google/googletest/")
481 (synopsis "Test discovery and XUnit test framework")
482 (description "Google Test features an XUnit test framework, automated test
483 discovery, death tests, assertions, parameterized tests and XML test report
485 (license license:bsd-3)))
487 (define-public cpputest
494 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
495 version "/cpputest-" version ".tar.gz"))
498 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
499 (build-system gnu-build-system)
501 `(("googletest" ,googletest)))
502 (home-page "https://cpputest.github.io/")
503 (synopsis "Unit testing and mocking framework for C/C++")
505 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
506 C++ but is used in C and C++ projects and frequently used in embedded systems
507 but it works for any C/C++ project.")
508 (license license:bsd-3)))
510 (define-public python-parameterized
512 (name "python-parameterized")
517 (uri (pypi-uri "parameterized" version))
520 "1qj1939shm48d9ql6fm1nrdy4p7sdyj8clz1szh5swwpf1qqxxfa"))))
521 (build-system python-build-system)
522 (arguments '(#:tests? #f)) ; there are no tests
523 (home-page "https://github.com/wolever/parameterized")
524 (synopsis "Parameterized testing with any Python test framework")
526 "Parameterized is a Python library that aims to fix parameterized testing
527 for every Python test framework. It supports nose, py.test, and unittest.")
528 (license license:bsd-2)))
530 (define-public python2-parameterized
531 (package-with-python2 python-parameterized))
533 (define-public python-mock
540 (uri (pypi-uri "mock" version))
543 "1flbpksir5sqrvq2z0dp8sl4bzbadg21sj4d42w3klpdfvgvcn5i"))))
545 `(("python-pbr" ,python-pbr-minimal)
546 ("python-six" ,python-six)))
547 (build-system python-build-system)
549 `(("python-unittest2" ,python-unittest2)))
552 (modify-phases %standard-phases
555 (zero? (system* "unit2")))))))
556 (home-page "https://github.com/testing-cabal/mock")
557 (synopsis "Python mocking and patching library for testing")
559 "Mock is a library for testing in Python. It allows you to replace parts
560 of your system under test with mock objects and make assertions about how they
562 (properties `((python2-variant . ,(delay python2-mock))))
563 (license license:expat)))
565 (define-public python2-mock
566 (let ((base (package-with-python2
567 (strip-python2-variant python-mock))))
568 (package (inherit base)
570 `(("python2-functools32" ,python2-functools32)
571 ("python2-funcsigs" ,python2-funcsigs)
572 ,@(package-propagated-inputs base))))))
574 (define-public python-nose
581 (uri (pypi-uri "nose" version))
584 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
585 (build-system python-build-system)
587 '(#:tests? #f)) ; FIXME: test suite fails
588 (home-page "http://readthedocs.org/docs/nose/")
589 (synopsis "Python testing library")
591 "Nose extends the unittest library to make testing easier.")
592 (license license:lgpl2.0+)))
594 (define-public python2-nose
595 (package-with-python2 python-nose))
597 (define-public python-nose2
599 (name "python-nose2")
604 (uri (pypi-uri "nose2" version))
607 "1x4zjq1zlyrh8b9ba0cmafd3w94pxhid408kibyjd3s6h1lap6s7"))))
608 (build-system python-build-system)
609 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
611 `(("python-cov-core" ,python-cov-core)
612 ("python-pytest-cov" ,python-pytest-cov)
613 ("python-six" ,python-six)))
614 (home-page "https://github.com/nose-devs/nose2")
615 (synopsis "Next generation of nicer testing for Python")
617 "Nose2 is the next generation of nicer testing for Python, based on the
618 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
619 better plugin api, being easier for users to configure, and simplifying internal
620 interfaces and processes.")
621 (license license:bsd-2)))
623 (define-public python2-nose2
624 (package-with-python2 python-nose2))
626 (define-public python-unittest2
628 (name "python-unittest2")
633 (uri (pypi-uri "unittest2" version))
635 (search-patches "python-unittest2-python3-compat.patch"
636 "python-unittest2-remove-argparse.patch"))
639 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
640 (build-system python-build-system)
643 (modify-phases %standard-phases
646 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
648 `(("python-six" ,python-six)
649 ("python-traceback2" ,python-traceback2)))
650 (home-page "http://pypi.python.org/pypi/unittest2")
651 (synopsis "Python unit testing library")
653 "Unittest2 is a replacement for the unittest module in the Python
655 (license license:psfl)))
657 (define-public python2-unittest2
658 (package-with-python2 python-unittest2))
660 (define-public python-pytest
662 (name "python-pytest")
667 (uri (pypi-uri "pytest" version))
670 "17grcfvd6ggvvqmprwv5y8g319nayam70hr43ssjwj40ws27z858"))))
671 (build-system python-build-system)
674 (modify-phases %standard-phases
675 (add-before 'check 'disable-invalid-tests
677 ;; Some tests involves the /usr directory, and fails.
678 (substitute* "testing/test_argcomplete.py"
679 (("def test_remove_dir_prefix\\(self\\):")
680 "@pytest.mark.xfail\n def test_remove_dir_prefix(self):"))
681 (substitute* "testing/test_argcomplete.py"
682 (("def test_remove_dir_prefix" line)
683 (string-append "@pytest.mark.skip"
684 "(reason=\"Assumes that /usr exists.\")\n "
687 (replace 'check (lambda _ (invoke "pytest" "-vv"))))))
689 `(("python-atomicwrites" ,python-atomicwrites)
690 ("python-attrs" ,python-attrs-bootstrap)
691 ("python-more-itertools" ,python-more-itertools)
692 ("python-pluggy" ,python-pluggy)
693 ("python-py" ,python-py)
694 ("python-six" ,python-six-bootstrap)))
696 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
698 ("python-hypothesis" ,python-hypothesis)
699 ("python-nose" ,python-nose)
700 ("python-mock" ,python-mock)
701 ("python-pytest" ,python-pytest-bootstrap)
702 ("python-setuptools-scm" ,python-setuptools-scm)))
703 (home-page "https://docs.pytest.org/en/latest/")
704 (synopsis "Python testing library")
706 "Pytest is a testing tool that provides auto-discovery of test modules
707 and functions, detailed info on failing assert statements, modular fixtures,
708 and many external plugins.")
709 (license license:expat)
710 (properties `((python2-variant . ,(delay python2-pytest))))))
712 (define-public python2-pytest
713 (let ((pytest (package-with-python2
714 (strip-python2-variant python-pytest))))
718 `(("python2-funcsigs" ,python2-funcsigs)
719 ("python2-pathlib2" ,python2-pathlib2)
720 ,@(package-propagated-inputs pytest))))))
722 (define-public python-pytest-bootstrap
724 (inherit (strip-python2-variant python-pytest))
725 (name "python-pytest-bootstrap")
726 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
727 (arguments `(#:tests? #f))
728 (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
730 (define-public python2-pytest-bootstrap
731 (let ((pytest (package-with-python2
732 (strip-python2-variant python-pytest-bootstrap))))
733 (package (inherit pytest)
735 `(("python2-funcsigs" ,python2-funcsigs-bootstrap)
736 ("python2-pathlib2" ,python2-pathlib2-bootstrap)
737 ,@(package-propagated-inputs pytest))))))
739 (define-public python-pytest-cov
741 (name "python-pytest-cov")
746 (uri (pypi-uri "pytest-cov" version))
748 (base32 "0cyxbbghx2l4p60w10k00j1j74q1ngfiffr0pxn73ababjr69dha"))))
749 (build-system python-build-system)
752 (modify-phases %standard-phases
755 ;; Options taken from tox.ini.
756 ;; TODO: make "--restructuredtext" tests pass. They currently fail
757 ;; with "Duplicate implicit target name".
758 (invoke "python" "./setup.py" "check"
759 "--strict" "--metadata"))))))
761 `(("python-coverage" ,python-coverage)
762 ("python-pytest" ,python-pytest)))
763 (home-page "https://github.com/pytest-dev/pytest-cov")
764 (synopsis "Pytest plugin for measuring coverage")
766 "Pytest-cov produces coverage reports. It supports centralised testing and
767 distributed testing in both @code{load} and @code{each} modes. It also
768 supports coverage of subprocesses.")
769 (license license:expat)))
771 (define-public python2-pytest-cov
772 (package-with-python2 python-pytest-cov))
774 (define-public python-pytest-runner
776 (name "python-pytest-runner")
781 (uri (pypi-uri "pytest-runner" version))
784 "1gkpyphawxz38ni1gdq1fmwyqcg02m7ypzqvv46z06crwdxi2gyj"))))
785 (build-system python-build-system)
787 `(("python-pytest" ,python-pytest-bootstrap)
788 ("python-setuptools-scm" ,python-setuptools-scm)))
789 (home-page "https://github.com/pytest-dev/pytest-runner")
790 (synopsis "Invoke py.test as a distutils command")
792 "This package provides a @command{pytest-runner} command that
793 @file{setup.py} files can use to run tests.")
794 (license license:expat)))
796 (define-public python2-pytest-runner
797 (package-with-python2 python-pytest-runner))
799 (define-public python-pytest-mock
801 (name "python-pytest-mock")
806 (uri (pypi-uri "pytest-mock" version))
809 "1i5mg3ff1qk0wqfcxfz60hwy3q5dskdp36i10ckigkzffg8hc3ad"))))
810 (build-system python-build-system)
812 `(("python-setuptools-scm" ,python-setuptools-scm)))
814 `(("python-pytest" ,python-pytest)))
815 (home-page "https://github.com/pytest-dev/pytest-mock/")
816 (synopsis "Thin-wrapper around the mock package for easier use with py.test")
818 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
819 around the patching API provided by the @code{mock} package, but with the
820 benefit of not having to worry about undoing patches at the end of a test.
821 The mocker fixture has the same API as @code{mock.patch}, supporting the
823 (properties `((python2-variant . ,(delay python2-pytest-mock))))
824 (license license:expat)))
826 (define-public python2-pytest-mock
827 (let ((base (package-with-python2
828 (strip-python2-variant python-pytest-mock))))
829 (package (inherit base)
831 `(("python2-mock" ,python2-mock)
832 ,@(package-propagated-inputs base))))))
834 (define-public python-pytest-xdist
836 (name "python-pytest-xdist")
841 (uri (pypi-uri "pytest-xdist" version))
844 "1d812apvcmshh2l8f38spqwb3bpp0x43yy7lyfpxxzc99h4r7y4n"))
845 (modules '((guix build utils)))
848 ;; Remove pre-compiled .pyc files from source.
849 (for-each delete-file-recursively
850 (find-files "." "__pycache__" #:directories? #t))
851 (for-each delete-file (find-files "." "\\.pyc$"))
853 (build-system python-build-system)
855 '(#:tests? #f)) ;FIXME: Some tests are failing.
857 ;; (modify-phases %standard-phases
859 ;; (add-after 'install 'check
860 ;; (lambda* (#:key inputs outputs #:allow-other-keys)
861 ;; (add-installed-pythonpath inputs outputs)
862 ;; (zero? (system* "py.test" "-v")))))
864 `(("python-setuptools-scm" ,python-setuptools-scm)))
866 `(("python-execnet" ,python-execnet)
867 ("python-pytest" ,python-pytest)
868 ("python-py" ,python-py)))
870 "https://github.com/pytest-dev/pytest-xdist")
872 "Plugin for py.test with distributed testing and loop-on-failing modes")
874 "The pytest-xdist plugin extends py.test with some unique test execution
875 modes: parallelization, running tests in boxed subprocesses, the ability
876 to run tests repeatedly when failed, and the ability to run tests on multiple
877 Python interpreters or platforms. It uses rsync to copy the existing
878 program code to a remote location, executes there, and then syncs the
880 (license license:expat)))
882 (define-public python2-pytest-xdist
883 (package-with-python2 python-pytest-xdist))
885 (define-public python-scripttest
887 (name "python-scripttest")
892 (uri (pypi-uri "scripttest" version))
895 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
896 (build-system python-build-system)
898 `(("python-pytest" ,python-pytest)))
899 (home-page "http://pythonpaste.org/scripttest/")
900 (synopsis "Python library to test command-line scripts")
901 (description "Scripttest is a Python helper library for testing
902 interactive command-line applications. With it you can run a script in a
903 subprocess and see the output as well as any file modifications.")
904 (license license:expat)))
906 (define-public python2-scripttest
907 (package-with-python2 python-scripttest))
909 (define-public python-testtools-bootstrap
911 (name "python-testtools-bootstrap")
916 (uri (pypi-uri "testtools" version))
919 "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
920 (patches (search-patches "python-testtools.patch"))))
921 (build-system python-build-system)
922 (arguments '(#:tests? #f))
924 `(("python-extras" ,python-extras)
925 ("python-fixtures" ,python-fixtures-bootstrap)
926 ("python-mimeparse" ,python-mimeparse)
927 ("python-pbr" ,python-pbr-minimal)
928 ("python-six" ,python-six)
929 ("python-traceback2" ,python-traceback2)
930 ("python-unittest2" ,python-unittest2)))
931 (home-page "https://github.com/testing-cabal/testtools")
933 "Extensions to the Python standard library unit testing framework")
935 "This package is only for bootstrapping. Do not use this.")
936 (license license:psfl)))
938 (define-public python2-testtools-bootstrap
939 (package-with-python2 python-testtools-bootstrap))
941 (define-public python-testtools
943 (inherit python-testtools-bootstrap)
944 (name "python-testtools")
946 `(#:phases (modify-phases %standard-phases
949 (invoke "python" "-m" "testtools.run"
950 "testtools.tests.test_suite"))))))
952 `(("python-extras" ,python-extras)
953 ("python-fixtures" ,python-fixtures)
954 ("python-mimeparse" ,python-mimeparse)
955 ("python-pbr" ,python-pbr)
956 ("python-six" ,python-six)
957 ("python-traceback2" ,python-traceback2)
958 ("python-unittest2" ,python-unittest2)))
960 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
962 "Testtools extends the Python standard library unit testing framework to
963 provide matchers, more debugging information, and cross-Python
966 (define-public python2-testtools
967 (package-with-python2 python-testtools))
969 (define-public python-testscenarios-bootstrap
971 (name "python-testscenarios-bootstrap")
976 (uri (pypi-uri "testscenarios" version))
979 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
980 (build-system python-build-system)
982 `(#:phases (modify-phases %standard-phases
985 (invoke "python" "-m" "testtools.run"
986 "testscenarios.test_suite"))))))
988 `(("python-pbr" ,python-pbr-minimal)
989 ("python-testtools" ,python-testtools-bootstrap)))
990 (home-page "https://launchpad.net/testscenarios")
991 (synopsis "Pyunit extension for dependency injection")
993 "This package is only for bootstrapping. Don't use this.")
994 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
996 (define-public python2-testscenarios-bootstrap
997 (package-with-python2 python-testscenarios-bootstrap))
999 (define-public python-testscenarios
1001 (inherit python-testscenarios-bootstrap)
1002 (name "python-testscenarios")
1004 `(("python-pbr" ,python-pbr)
1005 ("python-testtools" ,python-testtools)))
1007 "Testscenarios provides clean dependency injection for Python unittest
1010 (define-public python2-testscenarios
1011 (package-with-python2 python-testscenarios))
1013 ;; Testresources requires python-pbr at runtime, but pbr needs it for its
1014 ;; own tests. Hence this bootstrap variant.
1015 (define-public python-testresources-bootstrap
1017 (name "python-testresources-bootstrap")
1021 (uri (pypi-uri "testresources" version))
1024 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
1025 (build-system python-build-system)
1026 (arguments '(#:tests? #f))
1028 `(("python-pbr" ,python-pbr-minimal)))
1029 (home-page "https://launchpad.net/testresources")
1031 "Pyunit extension for managing test resources")
1033 "This package is only here for bootstrapping purposes. Use the regular
1034 testresources package instead.")
1035 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1037 (define-public python2-testresources-bootstrap
1038 (package-with-python2 python-testresources-bootstrap))
1040 (define-public python-testresources
1042 (inherit python-testresources-bootstrap)
1043 (name "python-testresources")
1045 `(("python-pbr" ,python-pbr)))
1048 `(("python-fixtures" ,python-fixtures)
1049 ("python-testtols" ,python-testtools)))
1051 "Testresources is an extension to Python's unittest to allow declarative
1052 use of resources by test cases.")))
1054 (define-public python2-testresources
1055 (package-with-python2 python-testresources))
1057 (define-public python-subunit-bootstrap
1059 (name "python-subunit-bootstrap")
1064 (uri (pypi-uri "python-subunit" version))
1067 "1fsw8rsn1s3nklx06mayrg5rn2zbky6wwjc5z07s7rf1wjzfs1wn"))))
1068 (build-system python-build-system)
1070 `(("python-extras" ,python-extras)
1071 ("python-testtools" ,python-testtools-bootstrap)))
1073 `(("python-fixtures" ,python-fixtures-bootstrap)
1074 ("python-hypothesis" ,python-hypothesis)
1075 ("python-testscenarios" ,python-testscenarios-bootstrap)))
1076 (home-page "https://launchpad.net/subunit")
1077 (synopsis "Python implementation of the subunit protocol")
1079 "This package is here for bootstrapping purposes only. Use the regular
1080 python-subunit package instead.")
1081 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1083 (define-public python2-subunit-bootstrap
1084 (package-with-python2 python-subunit-bootstrap))
1086 (define-public python-subunit
1088 (inherit python-subunit-bootstrap)
1089 (name "python-subunit")
1091 `(("python-extras" ,python-extras)
1092 ("python-testtools" ,python-testtools)))
1094 `(("python-fixtures" ,python-fixtures)
1095 ("python-hypothesis" ,python-hypothesis)
1096 ("python-testscenarios" ,python-testscenarios)))
1098 "Python-subunit is a Python implementation of the subunit test streaming
1101 (define-public python2-subunit
1102 (package-with-python2 python-subunit))
1104 ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
1105 ;; own tests. Hence this bootstrap variant.
1106 (define-public python-fixtures-bootstrap
1108 (name "python-fixtures-bootstrap")
1112 (uri (pypi-uri "fixtures" version))
1115 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
1116 (build-system python-build-system)
1117 (arguments `(#:tests? #f))
1119 `(("python-pbr-minimal" ,python-pbr-minimal)
1120 ("python-six" ,python-six)))
1121 (home-page "https://launchpad.net/python-fixtures")
1122 (synopsis "Python test fixture library")
1124 "This package is only used for bootstrapping. Use the regular
1125 python-fixtures package instead.")
1126 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1128 (define-public python2-fixtures-bootstrap
1129 (package-with-python2 python-fixtures-bootstrap))
1131 (define-public python-fixtures
1133 (inherit python-fixtures-bootstrap)
1134 (name "python-fixtures")
1137 (modify-phases %standard-phases
1140 (invoke "python" "-m" "testtools.run"
1141 "fixtures.test_suite"))))))
1143 ;; Fixtures uses pbr at runtime to check versions, etc.
1144 `(("python-pbr" ,python-pbr)
1145 ("python-six" ,python-six)))
1147 `(("python-mock" ,python-mock)
1148 ("python-testtools" ,python-testtools-bootstrap)))
1150 "Fixtures provides a way to create reusable state, useful when writing
1153 (define-public python2-fixtures
1154 (package-with-python2 python-fixtures))
1156 (define-public python-testrepository-bootstrap
1158 (name "python-testrepository-bootstrap")
1163 (uri (pypi-uri "testrepository" version))
1166 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1167 (build-system python-build-system)
1168 (arguments '(#:tests? #f))
1170 `(("python-fixtures" ,python-fixtures-bootstrap)
1171 ("python-subunit" ,python-subunit-bootstrap)
1172 ("python-testtools" ,python-testtools-bootstrap)))
1174 `(("python-mimeparse" ,python-mimeparse)))
1175 (home-page "https://launchpad.net/testrepository")
1176 (synopsis "Database for Python test results")
1178 "Bootstrap package for python-testrepository. Don't use this.")
1179 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1181 (define-public python2-testrepository-bootstrap
1182 (package-with-python2 python-testrepository-bootstrap))
1184 (define-public python-testrepository
1186 (inherit python-testrepository-bootstrap)
1187 (name "python-testrepository")
1189 ;; FIXME: Many tests are failing.
1192 `(("python-fixtures" ,python-fixtures)
1193 ("python-subunit" ,python-subunit)
1194 ("python-testtools" ,python-testtools)))
1196 `(("python-mimeparse" ,python-mimeparse)))
1197 (description "Testrepository provides a database of test results which can
1198 be used as part of a developer's workflow to check things such as what tests
1199 have failed since the last commit or what tests are currently failing.")))
1201 (define-public python2-testrepository
1202 (package-with-python2 python-testrepository))
1204 (define-public python-coverage
1206 (name "python-coverage")
1211 (uri (pypi-uri "coverage" version))
1214 "1d5zlyl3h39d3xlvkpsn4g5gpvdci9arplil2cnz2cs8wsgms8xb"))))
1215 (build-system python-build-system)
1217 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1219 (home-page "http://nedbatchelder.com/code/coverage")
1220 (synopsis "Code coverage measurement for Python")
1222 "Coverage measures code coverage, typically during test execution. It
1223 uses the code analysis tools and tracing hooks provided in the Python standard
1224 library to determine which lines are executable, and which have been
1226 (license license:bsd-3)))
1228 (define-public python2-coverage
1229 (package-with-python2 python-coverage))
1231 (define-public python-cov-core
1233 (name "python-cov-core")
1238 (uri (pypi-uri "cov-core" version))
1241 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1242 (build-system python-build-system)
1244 `(("python-coverage" ,python-coverage)))
1245 (home-page "https://github.com/schlamar/cov-core")
1246 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
1248 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1249 and @code{nose2-cov}. It is useful for developing coverage plugins for these
1250 testing frameworks.")
1251 (license license:expat)))
1253 (define-public python2-cov-core
1254 (package-with-python2 python-cov-core))
1256 (define-public python-codecov
1258 (name "python-codecov")
1263 (uri (pypi-uri "codecov" version))
1266 "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1267 (build-system python-build-system)
1269 `(("python-unittest2" ,python-unittest2)))
1271 `(("python-coverage" ,python-coverage)
1272 ("python-requests" ,python-requests)))
1273 (home-page "http://github.com/codecov/codecov-python")
1274 (synopsis "Upload code coverage reports to @code{codecov.io}")
1276 "Codecov collects code coverage reports from code written in Python, Java,
1277 C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
1278 (license license:asl2.0)))
1280 (define-public python-testpath
1282 (name "python-testpath")
1288 (url "https://github.com/jupyter/testpath")
1290 (file-name (git-file-name name version))
1293 "0r4iiizjql6ny1ln7ciw7rrbjadz1s9zrf2hl0xkgnh3ypd8936f"))))
1294 (build-system python-build-system)
1296 `(#:tests? #f ; this package does not even have a setup.py
1297 #:modules ((guix build python-build-system)
1300 #:imported-modules (,@%python-build-system-modules
1303 (modify-phases %standard-phases
1306 (lambda* (#:key inputs outputs #:allow-other-keys)
1307 (let* ((version (last
1308 (string-split (assoc-ref inputs "python") #\-)))
1309 (x.y (string-join (take (string-split version #\.) 2)
1312 (assoc-ref outputs "out")
1313 "/lib/python" x.y "/site-packages/testpath")))
1315 (copy-recursively "testpath" dir))
1317 (home-page "https://github.com/takluyver/testpath")
1318 (synopsis "Test utilities for code working with files and commands")
1320 "Testpath is a collection of utilities for Python code working with files
1321 and commands. It contains functions to check things on the file system, and
1322 tools for mocking system commands and recording calls to those.")
1323 (license license:expat)))
1325 (define-public python2-testpath
1326 (package-with-python2 python-testpath))
1328 (define-public python-testlib
1330 (name "python-testlib")
1335 (uri (pypi-uri "testlib" version ".zip"))
1337 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1338 (build-system python-build-system)
1340 `(("unzip" ,unzip))) ; for unpacking the source
1341 (synopsis "Python micro test suite harness")
1342 (description "A micro unittest suite harness for Python.")
1343 (home-page "https://github.com/trentm/testlib")
1344 (license license:expat)))
1346 (define-public python2-testlib
1347 (package-with-python2 python-testlib))
1349 ;;; The software provided by this package was integrated into pytest 2.8.
1350 (define-public python-pytest-cache
1352 (name "python-pytest-cache")
1356 (uri (pypi-uri "pytest-cache" version))
1359 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1360 (build-system python-build-system)
1362 `(("python-apipkg" ,python-apipkg)
1363 ("python-execnet" ,python-execnet)
1364 ("python-py" ,python-py)
1365 ("python-pytest" ,python-pytest)))
1366 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1367 (description "The pytest-cache plugin provides tools to rerun failures from
1368 the last py.test invocation.")
1369 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1370 (license license:expat)))
1372 (define-public python2-pytest-cache
1373 (package-with-python2 python-pytest-cache))
1375 (define-public python-pytest-localserver
1377 (name "python-pytest-localserver")
1381 (uri (pypi-uri "pytest-localserver" version))
1384 "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
1385 (build-system python-build-system)
1388 (modify-phases %standard-phases
1391 (invoke "py.test" "-v"))))))
1393 `(("python-pytest" ,python-pytest)
1394 ("python-requests" ,python-requests)
1395 ("python-six" ,python-six)))
1397 `(("python-werkzeug" ,python-werkzeug)))
1398 (synopsis "Py.test plugin to test server connections locally")
1399 (description "Pytest-localserver is a plugin for the pytest testing
1400 framework which enables you to test server connections locally.")
1401 (home-page "https://pypi.python.org/pypi/pytest-localserver")
1402 (license license:expat)))
1404 (define-public python-pytest-xprocess
1406 (name "python-pytest-xprocess")
1410 (uri (pypi-uri "pytest-xprocess" version))
1413 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1414 (build-system python-build-system)
1416 `(("python-pytest" ,python-pytest)
1417 ("python-pytest-cache" ,python-pytest-cache)
1418 ("python-psutil" ,python-psutil)))
1419 (synopsis "Pytest plugin to manage external processes across test runs")
1420 (description "Pytest-xprocess is an experimental py.test plugin for managing
1421 processes across test runs.")
1422 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1423 (license license:expat)))
1425 (define-public python-pytest-subtesthack
1427 (name "python-pytest-subtesthack")
1431 (uri (pypi-uri "pytest-subtesthack" version))
1434 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1435 (build-system python-build-system)
1437 `(("python-pytest" ,python-pytest)))
1438 (synopsis "Set-up and tear-down fixtures for unit tests")
1439 (description "This plugin allows you to set up and tear down fixtures within
1440 unit test functions that use @code{py.test}. This is useful for using
1441 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1442 function multiple times, without setting up or tearing down fixture state as is
1443 normally the case.")
1444 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1445 (license license:unlicense)))
1447 (define-public python2-pytest-subtesthack
1448 (package-with-python2 python-pytest-subtesthack))
1450 (define-public python-pytest-sugar
1452 (name "python-pytest-sugar")
1457 (uri (pypi-uri "pytest-sugar" version))
1460 "1asq7yc4g8bx2sn7yy974mhc9ywvaihasjab4inkirdwn9s7mn7w"))))
1461 (build-system python-build-system)
1463 `(("python-packaging" ,python-packaging)
1464 ("python-pytest" ,python-pytest)
1465 ("python-termcolor" ,python-termcolor)))
1466 (home-page "https://pivotfinland.com/pytest-sugar/")
1467 (synopsis "Plugin for pytest that changes the default look and feel")
1469 "@code{pytest-sugar} is a plugin for py.test that changes the default
1470 look and feel of py.test, using a progress bar and showing failures and errors
1472 (license license:bsd-3)))
1474 (define-public python-hypothesis
1476 (name "python-hypothesis")
1480 (uri (pypi-uri "hypothesis" version))
1483 "0fvq4mfybm129l978war86mcshkn28dkrxw7lr8549zr9ywvik1c"))))
1484 (build-system python-build-system)
1486 `(("python-flake8" ,python-flake8)
1487 ("python-pytest" ,python-pytest-bootstrap)))
1489 `(("python-attrs" ,python-attrs-bootstrap)
1490 ("python-coverage" ,python-coverage)))
1491 (synopsis "Library for property based testing")
1492 (description "Hypothesis is a library for testing your Python code against a
1493 much larger range of examples than you would ever want to write by hand. It’s
1494 based on the Haskell library, Quickcheck, and is designed to integrate
1495 seamlessly into your existing Python unit testing work flow.")
1496 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
1497 (license license:mpl2.0)
1498 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1500 (define-public python2-hypothesis
1501 (let ((hypothesis (package-with-python2
1502 (strip-python2-variant python-hypothesis))))
1503 (package (inherit hypothesis)
1505 `(("python2-enum34" ,python2-enum34)
1506 ,@(package-propagated-inputs hypothesis))))))
1508 (define-public python-lit
1515 (uri (pypi-uri "lit" version))
1518 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
1519 (build-system python-build-system)
1522 (modify-phases %standard-phases
1525 (invoke "python" "lit.py" "tests"))))))
1528 (home-page "https://llvm.org/")
1529 (synopsis "LLVM Software Testing Tool")
1530 (description "@code{lit} is a portable tool for executing LLVM and Clang
1531 style test suites, summarizing their results, and providing indication of
1533 (license license:ncsa)))
1535 (define-public python2-lit
1536 (package-with-python2 python-lit))
1538 (define-public python-pytest-pep8
1540 (name "python-pytest-pep8")
1544 (uri (pypi-uri "pytest-pep8" version))
1547 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
1548 (build-system python-build-system)
1550 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
1552 `(("python-pytest" ,python-pytest)))
1554 `(("python-pep8" ,python-pep8)))
1555 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
1556 (synopsis "Py.test plugin to check PEP8 requirements")
1557 (description "Pytest plugin for checking PEP8 compliance.")
1558 (license license:expat)))
1560 (define-public python2-pytest-pep8
1561 (package-with-python2 python-pytest-pep8))
1563 (define-public python-pytest-flakes
1565 (name "python-pytest-flakes")
1569 (uri (pypi-uri "pytest-flakes" version))
1572 "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
1573 (build-system python-build-system)
1576 (modify-phases %standard-phases
1578 (add-after 'install 'check
1579 (lambda* (#:key outputs inputs #:allow-other-keys)
1580 ;; It's easier to run tests after install.
1581 ;; Make installed package available for running the tests
1582 (add-installed-pythonpath inputs outputs)
1583 (invoke "py.test" "-vv"))))))
1585 `(("python-coverage" ,python-coverage)
1586 ("python-pytest" ,python-pytest)
1587 ("python-pytest-cache" ,python-pytest-cache)
1588 ("python-pytest-pep8" ,python-pytest-pep8)))
1590 `(("python-pyflakes" ,python-pyflakes)))
1591 (home-page "https://github.com/fschulze/pytest-flakes")
1592 (synopsis "Py.test plugin to check source code with pyflakes")
1593 (description "Pytest plugin for checking Python source code with pyflakes.")
1594 (license license:expat)))
1596 (define-public python2-pytest-flakes
1597 (package-with-python2 python-pytest-flakes))
1599 (define-public python2-coverage-test-runner
1601 (name "python2-coverage-test-runner")
1607 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
1608 "coverage-test-runner/snapshot/coverage-test-runner-"
1612 "1kjjb9llckycnfxag8zcvqsn4z1s3dwyw6b1n0avxydihgf30rny"))))
1613 (build-system python-build-system)
1615 `(#:python ,python-2
1617 (modify-phases %standard-phases
1620 (invoke "./testrun"))))))
1622 `(("python2-coverage" ,python2-coverage)))
1623 (home-page "https://liw.fi/coverage-test-runner/")
1624 (synopsis "Python module for running unit tests")
1625 (description "@code{CoverageTestRunner} is a python module for running
1626 unit tests and failing them if the unit test module does not exercise all
1627 statements in the module it tests.")
1628 (license license:gpl3+)))
1630 (define-public python-pylint
1632 (name "python-pylint")
1638 "https://github.com/PyCQA/pylint/archive/pylint-"
1642 "0mzn1czhf1mgr2wiqfihb274sja02h899b85kywdpivppa9nwrmp"))))
1643 (build-system python-build-system)
1645 `(("python-pytest" ,python-pytest)
1646 ("python-pytest-runner" ,python-pytest-runner)
1647 ("python-tox" ,python-tox)))
1649 `(("python-astroid" ,python-astroid)
1650 ("python-isort" ,python-isort)
1651 ("python-mccabe" ,python-mccabe)
1652 ("python-six" ,python-six)))
1655 (modify-phases %standard-phases
1658 ;; Somehow, tests for python2-pylint
1659 ;; fail if run from the build directory
1660 (let ((work "/tmp/work"))
1662 (setenv "PYTHONPATH"
1663 (string-append (getenv "PYTHONPATH") ":" work))
1664 (copy-recursively "." work)
1665 (with-directory-excursion "/tmp"
1666 (invoke "python" "-m" "unittest" "discover"
1667 "-s" (string-append work "/pylint/test")
1668 "-p" "*test_*.py"))))))))
1669 (home-page "https://github.com/PyCQA/pylint")
1670 (synopsis "Python source code analyzer which looks for coding standard
1672 (description "Pylint is a Python source code analyzer which looks
1673 for programming errors, helps enforcing a coding standard and sniffs
1674 for some code smells (as defined in Martin Fowler's Refactoring book).
1676 Pylint has many rules enabled by default, way too much to silence them
1677 all on a minimally sized program. It's highly configurable and handle
1678 pragmas to control it from within your code. Additionally, it is
1679 possible to write plugins to add your own checks.")
1680 (properties `((python2-variant . ,(delay python2-pylint))))
1681 (license license:gpl2+)))
1683 (define-public python2-pylint
1684 (let ((pylint (package-with-python2
1685 (strip-python2-variant python-pylint))))
1686 (package (inherit pylint)
1688 `(("python2-backports-functools-lru-cache"
1689 ,python2-backports-functools-lru-cache)
1690 ("python2-configparser" ,python2-configparser)
1691 ,@(package-propagated-inputs pylint))))))
1693 (define-public python-paramunittest
1695 (name "python-paramunittest")
1700 (uri (pypi-uri "ParamUnittest" version))
1703 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
1704 (build-system python-build-system)
1706 "https://github.com/rik0/ParamUnittest")
1708 "Simple extension to have parametrized unit tests")
1710 "This package allows to create parametrized unit-tests that work with the standard
1711 unittest package. A parametrized test case is automatically converted to multiple test
1712 cases. Since they are TestCase subclasses, they work with other test suites that
1713 recognize TestCases.")
1714 (license license:bsd-2)))
1716 (define-public python2-python-paramunittest
1717 (package-with-python2 python-paramunittest))
1719 (define-public python-pytest-warnings
1721 (name "python-pytest-warnings")
1726 (uri (pypi-uri "pytest-warnings" version))
1729 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
1730 (build-system python-build-system)
1732 `(("pytest" ,python-pytest)))
1733 (home-page "https://github.com/fschulze/pytest-warnings")
1734 (synopsis "Pytest plugin to list Python warnings in pytest report")
1736 "Python-pytest-warnings is a pytest plugin to list Python warnings in
1738 (license license:expat)
1739 (properties `((python2-variant . ,(delay python2-pytest-warnings))
1740 ;; This package is part of pytest as of version 3.1.0.
1741 (superseded . ,python-pytest)))))
1743 (define-public python2-pytest-warnings
1744 (package (inherit (package-with-python2
1745 (strip-python2-variant python-pytest-warnings)))
1746 (properties `((superseded . ,python2-pytest)))))
1748 (define-public python-pytest-capturelog
1750 (name "python-pytest-capturelog")
1755 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
1758 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
1759 (build-system python-build-system)
1761 `(("pytest" ,python-pytest)))
1762 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
1763 (synopsis "Pytest plugin to catch log messages")
1765 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
1766 (license license:expat)))
1768 (define-public python2-pytest-capturelog
1769 (package-with-python2 python-pytest-capturelog))
1771 (define-public python-pytest-catchlog
1773 (name "python-pytest-catchlog")
1778 (uri (pypi-uri "pytest-catchlog" version ".zip"))
1781 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
1782 (build-system python-build-system)
1784 `(("unzip" ,unzip)))
1786 `(("pytest" ,python-pytest)))
1787 (home-page "https://github.com/eisensheng/pytest-catchlog")
1788 (synopsis "Pytest plugin to catch log messages")
1790 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
1791 a fork of pytest-capturelog.")
1792 (license license:expat)))
1794 (define-public python2-pytest-catchlog
1795 (package-with-python2 python-pytest-catchlog))
1797 (define-public python-nosexcover
1799 (name "python-nosexcover")
1803 (uri (pypi-uri "nosexcover" version))
1806 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
1807 (build-system python-build-system)
1809 `(("python-coverage" ,python-coverage)
1810 ("python-nose" ,python-nose)))
1811 (home-page "http://github.com/cmheisel/nose-xcover")
1812 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
1813 (description "Nose-xcover is a companion to the built-in
1814 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
1815 to a file named coverage.xml.
1817 It will honor all the options you pass to the Nose coverage plugin,
1818 especially -cover-package.")
1819 (license license:expat)))
1821 (define-public python2-nosexcover
1822 (package-with-python2 python-nosexcover))
1824 (define-public python-discover
1826 (name "python-discover")
1831 (uri (pypi-uri "discover" version))
1834 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
1835 (build-system python-build-system)
1836 (home-page "http://pypi.python.org/pypi/discover/")
1838 "Python test discovery for unittest")
1840 "Discover provides test discovery for unittest, a feature that has been
1841 backported from Python 2.7 for Python 2.4+.")
1842 (license license:bsd-3)))
1844 (define-public python2-discover
1845 (package-with-python2 python-discover))
1847 (define-public behave
1853 (uri (pypi-uri "behave" version))
1856 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))))
1857 (build-system python-build-system)
1859 `(("python-mock" ,python-mock)
1860 ("python-nose" ,python-nose)
1861 ("python-pathpy" ,python-pathpy)
1862 ("python-pyhamcrest" ,python-pyhamcrest)
1863 ("python-pytest" ,python-pytest)))
1865 `(("python-six" ,python-six)
1866 ("python-parse" ,python-parse)
1867 ("python-parse-type" ,python-parse-type)))
1869 '(#:test-target "behave_test"))
1870 (home-page "https://github.com/behave/behave")
1871 (synopsis "Python behavior-driven development")
1873 "Behave is a tool for behavior-driven development in python.
1874 Behavior-driven development (or BDD) is an agile software development
1875 technique that encourages collaboration between developers, QA and
1876 non-technical or business participants in a software project. Behave uses
1877 tests written in a natural language style, backed up by Python code.")
1878 (license license:x11)))
1880 (define-public python-behave-web-api
1882 (name "python-behave-web-api")
1887 (uri (pypi-uri "behave-web-api" version))
1890 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
1891 (build-system python-build-system)
1894 (modify-phases %standard-phases
1895 (add-after 'unpack 'fix-dependencies
1897 (substitute* "setup.py"
1898 (("'wheel'") "") ; We don't use it.
1899 (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
1902 `(("behave" ,behave)
1903 ("python-requests" ,python-requests)))
1904 (home-page "https://github.com/jefersondaniel/behave-web-api")
1905 (synopsis "Provides testing for JSON APIs with Behave for Python")
1906 (description "This package provides testing utility modules for testing
1907 JSON APIs with Behave.")
1908 (license license:expat)))
1910 (define-public python2-behave-web-api
1911 (package-with-python2 python-behave-web-api))
1913 (define-public python-rednose
1915 (name "python-rednose")
1920 (uri (pypi-uri "rednose" version))
1923 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
1924 (build-system python-build-system)
1926 `(#:phases (modify-phases %standard-phases
1927 (add-after 'unpack 'patch-setup.py
1929 ;; Six is only required for tests and later versions
1931 (substitute* "setup.py"
1932 (("six==1.10.0") "six"))
1935 `(("python-colorama" ,python-colorama)
1936 ("python-termstyle" ,python-termstyle)))
1938 `(("python-six" ,python-six)
1939 ("python-nose" ,python-nose)))
1940 (home-page "https://github.com/JBKahn/rednose")
1941 (synopsis "Colored output for Python nosetests")
1942 (description "This package provides colored output for the
1943 @command{nosetests} command of the Python Nose unit test framework.")
1944 (license license:bsd-3)))
1946 (define-public python2-rednose
1947 (package-with-python2 python-rednose))
1949 (define-public python-nose-randomly
1951 (name "python-nose-randomly")
1956 (uri (pypi-uri "nose-randomly" version))
1958 (base32 "0z662rqhfk4bjmg806mn4frb8nz4gbh7mrddsrhfffp1g4yklj3y"))))
1959 (build-system python-build-system)
1961 `(("python-nose" ,python-nose)
1962 ("python-numpy" ,python-numpy)))
1963 (home-page "https://github.com/adamchainz/nose-randomly")
1965 "Nose plugin to randomly order tests and control random.seed")
1967 "This is a @code{Nose} plugin to randomly order tests which can be quite
1968 powerful in discovering hidden flaws in the tests themselves, while helping to
1969 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
1970 by resetting it to a repeatable number for each test, enabling the tests to
1971 create data based on random numbers and yet remain repeatable.")
1972 (license license:bsd-3)))
1974 (define-public python2-nose-randomly
1975 (package-with-python2 python-nose-randomly))
1977 (define-public python-nose-timer
1979 (name "python-nose-timer")
1984 (uri (pypi-uri "nose-timer" version))
1987 "0hfz5aqnhf493i9kyb6prm4zm8vx7wmfsyg3nvsnh24lzh2kwx44"))))
1988 (build-system python-build-system)
1990 `(("python-nose" ,python-nose)
1991 ("python-termcolor" ,python-termcolor)))
1992 (home-page "https://github.com/mahmoudimus/nose-timer")
1993 (synopsis "Timer plugin for nosetests")
1994 (description "Shows how much time was needed to run individual tests.")
1995 (license license:expat)))
1997 (define-public python2-nose-timer
1998 (package-with-python2 python-nose-timer))
2000 (define-public python-freezegun
2002 (name "python-freezegun")
2007 (uri (pypi-uri "freezegun" version))
2010 "1nh0fzqjwg88n57k3qa8mxnmiwrr7lqyd5xvc96qn5g8zcxv8fg8"))))
2011 (build-system python-build-system)
2013 `(("python-mock" ,python-mock)
2014 ("python-nose" ,python-nose)
2015 ("python-coverage" ,python-coverage)))
2017 `(("python-six" ,python-six)
2018 ("python-dateutil" ,python-dateutil)))
2021 (modify-phases %standard-phases
2022 ;; The tests are normally executed via `make test`, but the PyPi
2023 ;; package does not include the Makefile.
2026 (invoke "nosetests" "./tests/"))))))
2027 (home-page "https://github.com/spulec/freezegun")
2028 (synopsis "Test utility for mocking the datetime module")
2030 "FreezeGun is a library that allows your python tests to travel through
2031 time by mocking the datetime module.")
2032 (license license:asl2.0)))
2034 (define-public python2-freezegun
2035 (package-with-python2 python-freezegun))
2037 (define-public python-flexmock
2039 (name "python-flexmock")
2043 (uri (pypi-uri "flexmock" version))
2046 "0arc6njvs6i9v9hgvzk5m50296g7zy5m9d7pyb43vdsdgxrci5gy"))))
2047 (build-system python-build-system)
2048 (home-page "https://flexmock.readthedocs.org")
2049 (synopsis "Testing library for Python")
2051 "flexmock is a testing library for Python that makes it easy to create
2052 mocks, stubs and fakes.")
2053 (license license:bsd-3)))
2055 (define-public python2-flexmock
2056 (package-with-python2 python-flexmock))
2058 (define-public python-flaky
2060 (name "python-flaky")
2064 (uri (pypi-uri "flaky" version))
2067 "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j"))))
2068 (build-system python-build-system)
2070 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2072 (home-page "https://github.com/box/flaky")
2073 (synopsis "Automatically rerun flaky tests")
2075 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2078 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2079 on components that aren't 100% reliable. With flaky, instead of removing
2080 those tests or marking them to @code{@@skip}, they can be automatically
2082 (license license:asl2.0)))
2084 (define-public python2-flaky
2085 (package-with-python2 python-flaky))
2087 (define-public python-pyhamcrest
2089 (name "python-pyhamcrest")
2092 ;; Tests not distributed from pypi release.
2095 (url "https://github.com/hamcrest/PyHamcrest")
2096 (commit (string-append "V" version))))
2097 (file-name (git-file-name name version))
2100 "01qnzj9qnzz0y78qa3ing24ssvszb0adw59xc4qqmdn5wryy606b"))))
2101 (native-inputs ; All native inputs are for tests
2102 `(("python-pytest-cov" ,python-pytest-cov)
2103 ("python-mock" ,python-mock)
2104 ("python-pytest" ,python-pytest)
2105 ("python-hypothesis" ,python-hypothesis)))
2107 `(("python-six" ,python-six)))
2108 (build-system python-build-system)
2109 (home-page "http://hamcrest.org/")
2110 (synopsis "Hamcrest matchers for Python")
2112 "PyHamcrest is a framework for writing matcher objects,
2113 allowing you to declaratively define \"match\" rules.")
2114 (license license:bsd-3)))
2116 (define-public python2-pyhamcrest
2117 (package-with-python2 python-pyhamcrest))
2119 (define-public unittest-cpp
2121 (name "unittest-cpp")
2126 (url "https://github.com/unittest-cpp/unittest-cpp")
2127 (commit (string-append "v" version))))
2128 (file-name (git-file-name name version))
2130 (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
2132 `(#:tests? #f)) ; It's run after build automatically.
2133 (build-system cmake-build-system)
2134 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2135 (synopsis "Lightweight unit testing framework for C++")
2136 (description "UnitTest++ is a lightweight unit testing framework for C++.
2137 It was designed to do test-driven development on a wide variety of platforms.
2138 Simplicity, portability, speed, and small footprint are all very important
2139 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2140 of advanced library and language features, which means it should be easily
2141 portable to just about any platform.")
2142 (license license:expat)))
2144 (define-public libfaketime
2146 (name "libfaketime")
2148 (home-page "https://github.com/wolfcw/libfaketime")
2153 (commit (string-append "v" version))))
2156 "1cin1pqwpsswcv7amiwijirvcg3x1zf2l00s1x84nxc5602fzr5c"))
2157 (file-name (git-file-name name version))))
2158 (build-system gnu-build-system)
2160 '(#:phases (modify-phases %standard-phases
2162 (lambda* (#:key outputs #:allow-other-keys)
2163 (let ((out (assoc-ref outputs "out")))
2165 (setenv "PREFIX" out)
2167 (add-before 'check 'pre-check
2169 (substitute* "test/functests/test_exclude_mono.sh"
2170 (("/bin/bash") (which "bash")))
2172 #:test-target "test"))
2174 `(("perl" ,perl))) ;for tests
2175 (synopsis "Fake the system time for single applications")
2177 "The libfaketime library allows users to modify the system time that an
2178 application \"sees\". It is meant to be loaded using the dynamic linker's
2179 @code{LD_PRELOAD} environment variable. The @command{faketime} command
2180 provides a simple way to achieve this.")
2181 (license license:gpl2)))
2183 (define-public umockdev
2189 (uri (string-append "https://github.com/martinpitt/umockdev/"
2190 "releases/download/" version "/"
2191 "umockdev-" version ".tar.xz"))
2194 "1hx5jm9afng6hw9wyp524z8nwdp6w053pca0w2c0gqpgrmvjxvd2"))))
2195 (build-system gnu-build-system)
2198 (modify-phases %standard-phases
2199 (add-after 'unpack 'skip-broken-test
2201 (substitute* "tests/test-umockdev.c"
2202 (("/\\* sys/ in other dir")
2203 (string-append "return; // ")))
2207 ("python" ,python) ; for tests
2208 ("which" ,which) ; for tests
2209 ("gtk-doc" ,gtk-doc)
2210 ("pkg-config" ,pkg-config)))
2214 ("libgudev" ,libgudev)
2215 ("gobject-introspection" ,gobject-introspection)))
2216 (home-page "https://github.com/martinpitt/umockdev/")
2217 (synopsis "Mock hardware devices for creating unit tests")
2218 (description "umockdev mocks hardware devices for creating integration
2219 tests for hardware related libraries and programs. It also provides tools to
2220 record the properties and behaviour of particular devices, and to run a
2221 program or test suite under a test bed with the previously recorded devices
2223 (license license:lgpl2.1+)))