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 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 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 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 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 bash)
51 #:use-module (gnu packages compression)
52 #:use-module (gnu packages llvm)
53 #:use-module (gnu packages golang)
54 #:use-module (gnu packages python)
55 #:use-module (gnu packages python-web)
56 #:use-module (gnu packages time)
57 #:use-module (guix utils)
58 #:use-module ((guix licenses) #:prefix license:)
59 #:use-module (guix packages)
60 #:use-module (guix download)
61 #:use-module (guix git-download)
62 #:use-module (guix build-system cmake)
63 #:use-module (guix build-system gnu)
64 #:use-module (guix build-system go)
65 #:use-module (guix build-system python)
66 #:use-module (guix build-system trivial))
75 (uri (string-append "https://github.com/libcheck/check/releases/download/"
76 version "/check-" version ".tar.gz"))
79 "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6"))))
80 (build-system gnu-build-system)
81 (home-page "https://libcheck.github.io/check/")
82 (synopsis "Unit test framework for C")
84 "Check is a unit testing framework for C. It features a simple
85 interface for defining unit tests, putting little in the way of the
86 developer. Tests are run in a separate address space, so Check can
87 catch both assertion failures and code errors that cause segmentation
88 faults or other signals. The output from unit tests can be used within
89 source code editors and IDEs.")
90 (license license:lgpl2.1+)))
99 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
100 version "/CUnit-" version ".tar.bz2"))
103 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
104 (build-system gnu-build-system)
105 (arguments '(#:phases
106 (modify-phases %standard-phases
107 ;; XXX: The "bootstrap" phase detects the "bootstrap"
108 ;; script, but fails to execute it, so we bootstrap
111 (lambda _ (invoke "autoreconf" "-vfi"))))))
113 `(("automake" ,automake)
114 ("autoconf" ,autoconf)
115 ("libtool" ,libtool)))
116 (home-page "http://cunit.sourceforge.net/")
117 (synopsis "Automated testing framework for C")
119 "CUnit is a lightweight system for writing, administering, and running
120 unit tests in C. It provides C programmers with basic testing functionality
121 with a flexible variety of user interfaces.")
122 (license license:gpl2+)))
124 (define-public cppunit
130 (uri (string-append "http://dev-www.libreoffice.org/src/"
131 name "-" version ".tar.gz"))
134 "17s2kzmkw3kfjhpp72rfppyd7syr7bdq5s69syj2nvrlwd3d4irz"))))
135 ;; Explicitly link with libdl. This is expected to be done by packages
136 ;; relying on cppunit for their tests. However, not all of them do.
137 ;; If we added the linker flag to such packages, we would pollute all
138 ;; binaries, not only those used for testing.
140 `(#:make-flags '("LDFLAGS=-ldl")))
141 (build-system gnu-build-system)
142 (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
143 (synopsis "Unit testing framework for C++")
144 (description "CppUnit is the C++ port of the famous JUnit framework for
145 unit testing. Test output is in XML for automatic testing and GUI based for
147 (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
149 ;; Some packages require this newer version of cppunit. However, it needs
150 ;; C++11 support, which is not enabled by default in our current GCC, and
151 ;; updating in-place would require adding CXXFLAGS to many dependent packages.
152 ;; Thus, keep as a separate variable for now.
153 ;; TODO: Remove this when our default GCC is updated to 6 or higher.
154 (define-public cppunit-1.14
160 (uri (string-append "https://dev-www.libreoffice.org/src/"
161 "cppunit-" version ".tar.gz"))
164 "1027cyfx5gsjkdkaf6c2wnjh68882grw8n672018cj3vs9lrhmix"))))))
166 ;; When dependent packages upgraded to use newer version of catch, this one should
168 (define-public catch-framework
171 (version "1.3.5") ;Sub-minor is the build number
175 (url "https://github.com/philsquared/Catch")
177 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
178 (file-name (string-append name "-" version))
181 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
182 (build-system trivial-build-system)
184 `(#:modules ((guix build utils))
186 (use-modules (guix build utils))
187 (let* ((source (assoc-ref %build-inputs "source"))
188 (output (assoc-ref %outputs "out"))
189 (incdir (string-append output "/include"))
190 (docdir (string-append output "/share/doc/catch-"
192 (for-each mkdir-p (list incdir docdir))
193 (install-file (string-append source
194 "/single_include/catch.hpp")
196 (copy-recursively (string-append source "/docs")
199 (home-page "http://catch-lib.net/")
200 (synopsis "Automated test framework for C++ and Objective-C")
202 "Catch stands for C++ Automated Test Cases in Headers and is a
203 multi-paradigm automated test framework for C++ and Objective-C.")
204 (license license:boost1.0)))
206 (define-public catch-framework2
210 (home-page "https://github.com/catchorg/Catch2")
213 (uri (string-append home-page "/archive/v" version ".tar.gz"))
216 "0g2ysxc6adqca5wh7nsicnxb9wkxg75cd5izjsl39rcj0v903gr7"))
217 (file-name (string-append name "-" version ".tar.gz"))))
218 (build-system cmake-build-system)
219 (synopsis "Automated test framework for C++ and Objective-C")
220 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
221 a multi-paradigm automated test framework for C++ and Objective-C.")
222 (license license:boost1.0)))
224 (define-public cmdtest
230 (uri (string-append "http://git.liw.fi/cmdtest/snapshot/"
231 name "-" version ".tar.gz"))
234 "1jmfiyrrqmpvwdb273bkb8hjaf4rwx9njblx29pmr7giyahskwi5"))))
235 (build-system python-build-system)
239 (modify-phases %standard-phases
240 ;; check phase needs to be run before the build phase. If not, the
241 ;; coverage test runner looks for tests for the built source files,
244 (add-before 'build 'check
247 (("/bin/sh") (which "sh")))
248 ;; yarn uses python2-ttystatus to print messages.
249 ;; python2-ttystatus requires /dev/tty which is not present in
250 ;; the build environment. Hence assuming-failure test fails.
251 (delete-file "yarn.tests/assuming-failure.script")
252 (delete-file "yarn.tests/assuming-failure.stdout")
253 (zero? (system* "python" "setup.py" "check")))))))
255 `(("python2-coverage-test-runner" ,python2-coverage-test-runner)))
257 `(("python2-cliapp" ,python2-cliapp)
258 ("python2-markdown" ,python2-markdown)
259 ("python2-ttystatus" ,python2-ttystatus)))
260 (home-page "https://liw.fi/cmdtest/")
261 (synopsis "Black box Unix program tester")
263 "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
264 given a command line and input files, and the expected output, and it verifies
265 that the command line produces the expected output. If not, it reports a
266 problem, and shows the differences.")
267 (license license:gpl3+)))
269 (define-public cmocka
275 (uri (string-append "https://cmocka.org/files/"
276 (version-major+minor version) "/cmocka-"
280 "1283zi9qf5613g8iadm1fxmjh4rzxqd5np2j3lcpgairf25g8bph"))))
281 (build-system cmake-build-system)
283 `(#:tests? #f)) ; No test target
284 (home-page "https://cmocka.org/")
285 (synopsis "Unit testing framework for C")
286 (description "Cmocka is a unit testing framework for C with support for
287 mock objects. It only requires the standard C library, and works with
288 different compilers. Cmocka supports several different message output formats
289 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
291 (license license:asl2.0)))
293 (define-public cppcheck
299 (uri (string-append "https://github.com/danmar/cppcheck/archive/"
302 (base32 "15ghxwmyy09cd9mi008k4jn09c441j86qyaa4dz0is7f5dv5cdkx"))
303 (file-name (string-append name "-" version ".tar.gz"))))
304 (build-system cmake-build-system)
305 (home-page "http://cppcheck.sourceforge.net")
306 (synopsis "Static C/C++ code analyzer")
307 (description "Cppcheck is a static code analyzer for C and C++. Unlike
308 C/C++ compilers and many other analysis tools it does not detect syntax errors
309 in the code. Cppcheck primarily detects the types of bugs that the compilers
310 normally do not detect. The goal is to detect only real errors in the code
311 (i.e. have zero false positives).")
312 (license license:gpl3+)))
314 (define-public go-gopkg.in-check.v1
315 (let ((commit "20d25e2804050c1cd24a7eea1e7a6447dd0e74ec")
318 (name "go-gopkg.in-check.v1")
319 (version (git-version "0.0.0" revision commit))
323 (url "https://github.com/go-check/check.git")
325 (file-name (git-file-name name version))
328 "0k1m83ji9l1a7ng8a7v40psbymxasmssbrrhpdv2wl4rhs0nc3np"))))
329 (build-system go-build-system)
331 '(#:import-path "gopkg.in/check.v1"))
332 (synopsis "Rich testing extension for Go's testing package")
334 "@code{check} is a rich testing extension for Go's testing package.")
335 (home-page "https://github.com/go-check/check")
336 (license license:bsd-2))))
338 (define-public go-github.com-smartystreets-gunit
340 (name "go-github.com-smartystreets-gunit")
345 (url "https://github.com/smartystreets/gunit")
347 (file-name (git-file-name name version))
350 "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
351 (build-system go-build-system)
353 '(;; TODO: This package depends on go-github.com-smartystreets-assertions
354 ;; for running the tests, but go-github.com-smartystreets-assertions
355 ;; depends on this package, so break this loop by not running the tests
358 #:import-path "github.com/smartystreets/gunit"))
359 (synopsis "Testing tool for Go, in the style of xUnit")
361 "@code{gunit} allows the test author to use a struct as the scope for a
362 group of related test cases, in the style of xUnit fixtures. This makes
363 extraction of setup/teardown behavior (as well as invoking the system under
364 test) much simpler.")
365 (home-page "https://github.com/smartystreets/gunit")
366 (license license:expat)))
368 (define-public go-github.com-smartystreets-assertions
370 (name "go-github.com-smartystreets-assertions")
375 (url "https://github.com/smartystreets/assertions")
377 (file-name (git-file-name name version))
380 "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
381 (build-system go-build-system)
383 '(#:import-path "github.com/smartystreets/assertions"))
385 `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
386 (synopsis "Assertions for testing with Go")
388 "The @code{assertions} package provides convinient assertion functions
389 for writing tests in Go.")
390 (home-page "https://github.com/smartystreets/assertions")
391 (license license:expat)))
393 (define-public go-github.com-smartystreets-goconvey
395 (name "go-github.com-smartystreets-goconvey")
400 (url "https://github.com/smartystreets/goconvey")
402 (file-name (git-file-name name version))
405 "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
406 (build-system go-build-system)
408 '(#:import-path "github.com/smartystreets/goconvey"))
410 `(("go-github.com-jtolds-gls" ,go-github.com-jtolds-gls)
411 ("go-github.com-smartystreets-assertions" ,go-github.com-smartystreets-assertions)))
412 (synopsis "Go testing tool with both a web and terminal user interface")
414 "GoConvey is a testing tool for Go. It integrates with go test, can show
415 test coverage and has a web user interface that will refresh automatically.")
416 (home-page "https://github.com/smartystreets/goconvey")
417 (license license:expat)))
419 ;; XXX When updating, check whether ZNC's GOOGLETEST-SOURCES can be
420 ;; switched back to simply using (PACKAGE-SOURCE ...).
421 (define-public googletest
428 (uri (string-append "https://github.com/google/googletest/archive/"
429 "release-" version ".tar.gz"))
430 (file-name (string-append name "-" version ".tar.gz"))
433 "1n5p1m2m3fjrjdj752lf92f9wq3pl5cbsfrb49jqbg52ghkz99jq"))))
434 (build-system cmake-build-system)
436 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
438 `(("python-2" ,python-2)))
439 (home-page "https://github.com/google/googletest/")
440 (synopsis "Test discovery and XUnit test framework")
441 (description "Google Test features an XUnit test framework, automated test
442 discovery, death tests, assertions, parameterized tests and XML test report
444 (license license:bsd-3)))
446 (define-public cpputest
453 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
454 version "/cpputest-" version ".tar.gz"))
457 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
458 (build-system gnu-build-system)
460 `(("googletest" ,googletest)))
461 (home-page "https://cpputest.github.io/")
462 (synopsis "Unit testing and mocking framework for C/C++")
464 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
465 C++ but is used in C and C++ projects and frequently used in embedded systems
466 but it works for any C/C++ project.")
467 (license license:bsd-3)))
469 (define-public python-parameterized
471 (name "python-parameterized")
476 (uri (pypi-uri "parameterized" version))
479 "1qj1939shm48d9ql6fm1nrdy4p7sdyj8clz1szh5swwpf1qqxxfa"))))
480 (build-system python-build-system)
481 (arguments '(#:tests? #f)) ; there are no tests
482 (home-page "https://github.com/wolever/parameterized")
483 (synopsis "Parameterized testing with any Python test framework")
485 "Parameterized is a Python library that aims to fix parameterized testing
486 for every Python test framework. It supports nose, py.test, and unittest.")
487 (license license:bsd-2)))
489 (define-public python2-parameterized
490 (package-with-python2 python-parameterized))
492 (define-public python-mock
499 (uri (pypi-uri "mock" version))
502 "1flbpksir5sqrvq2z0dp8sl4bzbadg21sj4d42w3klpdfvgvcn5i"))))
504 `(("python-pbr" ,python-pbr-minimal)
505 ("python-six" ,python-six)))
506 (build-system python-build-system)
508 `(("python-unittest2" ,python-unittest2)))
511 (modify-phases %standard-phases
514 (zero? (system* "unit2")))))))
515 (home-page "https://github.com/testing-cabal/mock")
516 (synopsis "Python mocking and patching library for testing")
518 "Mock is a library for testing in Python. It allows you to replace parts
519 of your system under test with mock objects and make assertions about how they
521 (properties `((python2-variant . ,(delay python2-mock))))
522 (license license:expat)))
524 (define-public python2-mock
525 (let ((base (package-with-python2
526 (strip-python2-variant python-mock))))
527 (package (inherit base)
529 `(("python2-functools32" ,python2-functools32)
530 ("python2-funcsigs" ,python2-funcsigs)
531 ,@(package-propagated-inputs base))))))
533 (define-public python-nose
540 (uri (pypi-uri "nose" version))
543 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
544 (build-system python-build-system)
546 '(#:tests? #f)) ; FIXME: test suite fails
547 (home-page "http://readthedocs.org/docs/nose/")
548 (synopsis "Python testing library")
550 "Nose extends the unittest library to make testing easier.")
551 (license license:lgpl2.0+)))
553 (define-public python2-nose
554 (package-with-python2 python-nose))
556 (define-public python-nose2
558 (name "python-nose2")
563 (uri (pypi-uri "nose2" version))
566 "1x4zjq1zlyrh8b9ba0cmafd3w94pxhid408kibyjd3s6h1lap6s7"))))
567 (build-system python-build-system)
568 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
570 `(("python-cov-core" ,python-cov-core)
571 ("python-pytest-cov" ,python-pytest-cov)
572 ("python-six" ,python-six)))
573 (home-page "https://github.com/nose-devs/nose2")
574 (synopsis "Next generation of nicer testing for Python")
576 "Nose2 is the next generation of nicer testing for Python, based on the
577 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
578 better plugin api, being easier for users to configure, and simplifying internal
579 interfaces and processes.")
580 (license license:bsd-2)))
582 (define-public python2-nose2
583 (package-with-python2 python-nose2))
585 (define-public python-unittest2
587 (name "python-unittest2")
592 (uri (pypi-uri "unittest2" version))
594 (search-patches "python-unittest2-python3-compat.patch"
595 "python-unittest2-remove-argparse.patch"))
598 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
599 (build-system python-build-system)
602 (modify-phases %standard-phases
605 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
607 `(("python-six" ,python-six)
608 ("python-traceback2" ,python-traceback2)))
609 (home-page "http://pypi.python.org/pypi/unittest2")
610 (synopsis "Python unit testing library")
612 "Unittest2 is a replacement for the unittest module in the Python
614 (license license:psfl)))
616 (define-public python2-unittest2
617 (package-with-python2 python-unittest2))
619 (define-public python-pytest
621 (name "python-pytest")
626 (uri (pypi-uri "pytest" version))
629 "1q832zd07zak2lyxbycxjydh0jp7y3hvawjqzlvra6aghz8r3r7s"))))
630 (build-system python-build-system)
633 (modify-phases %standard-phases
634 (add-before 'check 'disable-invalid-tests
636 ;; Some tests involves the /usr directory, and fails.
637 (substitute* "testing/test_argcomplete.py"
638 (("def test_remove_dir_prefix\\(self\\):")
639 "@pytest.mark.xfail\n def test_remove_dir_prefix(self):"))
640 (substitute* "testing/test_argcomplete.py"
641 (("def test_remove_dir_prefix" line)
642 (string-append "@pytest.mark.skip"
643 "(reason=\"Assumes that /usr exists.\")\n "
647 `(("python-attrs" ,python-attrs-bootstrap)
648 ("python-more-itertools" ,python-more-itertools)
649 ("python-pluggy" ,python-pluggy)
650 ("python-py" ,python-py)
651 ("python-six" ,python-six-bootstrap)))
653 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
655 ("python-hypothesis" ,python-hypothesis)
656 ("python-nose" ,python-nose)
657 ("python-mock" ,python-mock)
658 ("python-setuptools-scm" ,python-setuptools-scm)))
659 (home-page "http://pytest.org")
660 (synopsis "Python testing library")
662 "Pytest is a testing tool that provides auto-discovery of test modules
663 and functions, detailed info on failing assert statements, modular fixtures,
664 and many external plugins.")
665 (license license:expat)
666 (properties `((python2-variant . ,(delay python2-pytest))))))
668 (define-public python2-pytest
669 (let ((pytest (package-with-python2
670 (strip-python2-variant python-pytest))))
674 `(("python2-funcsigs" ,python2-funcsigs)
675 ,@(package-propagated-inputs pytest))))))
677 (define-public python-pytest-bootstrap
679 (inherit (strip-python2-variant python-pytest))
680 (name "python-pytest-bootstrap")
681 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
682 (arguments `(#:tests? #f))
683 (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
685 (define-public python2-pytest-bootstrap
686 (let ((pytest (package-with-python2
687 (strip-python2-variant python-pytest-bootstrap))))
688 (package (inherit pytest)
690 `(("python2-funcsigs" ,python2-funcsigs-bootstrap)
691 ,@(package-propagated-inputs pytest))))))
693 (define-public python-pytest-cov
695 (name "python-pytest-cov")
700 (uri (pypi-uri "pytest-cov" version))
703 "03c2qc42r4bczyw93gd7n0qi1h1jfhw7fnbhi33c3vp1hs81gm2k"))))
704 (build-system python-build-system)
707 (modify-phases %standard-phases
710 ;; options taken from tox.ini
711 ;; TODO: make "--restructuredtext" tests pass. They currently fail
712 ;; with "Duplicate implicit target name"
713 (zero? (system* "python" "./setup.py" "check"
714 "--strict" "--metadata")))))))
716 `(("python-coverage" ,python-coverage)
717 ("python-pytest" ,python-pytest)))
718 (home-page "https://github.com/pytest-dev/pytest-cov")
719 (synopsis "Pytest plugin for measuring coverage")
721 "Pytest-cov produces coverage reports. It supports centralised testing and
722 distributed testing in both @code{load} and @code{each} modes. It also
723 supports coverage of subprocesses.")
724 (license license:expat)))
726 (define-public python2-pytest-cov
727 (package-with-python2 python-pytest-cov))
729 (define-public python-pytest-runner
731 (name "python-pytest-runner")
736 (uri (pypi-uri "pytest-runner" version))
739 "1cw978kqqcq916b9gfns1qjqvg33c5ail5jhw9054dsynkm32flq"))))
740 (build-system python-build-system)
743 (modify-phases %standard-phases
744 ;; The fancy way of setting the version with setuptools_scm does not
745 ;; seem to work here.
746 (add-after 'unpack 'set-version
748 (substitute* "docs/conf.py"
749 (("version = setuptools_scm\\.get_version\\(root='\\.\\.')")
750 (string-append "version = \"" ,version "\"")))
753 `(("python-pytest" ,python-pytest-bootstrap)
754 ("python-setuptools-scm" ,python-setuptools-scm)))
755 (home-page "https://github.com/pytest-dev/pytest-runner")
756 (synopsis "Invoke py.test as a distutils command")
758 "This package provides a @command{pytest-runner} command that
759 @file{setup.py} files can use to run tests.")
760 (license license:expat)))
762 (define-public python2-pytest-runner
763 (package-with-python2 python-pytest-runner))
765 (define-public python-pytest-mock
767 (name "python-pytest-mock")
772 (uri (pypi-uri "pytest-mock" version))
775 "075v7b2wm5f839r1a30n21wfk5rfqp3d05q7zb9jlb2wmxki23cj"))))
776 (build-system python-build-system)
778 `(("python-setuptools-scm" ,python-setuptools-scm)))
780 `(("python-pytest" ,python-pytest)))
781 (home-page "https://github.com/pytest-dev/pytest-mock/")
782 (synopsis "Thin-wrapper around the mock package for easier use with py.test")
784 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
785 around the patching API provided by the @code{mock} package, but with the
786 benefit of not having to worry about undoing patches at the end of a test.
787 The mocker fixture has the same API as @code{mock.patch}, supporting the
789 (properties `((python2-variant . ,(delay python2-pytest-mock))))
790 (license license:expat)))
792 (define-public python2-pytest-mock
793 (let ((base (package-with-python2
794 (strip-python2-variant python-pytest-mock))))
795 (package (inherit base)
797 `(("python2-mock" ,python2-mock)
798 ,@(package-propagated-inputs base))))))
800 (define-public python-pytest-xdist
802 (name "python-pytest-xdist")
807 (uri (pypi-uri "pytest-xdist" version ".zip"))
810 "08rn2l39ds60xshs4js787l84pfckksqklfq2wq9x8ig2aci2pja"))
811 (modules '((guix build utils)))
814 ;; Remove pre-compiled .pyc files from source.
815 (for-each delete-file-recursively
816 (find-files "." "__pycache__" #:directories? #t))
817 (for-each delete-file (find-files "." "\\.pyc$"))
819 (build-system python-build-system)
821 '(#:tests? #f)) ;FIXME: Some tests are failing.
823 ;; (modify-phases %standard-phases
825 ;; (add-after 'install 'check
826 ;; (lambda* (#:key inputs outputs #:allow-other-keys)
827 ;; (add-installed-pythonpath inputs outputs)
828 ;; (zero? (system* "py.test" "-v")))))
831 ("python-setuptools-scm" ,python-setuptools-scm)))
833 `(("python-execnet" ,python-execnet)
834 ("python-pytest" ,python-pytest)
835 ("python-py" ,python-py)))
837 "https://github.com/pytest-dev/pytest-xdist")
839 "Plugin for py.test with distributed testing and loop-on-failing modes")
841 "The pytest-xdist plugin extends py.test with some unique test execution
842 modes: parallelization, running tests in boxed subprocesses, the ability
843 to run tests repeatedly when failed, and the ability to run tests on multiple
844 Python interpreters or platforms. It uses rsync to copy the existing
845 program code to a remote location, executes there, and then syncs the
847 (license license:expat)))
849 (define-public python2-pytest-xdist
850 (package-with-python2 python-pytest-xdist))
852 (define-public python-scripttest
854 (name "python-scripttest")
860 "https://pypi.python.org/packages/source/s/scripttest/scripttest-"
864 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
865 (build-system python-build-system)
867 `(("python-pytest" ,python-pytest)))
868 (home-page "http://pythonpaste.org/scripttest/")
869 (synopsis "Python library to test command-line scripts")
870 (description "Scripttest is a Python helper library for testing
871 interactive command-line applications. With it you can run a script in a
872 subprocess and see the output as well as any file modifications.")
873 (license license:expat)))
875 (define-public python2-scripttest
876 (package-with-python2 python-scripttest))
878 (define-public python-testtools-bootstrap
880 (name "python-testtools-bootstrap")
885 (uri (pypi-uri "testtools" version))
888 "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))))
889 (build-system python-build-system)
890 (arguments '(#:tests? #f))
892 `(("python-extras" ,python-extras)
893 ("python-fixtures" ,python-fixtures-bootstrap)
894 ("python-mimeparse" ,python-mimeparse)
895 ("python-pbr" ,python-pbr-minimal)
896 ("python-six" ,python-six)
897 ("python-traceback2" ,python-traceback2)
898 ("python-unittest2" ,python-unittest2)))
899 (home-page "https://github.com/testing-cabal/testtools")
901 "Extensions to the Python standard library unit testing framework")
903 "This package is only for bootstrapping. Do not use this.")
904 (license license:psfl)))
906 (define-public python2-testtools-bootstrap
907 (package-with-python2 python-testtools-bootstrap))
909 (define-public python-testtools
911 (inherit python-testtools-bootstrap)
912 (name "python-testtools")
914 `(#:phases (modify-phases %standard-phases
917 (invoke "python" "-m" "testtools.run"
918 "testtools.tests.test_suite"))))))
920 `(("python-extras" ,python-extras)
921 ("python-fixtures" ,python-fixtures)
922 ("python-mimeparse" ,python-mimeparse)
923 ("python-pbr" ,python-pbr)
924 ("python-six" ,python-six)
925 ("python-traceback2" ,python-traceback2)
926 ("python-unittest2" ,python-unittest2)))
928 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
930 "Testtools extends the Python standard library unit testing framework to
931 provide matchers, more debugging information, and cross-Python
934 (define-public python2-testtools
935 (package-with-python2 python-testtools))
937 (define-public python-testscenarios-bootstrap
939 (name "python-testscenarios-bootstrap")
944 (uri (pypi-uri "testscenarios" version))
947 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
948 (build-system python-build-system)
950 `(#:phases (modify-phases %standard-phases
953 (invoke "python" "-m" "testtools.run"
954 "testscenarios.test_suite"))))))
956 `(("python-pbr" ,python-pbr-minimal)
957 ("python-testtools" ,python-testtools-bootstrap)))
958 (home-page "https://launchpad.net/testscenarios")
959 (synopsis "Pyunit extension for dependency injection")
961 "This package is only for bootstrapping. Don't use this.")
962 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
964 (define-public python2-testscenarios-bootstrap
965 (package-with-python2 python-testscenarios-bootstrap))
967 (define-public python-testscenarios
969 (inherit python-testscenarios-bootstrap)
970 (name "python-testscenarios")
972 `(("python-pbr" ,python-pbr)
973 ("python-testtools" ,python-testtools)))
975 "Testscenarios provides clean dependency injection for Python unittest
978 (define-public python2-testscenarios
979 (package-with-python2 python-testscenarios))
981 ;; Testresources requires python-pbr at runtime, but pbr needs it for its
982 ;; own tests. Hence this bootstrap variant.
983 (define-public python-testresources-bootstrap
985 (name "python-testresources-bootstrap")
989 (uri (pypi-uri "testresources" version))
992 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
993 (build-system python-build-system)
994 (arguments '(#:tests? #f))
996 `(("python-pbr" ,python-pbr-minimal)))
997 (home-page "https://launchpad.net/testresources")
999 "Pyunit extension for managing test resources")
1001 "This package is only here for bootstrapping purposes. Use the regular
1002 testresources package instead.")
1003 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1005 (define-public python2-testresources-bootstrap
1006 (package-with-python2 python-testresources-bootstrap))
1008 (define-public python-testresources
1010 (inherit python-testresources-bootstrap)
1011 (name "python-testresources")
1013 `(("python-pbr" ,python-pbr)))
1016 `(("python-fixtures" ,python-fixtures)
1017 ("python-testtols" ,python-testtools)))
1019 "Testresources is an extension to Python's unittest to allow declarative
1020 use of resources by test cases.")))
1022 (define-public python2-testresources
1023 (package-with-python2 python-testresources))
1025 (define-public python-subunit-bootstrap
1027 (name "python-subunit-bootstrap")
1032 (uri (pypi-uri "python-subunit" version))
1035 "1yii2gx3z6323as3iraj1yphj76dy7i3h6kj63pnc5y0hwjs5sgx"))))
1036 (build-system python-build-system)
1038 `(("python-extras" ,python-extras)
1039 ("python-testtools" ,python-testtools-bootstrap)))
1041 `(("python-fixtures" ,python-fixtures-bootstrap)
1042 ("python-hypothesis" ,python-hypothesis)
1043 ("python-testscenarios" ,python-testscenarios-bootstrap)))
1044 (home-page "http://launchpad.net/subunit")
1045 (synopsis "Python implementation of the subunit protocol")
1047 "This package is here for bootstrapping purposes only. Use the regular
1048 python-subunit package instead.")
1049 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1051 (define-public python2-subunit-bootstrap
1052 (package-with-python2 python-subunit-bootstrap))
1054 (define-public python-subunit
1056 (inherit python-subunit-bootstrap)
1057 (name "python-subunit")
1059 `(("python-extras" ,python-extras)
1060 ("python-testtools" ,python-testtools)))
1062 `(("python-fixtures" ,python-fixtures)
1063 ("python-hypothesis" ,python-hypothesis)
1064 ("python-testscenarios" ,python-testscenarios)))
1066 "Python-subunit is a Python implementation of the subunit test streaming
1069 (define-public python2-subunit
1070 (package-with-python2 python-subunit))
1072 ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
1073 ;; own tests. Hence this bootstrap variant.
1074 (define-public python-fixtures-bootstrap
1076 (name "python-fixtures-bootstrap")
1080 (uri (pypi-uri "fixtures" version))
1083 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
1084 (build-system python-build-system)
1085 (arguments `(#:tests? #f))
1087 `(("python-pbr-minimal" ,python-pbr-minimal)
1088 ("python-six" ,python-six)))
1089 (home-page "https://launchpad.net/python-fixtures")
1090 (synopsis "Python test fixture library")
1092 "This package is only used for bootstrapping. Use the regular
1093 python-fixtures package instead.")
1094 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1096 (define-public python2-fixtures-bootstrap
1097 (package-with-python2 python-fixtures-bootstrap))
1099 (define-public python-fixtures
1101 (inherit python-fixtures-bootstrap)
1102 (name "python-fixtures")
1105 (modify-phases %standard-phases
1108 (zero? (system* "python" "-m" "testtools.run"
1109 "fixtures.test_suite")))))))
1111 ;; Fixtures uses pbr at runtime to check versions, etc.
1112 `(("python-pbr" ,python-pbr)
1113 ("python-six" ,python-six)))
1115 `(("python-mock" ,python-mock)
1116 ("python-testtools" ,python-testtools-bootstrap)))
1118 "Fixtures provides a way to create reusable state, useful when writing
1121 (define-public python2-fixtures
1122 (package-with-python2 python-fixtures))
1124 (define-public python-testrepository-bootstrap
1126 (name "python-testrepository-bootstrap")
1132 "https://pypi.python.org/packages/source/t/testrepository/testrepository-"
1136 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1137 (build-system python-build-system)
1138 (arguments '(#:tests? #f))
1140 `(("python-fixtures" ,python-fixtures-bootstrap)
1141 ("python-subunit" ,python-subunit-bootstrap)
1142 ("python-testtools" ,python-testtools-bootstrap)))
1144 `(("python-mimeparse" ,python-mimeparse)))
1145 (home-page "https://launchpad.net/testrepository")
1146 (synopsis "Database for Python test results")
1148 "Bootstrap package for python-testrepository. Don't use this.")
1149 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1151 (define-public python2-testrepository-bootstrap
1152 (package-with-python2 python-testrepository-bootstrap))
1154 (define-public python-testrepository
1156 (inherit python-testrepository-bootstrap)
1157 (name "python-testrepository")
1159 ;; FIXME: Many tests are failing.
1162 `(("python-fixtures" ,python-fixtures)
1163 ("python-subunit" ,python-subunit)
1164 ("python-testtools" ,python-testtools)))
1166 `(("python-mimeparse" ,python-mimeparse)))
1167 (description "Testrepository provides a database of test results which can
1168 be used as part of a developer's workflow to check things such as what tests
1169 have failed since the last commit or what tests are currently failing.")))
1171 (define-public python2-testrepository
1172 (package-with-python2 python-testrepository))
1174 (define-public python-coverage
1176 (name "python-coverage")
1181 (uri (pypi-uri "coverage" version))
1184 "097l4s3ssxm1vncsn0nw3a1pbzah28773q36c1ab9wz01r04973s"))))
1185 (build-system python-build-system)
1187 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1189 (home-page "http://nedbatchelder.com/code/coverage")
1190 (synopsis "Code coverage measurement for Python")
1192 "Coverage measures code coverage, typically during test execution. It
1193 uses the code analysis tools and tracing hooks provided in the Python standard
1194 library to determine which lines are executable, and which have been
1196 (license license:bsd-3)))
1198 (define-public python2-coverage
1199 (package-with-python2 python-coverage))
1201 (define-public python-cov-core
1203 (name "python-cov-core")
1208 (uri (pypi-uri "cov-core" version))
1211 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1212 (build-system python-build-system)
1214 `(("python-coverage" ,python-coverage)))
1215 (home-page "https://github.com/schlamar/cov-core")
1216 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
1218 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1219 and @code{nose2-cov}. It is useful for developing coverage plugins for these
1220 testing frameworks.")
1221 (license license:expat)))
1223 (define-public python2-cov-core
1224 (package-with-python2 python-cov-core))
1226 (define-public python-testpath
1228 (name "python-testpath")
1233 (uri (string-append "https://github.com/jupyter/testpath/archive/"
1235 (file-name (string-append name "-" version ".tar.gz"))
1238 "04kh3fgvmqz6cfcw79q70qwjz7ib7lxm27cc548iy2rpr33qqf55"))))
1239 (build-system python-build-system)
1241 `(#:tests? #f ; this package does not even have a setup.py
1242 #:modules ((guix build python-build-system)
1245 #:imported-modules (,@%python-build-system-modules
1248 (modify-phases %standard-phases
1251 (lambda* (#:key inputs outputs #:allow-other-keys)
1252 (let* ((version (last
1253 (string-split (assoc-ref inputs "python") #\-)))
1254 (x.y (string-join (take (string-split version #\.) 2)
1257 (assoc-ref outputs "out")
1258 "/lib/python" x.y "/site-packages/testpath")))
1260 (copy-recursively "testpath" dir))
1262 (home-page "https://github.com/takluyver/testpath")
1263 (synopsis "Test utilities for code working with files and commands")
1265 "Testpath is a collection of utilities for Python code working with files
1266 and commands. It contains functions to check things on the file system, and
1267 tools for mocking system commands and recording calls to those.")
1268 (license license:expat)))
1270 (define-public python2-testpath
1271 (package-with-python2 python-testpath))
1273 (define-public python-testlib
1275 (name "python-testlib")
1281 "https://pypi.python.org/packages/source/t/testlib/testlib-"
1284 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1285 (build-system python-build-system)
1287 `(("unzip" ,unzip))) ; for unpacking the source
1288 (synopsis "Python micro test suite harness")
1289 (description "A micro unittest suite harness for Python.")
1290 (home-page "https://github.com/trentm/testlib")
1291 (license license:expat)))
1293 (define-public python2-testlib
1294 (package-with-python2 python-testlib))
1296 ;;; The software provided by this package was integrated into pytest 2.8.
1297 (define-public python-pytest-cache
1299 (name "python-pytest-cache")
1303 (uri (pypi-uri "pytest-cache" version))
1306 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1307 (build-system python-build-system)
1309 `(("python-apipkg" ,python-apipkg)
1310 ("python-execnet" ,python-execnet)
1311 ("python-py" ,python-py)
1312 ("python-pytest" ,python-pytest)))
1313 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1314 (description "The pytest-cache plugin provides tools to rerun failures from
1315 the last py.test invocation.")
1316 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1317 (license license:expat)))
1319 (define-public python2-pytest-cache
1320 (package-with-python2 python-pytest-cache))
1322 (define-public python-pytest-localserver
1324 (name "python-pytest-localserver")
1328 (uri (pypi-uri "pytest-localserver" version))
1331 "08f06rvj31wqf0vgmd1waya87r7vy6x8ck48lxl3dxy83q5gcam7"))))
1332 (build-system python-build-system)
1334 `(#:phases (modify-phases %standard-phases
1337 (zero? (system* "py.test" "--genscript=runtests.py"))
1338 (zero? (system* "py.test")))))))
1340 `(("python-pytest" ,python-pytest)
1341 ("python-requests" ,python-requests)
1342 ("python-six" ,python-six)))
1344 `(("python-werkzeug" ,python-werkzeug)))
1345 (synopsis "Py.test plugin to test server connections locally")
1346 (description "Pytest-localserver is a plugin for the pytest testing
1347 framework which enables you to test server connections locally.")
1348 (home-page "https://pypi.python.org/pypi/pytest-localserver")
1349 (license license:expat)))
1351 (define-public python-pytest-xprocess
1353 (name "python-pytest-xprocess")
1357 (uri (pypi-uri "pytest-xprocess" version))
1360 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1361 (build-system python-build-system)
1363 `(("python-pytest" ,python-pytest)
1364 ("python-pytest-cache" ,python-pytest-cache)
1365 ("python-psutil" ,python-psutil)))
1366 (synopsis "Pytest plugin to manage external processes across test runs")
1367 (description "Pytest-xprocess is an experimental py.test plugin for managing
1368 processes across test runs.")
1369 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1370 (license license:expat)))
1372 (define-public python-pytest-subtesthack
1374 (name "python-pytest-subtesthack")
1378 (uri (pypi-uri "pytest-subtesthack" version))
1381 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1382 (build-system python-build-system)
1384 `(("python-pytest" ,python-pytest)))
1385 (synopsis "Set-up and tear-down fixtures for unit tests")
1386 (description "This plugin allows you to set up and tear down fixtures within
1387 unit test functions that use @code{py.test}. This is useful for using
1388 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1389 function multiple times, without setting up or tearing down fixture state as is
1390 normally the case.")
1391 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1392 (license license:unlicense)))
1394 (define-public python2-pytest-subtesthack
1395 (package-with-python2 python-pytest-subtesthack))
1397 (define-public python-hypothesis
1399 (name "python-hypothesis")
1403 (uri (pypi-uri "hypothesis" version))
1406 "0g54cypfi5qj6cgxfr7l1nb41r1cqhhngx4qxn4ga9h720rcsbr8"))))
1407 (build-system python-build-system)
1409 `(("python-flake8" ,python-flake8)
1410 ("python-pytest" ,python-pytest-bootstrap)))
1412 `(("python-attrs" ,python-attrs-bootstrap)
1413 ("python-coverage" ,python-coverage)))
1414 (synopsis "Library for property based testing")
1415 (description "Hypothesis is a library for testing your Python code against a
1416 much larger range of examples than you would ever want to write by hand. It’s
1417 based on the Haskell library, Quickcheck, and is designed to integrate
1418 seamlessly into your existing Python unit testing work flow.")
1419 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
1420 (license license:mpl2.0)
1421 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1423 (define-public python2-hypothesis
1424 (let ((hypothesis (package-with-python2
1425 (strip-python2-variant python-hypothesis))))
1426 (package (inherit hypothesis)
1428 `(("python2-enum34" ,python2-enum34)
1429 ,@(package-propagated-inputs hypothesis))))))
1431 (define-public python-lit
1438 (uri (pypi-uri "lit" version))
1441 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
1442 (build-system python-build-system)
1445 (modify-phases %standard-phases
1448 (invoke "python" "lit.py" "tests"))))))
1451 (home-page "https://llvm.org/")
1452 (synopsis "LLVM Software Testing Tool")
1453 (description "@code{lit} is a portable tool for executing LLVM and Clang
1454 style test suites, summarizing their results, and providing indication of
1456 (license license:ncsa)))
1458 (define-public python2-lit
1459 (package-with-python2 python-lit))
1461 (define-public python-pytest-pep8
1463 (name "python-pytest-pep8")
1467 (uri (pypi-uri "pytest-pep8" version))
1470 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
1471 (build-system python-build-system)
1473 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
1475 `(("python-pytest" ,python-pytest)))
1477 `(("python-pep8" ,python-pep8)))
1478 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
1479 (synopsis "Py.test plugin to check PEP8 requirements")
1480 (description "Pytest plugin for checking PEP8 compliance.")
1481 (license license:expat)))
1483 (define-public python2-pytest-pep8
1484 (package-with-python2 python-pytest-pep8))
1486 (define-public python-pytest-flakes
1488 (name "python-pytest-flakes")
1492 (uri (pypi-uri "pytest-flakes" version))
1495 "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
1496 (build-system python-build-system)
1499 (modify-phases %standard-phases
1501 (add-after 'install 'check
1502 (lambda* (#:key outputs inputs #:allow-other-keys)
1503 ;; It's easier to run tests after install.
1504 ;; Make installed package available for running the tests
1505 (add-installed-pythonpath inputs outputs)
1506 (zero? (system* "py.test" "-vv")))))))
1508 `(("python-coverage" ,python-coverage)
1509 ("python-pytest" ,python-pytest)
1510 ("python-pytest-cache" ,python-pytest-cache)
1511 ("python-pytest-pep8" ,python-pytest-pep8)))
1513 `(("python-pyflakes" ,python-pyflakes)))
1514 (home-page "https://github.com/fschulze/pytest-flakes")
1515 (synopsis "Py.test plugin to check source code with pyflakes")
1516 (description "Pytest plugin for checking Python source code with pyflakes.")
1517 (license license:expat)))
1519 (define-public python2-pytest-flakes
1520 (package-with-python2 python-pytest-flakes))
1522 (define-public python2-coverage-test-runner
1524 (name "python2-coverage-test-runner")
1530 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
1531 "coverage-test-runner/snapshot/coverage-test-runner-"
1535 "0y1m7z3dl63kmhcmydl1mwg0hacnf6ghrx9dah17j9iasssfa3g7"))))
1536 (build-system python-build-system)
1538 `(#:python ,python-2
1540 (modify-phases %standard-phases
1543 (zero? (system* "./testrun")))))))
1545 `(("python2-coverage" ,python2-coverage)))
1546 (home-page "https://liw.fi/coverage-test-runner/")
1547 (synopsis "Python module for running unit tests")
1548 (description "@code{CoverageTestRunner} is a python module for running
1549 unit tests and failing them if the unit test module does not exercise all
1550 statements in the module it tests.")
1551 (license license:gpl3+)))
1553 (define-public python-pylint
1555 (name "python-pylint")
1561 "https://github.com/PyCQA/pylint/archive/pylint-"
1565 "0mzn1czhf1mgr2wiqfihb274sja02h899b85kywdpivppa9nwrmp"))))
1566 (build-system python-build-system)
1568 `(("python-pytest" ,python-pytest)
1569 ("python-pytest-runner" ,python-pytest-runner)
1570 ("python-tox" ,python-tox)))
1572 `(("python-astroid" ,python-astroid)
1573 ("python-isort" ,python-isort)
1574 ("python-mccabe" ,python-mccabe)
1575 ("python-six" ,python-six)))
1578 (modify-phases %standard-phases
1581 ;; Somehow, tests for python2-pylint
1582 ;; fail if run from the build directory
1583 (let ((work "/tmp/work"))
1585 (setenv "PYTHONPATH"
1586 (string-append (getenv "PYTHONPATH") ":" work))
1587 (copy-recursively "." work)
1588 (with-directory-excursion "/tmp"
1589 (zero? (system* "python" "-m" "unittest" "discover"
1590 "-s" (string-append work "/pylint/test")
1591 "-p" "*test_*.py")))))))))
1592 (home-page "https://github.com/PyCQA/pylint")
1593 (synopsis "Python source code analyzer which looks for coding standard
1595 (description "Pylint is a Python source code analyzer which looks
1596 for programming errors, helps enforcing a coding standard and sniffs
1597 for some code smells (as defined in Martin Fowler's Refactoring book).
1599 Pylint has many rules enabled by default, way too much to silence them
1600 all on a minimally sized program. It's highly configurable and handle
1601 pragmas to control it from within your code. Additionally, it is
1602 possible to write plugins to add your own checks.")
1603 (properties `((python2-variant . ,(delay python2-pylint))))
1604 (license license:gpl2+)))
1606 (define-public python2-pylint
1607 (let ((pylint (package-with-python2
1608 (strip-python2-variant python-pylint))))
1609 (package (inherit pylint)
1611 `(("python2-backports-functools-lru-cache"
1612 ,python2-backports-functools-lru-cache)
1613 ("python2-configparser" ,python2-configparser)
1614 ,@(package-propagated-inputs pylint))))))
1616 (define-public python-paramunittest
1618 (name "python-paramunittest")
1623 (uri (pypi-uri "ParamUnittest" version))
1626 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
1627 (build-system python-build-system)
1629 "https://github.com/rik0/ParamUnittest")
1631 "Simple extension to have parametrized unit tests")
1633 "This package allows to create parametrized unit-tests that work with the standard
1634 unittest package. A parametrized test case is automatically converted to multiple test
1635 cases. Since they are TestCase subclasses, they work with other test suites that
1636 recognize TestCases.")
1637 (license license:bsd-2)))
1639 (define-public python2-python-paramunittest
1640 (package-with-python2 python-paramunittest))
1642 (define-public python-pytest-warnings
1644 (name "python-pytest-warnings")
1649 (uri (pypi-uri "pytest-warnings" version))
1652 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
1653 (build-system python-build-system)
1655 `(("pytest" ,python-pytest)))
1656 (home-page "https://github.com/fschulze/pytest-warnings")
1657 (synopsis "Pytest plugin to list Python warnings in pytest report")
1659 "Python-pytest-warnings is a pytest plugin to list Python warnings in
1661 (license license:expat)
1662 (properties `((python2-variant . ,(delay python2-pytest-warnings))
1663 ;; This package is part of pytest as of version 3.1.0.
1664 (superseded . ,python-pytest)))))
1666 (define-public python2-pytest-warnings
1667 (package (inherit (package-with-python2
1668 (strip-python2-variant python-pytest-warnings)))
1669 (properties `((superseded . ,python2-pytest)))))
1671 (define-public python-pytest-capturelog
1673 (name "python-pytest-capturelog")
1678 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
1681 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
1682 (build-system python-build-system)
1684 `(("pytest" ,python-pytest)))
1685 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
1686 (synopsis "Pytest plugin to catch log messages")
1688 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
1689 (license license:expat)))
1691 (define-public python2-pytest-capturelog
1692 (package-with-python2 python-pytest-capturelog))
1694 (define-public python-pytest-catchlog
1696 (name "python-pytest-catchlog")
1701 (uri (pypi-uri "pytest-catchlog" version ".zip"))
1704 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
1705 (build-system python-build-system)
1707 `(("unzip" ,unzip)))
1709 `(("pytest" ,python-pytest)))
1710 (home-page "https://github.com/eisensheng/pytest-catchlog")
1711 (synopsis "Pytest plugin to catch log messages")
1713 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
1714 a fork of pytest-capturelog.")
1715 (license license:expat)))
1717 (define-public python2-pytest-catchlog
1718 (package-with-python2 python-pytest-catchlog))
1720 (define-public python-nosexcover
1722 (name "python-nosexcover")
1726 (uri (pypi-uri "nosexcover" version))
1729 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
1730 (build-system python-build-system)
1732 `(("python-coverage" ,python-coverage)
1733 ("python-nose" ,python-nose)))
1734 (home-page "http://github.com/cmheisel/nose-xcover")
1735 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
1736 (description "Nose-xcover is a companion to the built-in
1737 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
1738 to a file named coverage.xml.
1740 It will honor all the options you pass to the Nose coverage plugin,
1741 especially -cover-package.")
1742 (license license:expat)))
1744 (define-public python2-nosexcover
1745 (package-with-python2 python-nosexcover))
1747 (define-public python-discover
1749 (name "python-discover")
1755 "https://pypi.python.org/packages/source/d/discover/discover-"
1759 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
1760 (build-system python-build-system)
1761 (home-page "http://pypi.python.org/pypi/discover/")
1763 "Python test discovery for unittest")
1765 "Discover provides test discovery for unittest, a feature that has been
1766 backported from Python 2.7 for Python 2.4+.")
1767 (license license:bsd-3)))
1769 (define-public python2-discover
1770 (package-with-python2 python-discover))
1772 (define-public behave
1778 (uri (pypi-uri "behave" version))
1781 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))))
1782 (build-system python-build-system)
1784 `(("python-mock" ,python-mock)
1785 ("python-nose" ,python-nose)
1786 ("python-pathpy" ,python-pathpy)
1787 ("python-pyhamcrest" ,python-pyhamcrest)
1788 ("python-pytest" ,python-pytest)))
1790 `(("python-six" ,python-six)
1791 ("python-parse" ,python-parse)
1792 ("python-parse-type" ,python-parse-type)))
1794 '(#:test-target "behave_test"))
1795 (home-page "https://github.com/behave/behave")
1796 (synopsis "Python behavior-driven development")
1798 "Behave is a tool for behavior-driven development in python.
1799 Behavior-driven development (or BDD) is an agile software development
1800 technique that encourages collaboration between developers, QA and
1801 non-technical or business participants in a software project. Behave uses
1802 tests written in a natural language style, backed up by Python code.")
1803 (license license:x11)))
1805 (define-public python-behave-web-api
1807 (name "python-behave-web-api")
1812 (uri (pypi-uri "behave-web-api" version))
1815 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
1816 (build-system python-build-system)
1819 (modify-phases %standard-phases
1820 (add-after 'unpack 'fix-dependencies
1822 (substitute* "setup.py"
1823 (("'wheel'") "") ; We don't use it.
1824 (("'ordereddict==1.1'") ""))))))) ; Python >= 2.7 has it built-in.
1826 `(("behave" ,behave)
1827 ("python-requests" ,python-requests)))
1828 (home-page "https://github.com/jefersondaniel/behave-web-api")
1829 (synopsis "Provides testing for JSON APIs with Behave for Python")
1830 (description "This package provides testing utility modules for testing
1831 JSON APIs with Behave.")
1832 (license license:expat)))
1834 (define-public python2-behave-web-api
1835 (package-with-python2 python-behave-web-api))
1837 (define-public python-rednose
1839 (name "python-rednose")
1844 (uri (pypi-uri "rednose" version))
1847 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
1848 (build-system python-build-system)
1850 `(#:phases (modify-phases %standard-phases
1851 (add-after 'unpack 'patch-setup.py
1853 ;; Six is only required for tests and later versions
1855 (substitute* "setup.py"
1856 (("six==1.10.0") "six"))
1859 `(("python-colorama" ,python-colorama)
1860 ("python-termstyle" ,python-termstyle)))
1862 `(("python-six" ,python-six)
1863 ("python-nose" ,python-nose)))
1864 (home-page "https://github.com/JBKahn/rednose")
1865 (synopsis "Colored output for Python nosetests")
1866 (description "This package provides colored output for the
1867 @command{nosetests} command of the Python Nose unit test framework.")
1868 (license license:bsd-3)))
1870 (define-public python2-rednose
1871 (package-with-python2 python-rednose))
1873 (define-public python-nose-randomly
1875 (name "python-nose-randomly")
1880 (uri (pypi-uri "nose-randomly" version))
1883 "1cw9dlr1zh3w4i438kin7z0rm8092ki52hayisyc43h9pcplq7rn"))))
1884 (build-system python-build-system)
1886 `(("python-nose" ,python-nose)
1887 ("python-numpy" ,python-numpy)))
1888 (home-page "https://github.com/adamchainz/nose-randomly")
1890 "Nose plugin to randomly order tests and control random.seed")
1892 "This is a @code{Nose} plugin to randomly order tests which can be quite
1893 powerful in discovering hidden flaws in the tests themselves, while helping to
1894 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
1895 by resetting it to a repeatable number for each test, enabling the tests to
1896 create data based on random numbers and yet remain repeatable.")
1897 (license license:bsd-3)))
1899 (define-public python2-nose-randomly
1900 (package-with-python2 python-nose-randomly))
1902 (define-public python-nose-timer
1904 (name "python-nose-timer")
1909 (uri (pypi-uri "nose-timer" version))
1912 ;; This patch will not be needed in the next version.
1913 ;; It is taken from the master branch.
1914 "python-nose-timer-drop-ordereddict.patch"))
1917 "1s32ymsnby8lz2qk55ifj9zi50dqcg6swnj5cz2rmwxg2jsslsxp"))))
1918 (build-system python-build-system)
1920 `(("python-nose" ,python-nose)
1921 ("python-termcolor" ,python-termcolor)))
1922 (home-page "https://github.com/mahmoudimus/nose-timer")
1923 (synopsis "Timer plugin for nosetests")
1924 (description "Shows how much time was needed to run individual tests.")
1925 (license license:expat)))
1927 (define-public python2-nose-timer
1928 (package-with-python2 python-nose-timer))
1930 (define-public python-freezegun
1932 (name "python-freezegun")
1937 (uri (pypi-uri "freezegun" version))
1940 "1vhf3kgdy7gpy70n3bxa3y1n6aza316137md97z8p5k0gz6wqg3q"))))
1941 (build-system python-build-system)
1943 `(("python-mock" ,python-mock)
1944 ("python-nose" ,python-nose)
1945 ("python-coverage" ,python-coverage)))
1947 `(("python-six" ,python-six)
1948 ("python-dateutil" ,python-dateutil)))
1951 (modify-phases %standard-phases
1952 ;; The tests are normally executed via `make test`, but the PyPi
1953 ;; package does not include the Makefile.
1956 (zero? (system* "nosetests" "./tests/")))))))
1957 (home-page "https://github.com/spulec/freezegun")
1958 (synopsis "Test utility for mocking the datetime module")
1960 "FreezeGun is a library that allows your python tests to travel through
1961 time by mocking the datetime module.")
1962 (license license:asl2.0)))
1964 (define-public python2-freezegun
1965 (package-with-python2 python-freezegun))
1967 (define-public python-flexmock
1969 (name "python-flexmock")
1973 (uri (pypi-uri "flexmock" version))
1976 "0arc6njvs6i9v9hgvzk5m50296g7zy5m9d7pyb43vdsdgxrci5gy"))))
1977 (build-system python-build-system)
1978 (home-page "https://flexmock.readthedocs.org")
1979 (synopsis "Testing library for Python")
1981 "flexmock is a testing library for Python that makes it easy to create
1982 mocks, stubs and fakes.")
1983 (license license:bsd-3)))
1985 (define-public python2-flexmock
1986 (package-with-python2 python-flexmock))
1988 (define-public python-flaky
1990 (name "python-flaky")
1994 (uri (pypi-uri "flaky" version))
1997 "18pkmf79rfkfpy1d2rrx3v55nxj762ilyk9rvd6s6dccxw58imsa"))))
1998 (build-system python-build-system)
2000 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2002 (home-page "https://github.com/box/flaky")
2003 (synopsis "Automatically rerun flaky tests")
2005 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2008 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2009 on components that aren't 100% reliable. With flaky, instead of removing
2010 those tests or marking them to @code{@@skip}, they can be automatically
2012 (license license:asl2.0)))
2014 (define-public python2-flaky
2015 (package-with-python2 python-flaky))
2017 (define-public python-pyhamcrest
2019 (name "python-pyhamcrest")
2025 "https://github.com/hamcrest/PyHamcrest/archive/V"
2029 (string-append name "-" version ".tar.gz"))
2032 "1lqjajhwf7x7igvvnj5p1cm31y9njy07qby94w18kl6zwbdjqrwy"))))
2033 (native-inputs ; All native inputs are for tests
2034 `(("python-pytest-cov" ,python-pytest-cov)
2035 ("python-mock" ,python-mock)
2036 ("python-pytest" ,python-pytest)
2037 ("python-hypothesis" ,python-hypothesis)))
2039 `(("python-six" ,python-six)))
2040 (build-system python-build-system)
2041 (home-page "http://hamcrest.org/")
2042 (synopsis "Hamcrest matchers for Python")
2044 "PyHamcrest is a framework for writing matcher objects,
2045 allowing you to declaratively define \"match\" rules.")
2046 (license license:bsd-3)))
2048 (define-public python2-pyhamcrest
2049 (package-with-python2 python-pyhamcrest))
2051 (define-public unittest-cpp
2053 (name "unittest-cpp")
2058 "https://github.com/unittest-cpp/unittest-cpp/archive/v"
2060 (file-name (string-append name "-" version ".tar.gz"))
2062 (base32 "1fgmna2la7z4pwwy2gd10gpgi2q1fk89npjfvkmzvhkxhyc231bl"))))
2064 `(#:tests? #f)) ; It's run after build automatically.
2065 (build-system cmake-build-system)
2066 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2067 (synopsis "Lightweight unit testing framework for C++")
2068 (description "UnitTest++ is a lightweight unit testing framework for C++.
2069 It was designed to do test-driven development on a wide variety of platforms.
2070 Simplicity, portability, speed, and small footprint are all very important
2071 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2072 of advanced library and language features, which means it should be easily
2073 portable to just about any platform.")
2074 (license license:expat)))