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 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 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 (add-before 'configure 'autoconf
109 (zero? (system* "autoreconf" "-vfi")))))))
111 `(("automake" ,automake)
112 ("autoconf" ,autoconf)
113 ("libtool" ,libtool)))
114 (home-page "http://cunit.sourceforge.net/")
115 (synopsis "Automated testing framework for C")
117 "CUnit is a lightweight system for writing, administering, and running
118 unit tests in C. It provides C programmers with basic testing functionality
119 with a flexible variety of user interfaces.")
120 (license license:gpl2+)))
122 (define-public cppunit
128 (uri (string-append "http://dev-www.libreoffice.org/src/"
129 name "-" version ".tar.gz"))
132 "17s2kzmkw3kfjhpp72rfppyd7syr7bdq5s69syj2nvrlwd3d4irz"))))
133 ;; Explicitly link with libdl. This is expected to be done by packages
134 ;; relying on cppunit for their tests. However, not all of them do.
135 ;; If we added the linker flag to such packages, we would pollute all
136 ;; binaries, not only those used for testing.
138 `(#:make-flags '("LDFLAGS=-ldl")))
139 (build-system gnu-build-system)
140 (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
141 (synopsis "Unit testing framework for C++")
142 (description "CppUnit is the C++ port of the famous JUnit framework for
143 unit testing. Test output is in XML for automatic testing and GUI based for
145 (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
147 ;; Some packages require this newer version of cppunit. However, it needs
148 ;; C++11 support, which is not enabled by default in our current GCC, and
149 ;; updating in-place would require adding CXXFLAGS to many dependent packages.
150 ;; Thus, keep as a separate variable for now.
151 ;; TODO: Remove this when our default GCC is updated to 6 or higher.
152 (define-public cppunit-1.14
158 (uri (string-append "https://dev-www.libreoffice.org/src/"
159 "cppunit-" version ".tar.gz"))
162 "1027cyfx5gsjkdkaf6c2wnjh68882grw8n672018cj3vs9lrhmix"))))))
164 ;; When dependent packages upgraded to use newer version of catch, this one should
166 (define-public catch-framework
169 (version "1.3.5") ;Sub-minor is the build number
173 (url "https://github.com/philsquared/Catch")
175 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
176 (file-name (string-append name "-" version))
179 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
180 (build-system trivial-build-system)
182 `(#:modules ((guix build utils))
184 (use-modules (guix build utils))
185 (let* ((source (assoc-ref %build-inputs "source"))
186 (output (assoc-ref %outputs "out"))
187 (incdir (string-append output "/include"))
188 (docdir (string-append output "/share/doc/catch-"
191 (for-each mkdir-p (list incdir docdir))
192 (install-file (string-append source
193 "/single_include/catch.hpp")
195 (copy-recursively (string-append source "/docs")
197 (home-page "http://catch-lib.net/")
198 (synopsis "Automated test framework for C++ and Objective-C")
200 "Catch stands for C++ Automated Test Cases in Headers and is a
201 multi-paradigm automated test framework for C++ and Objective-C.")
202 (license license:boost1.0)))
204 (define-public catch-framework2
208 (home-page "https://github.com/catchorg/Catch2")
211 (uri (string-append home-page "/archive/v" version ".tar.gz"))
214 "0g2ysxc6adqca5wh7nsicnxb9wkxg75cd5izjsl39rcj0v903gr7"))
215 (file-name (string-append name "-" version ".tar.gz"))))
216 (build-system cmake-build-system)
217 (synopsis "Automated test framework for C++ and Objective-C")
218 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
219 a multi-paradigm automated test framework for C++ and Objective-C.")
220 (license license:boost1.0)))
222 (define-public cmdtest
228 (uri (string-append "http://git.liw.fi/cmdtest/snapshot/"
229 name "-" version ".tar.gz"))
232 "1jmfiyrrqmpvwdb273bkb8hjaf4rwx9njblx29pmr7giyahskwi5"))))
233 (build-system python-build-system)
237 (modify-phases %standard-phases
238 ;; check phase needs to be run before the build phase. If not, the
239 ;; coverage test runner looks for tests for the built source files,
242 (add-before 'build 'check
245 (("/bin/sh") (which "sh")))
246 ;; yarn uses python2-ttystatus to print messages.
247 ;; python2-ttystatus requires /dev/tty which is not present in
248 ;; the build environment. Hence assuming-failure test fails.
249 (delete-file "yarn.tests/assuming-failure.script")
250 (delete-file "yarn.tests/assuming-failure.stdout")
251 (zero? (system* "python" "setup.py" "check")))))))
253 `(("python2-coverage-test-runner" ,python2-coverage-test-runner)))
255 `(("python2-cliapp" ,python2-cliapp)
256 ("python2-markdown" ,python2-markdown)
257 ("python2-ttystatus" ,python2-ttystatus)))
258 (home-page "https://liw.fi/cmdtest/")
259 (synopsis "Black box Unix program tester")
261 "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
262 given a command line and input files, and the expected output, and it verifies
263 that the command line produces the expected output. If not, it reports a
264 problem, and shows the differences.")
265 (license license:gpl3+)))
267 (define-public cmocka
273 (uri (string-append "https://cmocka.org/files/"
274 (version-major+minor version) "/cmocka-"
278 "1283zi9qf5613g8iadm1fxmjh4rzxqd5np2j3lcpgairf25g8bph"))))
279 (build-system cmake-build-system)
281 `(#:tests? #f)) ; No test target
282 (home-page "https://cmocka.org/")
283 (synopsis "Unit testing framework for C")
284 (description "Cmocka is a unit testing framework for C with support for
285 mock objects. It only requires the standard C library, and works with
286 different compilers. Cmocka supports several different message output formats
287 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
289 (license license:asl2.0)))
291 (define-public cppcheck
297 (uri (string-append "https://github.com/danmar/cppcheck/archive/"
300 (base32 "15ghxwmyy09cd9mi008k4jn09c441j86qyaa4dz0is7f5dv5cdkx"))
301 (file-name (string-append name "-" version ".tar.gz"))))
302 (build-system cmake-build-system)
303 (home-page "http://cppcheck.sourceforge.net")
304 (synopsis "Static C/C++ code analyzer")
305 (description "Cppcheck is a static code analyzer for C and C++. Unlike
306 C/C++ compilers and many other analysis tools it does not detect syntax errors
307 in the code. Cppcheck primarily detects the types of bugs that the compilers
308 normally do not detect. The goal is to detect only real errors in the code
309 (i.e. have zero false positives).")
310 (license license:gpl3+)))
312 (define-public go-gopkg.in-check.v1
313 (let ((commit "20d25e2804050c1cd24a7eea1e7a6447dd0e74ec")
316 (name "go-gopkg.in-check.v1")
317 (version (git-version "0.0.0" revision commit))
321 (url "https://github.com/go-check/check.git")
323 (file-name (git-file-name name version))
326 "0k1m83ji9l1a7ng8a7v40psbymxasmssbrrhpdv2wl4rhs0nc3np"))))
327 (build-system go-build-system)
329 '(#:import-path "gopkg.in/check.v1"))
330 (synopsis "Rich testing extension for Go's testing package")
332 "@code{check} is a rich testing extension for Go's testing package.")
333 (home-page "https://github.com/go-check/check")
334 (license license:bsd-2))))
336 (define-public go-github.com-smartystreets-gunit
338 (name "go-github.com-smartystreets-gunit")
343 (url "https://github.com/smartystreets/gunit")
345 (file-name (git-file-name name version))
348 "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
349 (build-system go-build-system)
351 '(;; TODO: This package depends on go-github.com-smartystreets-assertions
352 ;; for running the tests, but go-github.com-smartystreets-assertions
353 ;; depends on this package, so break this loop by not running the tests
356 #:import-path "github.com/smartystreets/gunit"))
357 (synopsis "Testing tool for Go, in the style of xUnit")
359 "@code{gunit} allows the test author to use a struct as the scope for a
360 group of related test cases, in the style of xUnit fixtures. This makes
361 extraction of setup/teardown behavior (as well as invoking the system under
362 test) much simpler.")
363 (home-page "https://github.com/smartystreets/gunit")
364 (license license:expat)))
366 (define-public go-github.com-smartystreets-assertions
368 (name "go-github.com-smartystreets-assertions")
373 (url "https://github.com/smartystreets/assertions")
375 (file-name (git-file-name name version))
378 "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
379 (build-system go-build-system)
381 '(#:import-path "github.com/smartystreets/assertions"))
383 `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
384 (synopsis "Assertions for testing with Go")
386 "The @code{assertions} package provides convinient assertion functions
387 for writing tests in Go.")
388 (home-page "https://github.com/smartystreets/assertions")
389 (license license:expat)))
391 (define-public go-github.com-smartystreets-goconvey
393 (name "go-github.com-smartystreets-goconvey")
398 (url "https://github.com/smartystreets/goconvey")
400 (file-name (git-file-name name version))
403 "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
404 (build-system go-build-system)
406 '(#:import-path "github.com/smartystreets/goconvey"))
408 `(("go-github.com-jtolds-gls" ,go-github.com-jtolds-gls)
409 ("go-github.com-smartystreets-assertions" ,go-github.com-smartystreets-assertions)))
410 (synopsis "Go testing tool with both a web and terminal user interface")
412 "GoConvey is a testing tool for Go. It integrates with go test, can show
413 test coverage and has a web user interface that will refresh automatically.")
414 (home-page "https://github.com/smartystreets/goconvey")
415 (license license:expat)))
417 ;; XXX When updating, check whether ZNC's GOOGLETEST-SOURCES can be
418 ;; switched back to simply using (PACKAGE-SOURCE ...).
419 (define-public googletest
426 (uri (string-append "https://github.com/google/googletest/archive/"
427 "release-" version ".tar.gz"))
428 (file-name (string-append name "-" version ".tar.gz"))
431 "1n5p1m2m3fjrjdj752lf92f9wq3pl5cbsfrb49jqbg52ghkz99jq"))))
432 (build-system cmake-build-system)
434 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
436 `(("python-2" ,python-2)))
437 (home-page "https://github.com/google/googletest/")
438 (synopsis "Test discovery and XUnit test framework")
439 (description "Google Test features an XUnit test framework, automated test
440 discovery, death tests, assertions, parameterized tests and XML test report
442 (license license:bsd-3)))
444 (define-public cpputest
451 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
452 version "/cpputest-" version ".tar.gz"))
455 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
456 (build-system gnu-build-system)
458 `(("googletest" ,googletest)))
459 (home-page "https://cpputest.github.io/")
460 (synopsis "Unit testing and mocking framework for C/C++")
462 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
463 C++ but is used in C and C++ projects and frequently used in embedded systems
464 but it works for any C/C++ project.")
465 (license license:bsd-3)))
467 (define-public python-parameterized
469 (name "python-parameterized")
474 (uri (pypi-uri "parameterized" version))
477 "1qj1939shm48d9ql6fm1nrdy4p7sdyj8clz1szh5swwpf1qqxxfa"))))
478 (build-system python-build-system)
479 (arguments '(#:tests? #f)) ; there are no tests
480 (home-page "https://github.com/wolever/parameterized")
481 (synopsis "Parameterized testing with any Python test framework")
483 "Parameterized is a Python library that aims to fix parameterized testing
484 for every Python test framework. It supports nose, py.test, and unittest.")
485 (license license:bsd-2)))
487 (define-public python2-parameterized
488 (package-with-python2 python-parameterized))
490 (define-public python-mock
497 (uri (pypi-uri "mock" version))
500 "1flbpksir5sqrvq2z0dp8sl4bzbadg21sj4d42w3klpdfvgvcn5i"))))
502 `(("python-pbr" ,python-pbr-minimal)
503 ("python-six" ,python-six)))
504 (build-system python-build-system)
506 `(("python-unittest2" ,python-unittest2)))
509 (modify-phases %standard-phases
512 (zero? (system* "unit2")))))))
513 (home-page "https://github.com/testing-cabal/mock")
514 (synopsis "Python mocking and patching library for testing")
516 "Mock is a library for testing in Python. It allows you to replace parts
517 of your system under test with mock objects and make assertions about how they
519 (properties `((python2-variant . ,(delay python2-mock))))
520 (license license:expat)))
522 (define-public python2-mock
523 (let ((base (package-with-python2
524 (strip-python2-variant python-mock))))
525 (package (inherit base)
527 `(("python2-functools32" ,python2-functools32)
528 ("python2-funcsigs" ,python2-funcsigs)
529 ,@(package-propagated-inputs base))))))
531 (define-public python-nose
538 (uri (pypi-uri "nose" version))
541 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
542 (build-system python-build-system)
544 '(#:tests? #f)) ; FIXME: test suite fails
545 (home-page "http://readthedocs.org/docs/nose/")
546 (synopsis "Python testing library")
548 "Nose extends the unittest library to make testing easier.")
549 (license license:lgpl2.0+)))
551 (define-public python2-nose
552 (package-with-python2 python-nose))
554 (define-public python-nose2
556 (name "python-nose2")
561 (uri (pypi-uri "nose2" version))
564 "1x4zjq1zlyrh8b9ba0cmafd3w94pxhid408kibyjd3s6h1lap6s7"))))
565 (build-system python-build-system)
566 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
568 `(("python-cov-core" ,python-cov-core)
569 ("python-pytest-cov" ,python-pytest-cov)
570 ("python-six" ,python-six)))
571 (home-page "https://github.com/nose-devs/nose2")
572 (synopsis "Next generation of nicer testing for Python")
574 "Nose2 is the next generation of nicer testing for Python, based on the
575 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
576 better plugin api, being easier for users to configure, and simplifying internal
577 interfaces and processes.")
578 (license license:bsd-2)))
580 (define-public python2-nose2
581 (package-with-python2 python-nose2))
583 (define-public python-unittest2
585 (name "python-unittest2")
590 (uri (pypi-uri "unittest2" version))
592 (search-patches "python-unittest2-python3-compat.patch"
593 "python-unittest2-remove-argparse.patch"))
596 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
597 (build-system python-build-system)
600 (modify-phases %standard-phases
603 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
605 `(("python-six" ,python-six)
606 ("python-traceback2" ,python-traceback2)))
607 (home-page "http://pypi.python.org/pypi/unittest2")
608 (synopsis "Python unit testing library")
610 "Unittest2 is a replacement for the unittest module in the Python
612 (license license:psfl)))
614 (define-public python2-unittest2
615 (package-with-python2 python-unittest2))
617 (define-public python-pytest
619 (name "python-pytest")
624 (uri (pypi-uri "pytest" version))
627 "0g6w86ks73fnrnsyib9ii2rbyx830vn7aglsjqz9v1n2xwbndyi7"))))
628 (build-system python-build-system)
631 (modify-phases %standard-phases
632 (add-before 'check 'disable-invalid-tests
634 ;; Some tests involves the /usr directory, and fails.
635 (substitute* "testing/test_argcomplete.py"
636 (("def test_remove_dir_prefix\\(self\\):")
637 "@pytest.mark.xfail\n def test_remove_dir_prefix(self):"))
638 (substitute* "testing/test_argcomplete.py"
639 (("def test_remove_dir_prefix" line)
640 (string-append "@pytest.mark.skip"
641 "(reason=\"Assumes that /usr exists.\")\n "
645 `(("python-py" ,python-py)))
647 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
649 ("python-hypothesis" ,python-hypothesis)
650 ("python-nose" ,python-nose)
651 ("python-mock" ,python-mock)
652 ("python-setuptools-scm" ,python-setuptools-scm)))
653 (home-page "http://pytest.org")
654 (synopsis "Python testing library")
656 "Pytest is a testing tool that provides auto-discovery of test modules
657 and functions, detailed info on failing assert statements, modular fixtures,
658 and many external plugins.")
659 (license license:expat)))
661 (define-public python2-pytest
662 (package-with-python2 python-pytest))
664 (define-public python-pytest-bootstrap
666 (inherit python-pytest)
667 (name "python-pytest-bootstrap")
668 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
669 (arguments `(#:tests? #f))))
671 (define-public python2-pytest-bootstrap
672 (package-with-python2 python-pytest-bootstrap))
674 (define-public python-pytest-cov
676 (name "python-pytest-cov")
681 (uri (pypi-uri "pytest-cov" version))
684 "03c2qc42r4bczyw93gd7n0qi1h1jfhw7fnbhi33c3vp1hs81gm2k"))))
685 (build-system python-build-system)
688 (modify-phases %standard-phases
691 ;; options taken from tox.ini
692 ;; TODO: make "--restructuredtext" tests pass. They currently fail
693 ;; with "Duplicate implicit target name"
694 (zero? (system* "python" "./setup.py" "check"
695 "--strict" "--metadata")))))))
697 `(("python-coverage" ,python-coverage)
698 ("python-pytest" ,python-pytest)))
699 (home-page "https://github.com/pytest-dev/pytest-cov")
700 (synopsis "Pytest plugin for measuring coverage")
702 "Pytest-cov produces coverage reports. It supports centralised testing and
703 distributed testing in both @code{load} and @code{each} modes. It also
704 supports coverage of subprocesses.")
705 (license license:expat)))
707 (define-public python2-pytest-cov
708 (package-with-python2 python-pytest-cov))
710 (define-public python-pytest-runner
712 (name "python-pytest-runner")
717 (uri (pypi-uri "pytest-runner" version))
720 "1cw978kqqcq916b9gfns1qjqvg33c5ail5jhw9054dsynkm32flq"))))
721 (build-system python-build-system)
724 (modify-phases %standard-phases
725 ;; The fancy way of setting the version with setuptools_scm does not
726 ;; seem to work here.
727 (add-after 'unpack 'set-version
729 (substitute* "docs/conf.py"
730 (("version = setuptools_scm\\.get_version\\(root='\\.\\.')")
731 (string-append "version = \"" ,version "\"")))
734 `(("python-pytest" ,python-pytest-bootstrap)
735 ("python-setuptools-scm" ,python-setuptools-scm)))
736 (home-page "https://github.com/pytest-dev/pytest-runner")
737 (synopsis "Invoke py.test as a distutils command")
739 "This package provides a @command{pytest-runner} command that
740 @file{setup.py} files can use to run tests.")
741 (license license:expat)))
743 (define-public python2-pytest-runner
744 (package-with-python2 python-pytest-runner))
746 (define-public python-pytest-mock
748 (name "python-pytest-mock")
753 (uri (pypi-uri "pytest-mock" version))
756 "075v7b2wm5f839r1a30n21wfk5rfqp3d05q7zb9jlb2wmxki23cj"))))
757 (build-system python-build-system)
759 `(("python-setuptools-scm" ,python-setuptools-scm)))
761 `(("python-pytest" ,python-pytest)))
762 (home-page "https://github.com/pytest-dev/pytest-mock/")
763 (synopsis "Thin-wrapper around the mock package for easier use with py.test")
765 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
766 around the patching API provided by the @code{mock} package, but with the
767 benefit of not having to worry about undoing patches at the end of a test.
768 The mocker fixture has the same API as @code{mock.patch}, supporting the
770 (properties `((python2-variant . ,(delay python2-pytest-mock))))
771 (license license:expat)))
773 (define-public python2-pytest-mock
774 (let ((base (package-with-python2
775 (strip-python2-variant python-pytest-mock))))
776 (package (inherit base)
778 `(("python2-mock" ,python2-mock)
779 ,@(package-propagated-inputs base))))))
781 (define-public python-pytest-xdist
783 (name "python-pytest-xdist")
788 (uri (pypi-uri "pytest-xdist" version ".zip"))
791 "08rn2l39ds60xshs4js787l84pfckksqklfq2wq9x8ig2aci2pja"))
792 (modules '((guix build utils)))
795 ;; Remove pre-compiled .pyc files from source.
796 (for-each delete-file-recursively
797 (find-files "." "__pycache__" #:directories? #t))
798 (for-each delete-file (find-files "." "\\.pyc$"))
800 (build-system python-build-system)
802 '(#:tests? #f)) ;FIXME: Some tests are failing.
804 ;; (modify-phases %standard-phases
806 ;; (add-after 'install 'check
807 ;; (lambda* (#:key inputs outputs #:allow-other-keys)
808 ;; (add-installed-pythonpath inputs outputs)
809 ;; (zero? (system* "py.test" "-v")))))
812 ("python-setuptools-scm" ,python-setuptools-scm)))
814 `(("python-execnet" ,python-execnet)
815 ("python-pytest" ,python-pytest)
816 ("python-py" ,python-py)))
818 "https://github.com/pytest-dev/pytest-xdist")
820 "Plugin for py.test with distributed testing and loop-on-failing modes")
822 "The pytest-xdist plugin extends py.test with some unique test execution
823 modes: parallelization, running tests in boxed subprocesses, the ability
824 to run tests repeatedly when failed, and the ability to run tests on multiple
825 Python interpreters or platforms. It uses rsync to copy the existing
826 program code to a remote location, executes there, and then syncs the
828 (license license:expat)))
830 (define-public python2-pytest-xdist
831 (package-with-python2 python-pytest-xdist))
833 (define-public python-scripttest
835 (name "python-scripttest")
841 "https://pypi.python.org/packages/source/s/scripttest/scripttest-"
845 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
846 (build-system python-build-system)
848 `(("python-pytest" ,python-pytest)))
849 (home-page "http://pythonpaste.org/scripttest/")
850 (synopsis "Python library to test command-line scripts")
851 (description "Scripttest is a Python helper library for testing
852 interactive command-line applications. With it you can run a script in a
853 subprocess and see the output as well as any file modifications.")
854 (license license:expat)))
856 (define-public python2-scripttest
857 (package-with-python2 python-scripttest))
859 (define-public python-testtools-bootstrap
861 (name "python-testtools-bootstrap")
866 (uri (pypi-uri "testtools" version))
869 "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))))
870 (build-system python-build-system)
871 (arguments '(#:tests? #f))
873 `(("python-extras" ,python-extras)
874 ("python-fixtures" ,python-fixtures-bootstrap)
875 ("python-mimeparse" ,python-mimeparse)
876 ("python-pbr" ,python-pbr-minimal)
877 ("python-six" ,python-six)
878 ("python-traceback2" ,python-traceback2)
879 ("python-unittest2" ,python-unittest2)))
880 (home-page "https://github.com/testing-cabal/testtools")
882 "Extensions to the Python standard library unit testing framework")
884 "This package is only for bootstrapping. Do not use this.")
885 (license license:psfl)))
887 (define-public python2-testtools-bootstrap
888 (package-with-python2 python-testtools-bootstrap))
890 (define-public python-testtools
892 (inherit python-testtools-bootstrap)
893 (name "python-testtools")
895 `(#:phases (modify-phases %standard-phases
898 (invoke "python" "-m" "testtools.run"
899 "testtools.tests.test_suite"))))))
901 `(("python-extras" ,python-extras)
902 ("python-fixtures" ,python-fixtures)
903 ("python-mimeparse" ,python-mimeparse)
904 ("python-pbr" ,python-pbr)
905 ("python-six" ,python-six)
906 ("python-traceback2" ,python-traceback2)
907 ("python-unittest2" ,python-unittest2)))
909 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
911 "Testtools extends the Python standard library unit testing framework to
912 provide matchers, more debugging information, and cross-Python
915 (define-public python2-testtools
916 (package-with-python2 python-testtools))
918 (define-public python-testscenarios-bootstrap
920 (name "python-testscenarios-bootstrap")
925 (uri (pypi-uri "testscenarios" version))
928 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
929 (build-system python-build-system)
931 `(#:phases (modify-phases %standard-phases
934 (invoke "python" "-m" "testtools.run"
935 "testscenarios.test_suite"))))))
937 `(("python-pbr" ,python-pbr-minimal)
938 ("python-testtools" ,python-testtools-bootstrap)))
939 (home-page "https://launchpad.net/testscenarios")
940 (synopsis "Pyunit extension for dependency injection")
942 "This package is only for bootstrapping. Don't use this.")
943 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
945 (define-public python2-testscenarios-bootstrap
946 (package-with-python2 python-testscenarios-bootstrap))
948 (define-public python-testscenarios
950 (inherit python-testscenarios-bootstrap)
951 (name "python-testscenarios")
953 `(("python-pbr" ,python-pbr)
954 ("python-testtools" ,python-testtools)))
956 "Testscenarios provides clean dependency injection for Python unittest
959 (define-public python2-testscenarios
960 (package-with-python2 python-testscenarios))
962 ;; Testresources requires python-pbr at runtime, but pbr needs it for its
963 ;; own tests. Hence this bootstrap variant.
964 (define-public python-testresources-bootstrap
966 (name "python-testresources-bootstrap")
970 (uri (pypi-uri "testresources" version))
973 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
974 (build-system python-build-system)
975 (arguments '(#:tests? #f))
977 `(("python-pbr" ,python-pbr-minimal)))
978 (home-page "https://launchpad.net/testresources")
980 "Pyunit extension for managing test resources")
982 "This package is only here for bootstrapping purposes. Use the regular
983 testresources package instead.")
984 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
986 (define-public python2-testresources-bootstrap
987 (package-with-python2 python-testresources-bootstrap))
989 (define-public python-testresources
991 (inherit python-testresources-bootstrap)
992 (name "python-testresources")
994 `(("python-pbr" ,python-pbr)))
997 `(("python-fixtures" ,python-fixtures)
998 ("python-testtols" ,python-testtools)))
1000 "Testresources is an extension to Python's unittest to allow declarative
1001 use of resources by test cases.")))
1003 (define-public python2-testresources
1004 (package-with-python2 python-testresources))
1006 (define-public python-subunit-bootstrap
1008 (name "python-subunit-bootstrap")
1013 (uri (pypi-uri "python-subunit" version))
1016 "1yii2gx3z6323as3iraj1yphj76dy7i3h6kj63pnc5y0hwjs5sgx"))))
1017 (build-system python-build-system)
1019 `(("python-extras" ,python-extras)
1020 ("python-testtools" ,python-testtools-bootstrap)))
1022 `(("python-fixtures" ,python-fixtures-bootstrap)
1023 ("python-hypothesis" ,python-hypothesis)
1024 ("python-testscenarios" ,python-testscenarios-bootstrap)))
1025 (home-page "http://launchpad.net/subunit")
1026 (synopsis "Python implementation of the subunit protocol")
1028 "This package is here for bootstrapping purposes only. Use the regular
1029 python-subunit package instead.")
1030 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1032 (define-public python2-subunit-bootstrap
1033 (package-with-python2 python-subunit-bootstrap))
1035 (define-public python-subunit
1037 (inherit python-subunit-bootstrap)
1038 (name "python-subunit")
1040 `(("python-extras" ,python-extras)
1041 ("python-testtools" ,python-testtools)))
1043 `(("python-fixtures" ,python-fixtures)
1044 ("python-hypothesis" ,python-hypothesis)
1045 ("python-testscenarios" ,python-testscenarios)))
1047 "Python-subunit is a Python implementation of the subunit test streaming
1050 (define-public python2-subunit
1051 (package-with-python2 python-subunit))
1053 ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
1054 ;; own tests. Hence this bootstrap variant.
1055 (define-public python-fixtures-bootstrap
1057 (name "python-fixtures-bootstrap")
1061 (uri (pypi-uri "fixtures" version))
1064 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
1065 (build-system python-build-system)
1066 (arguments `(#:tests? #f))
1068 `(("python-pbr-minimal" ,python-pbr-minimal)
1069 ("python-six" ,python-six)))
1070 (home-page "https://launchpad.net/python-fixtures")
1071 (synopsis "Python test fixture library")
1073 "This package is only used for bootstrapping. Use the regular
1074 python-fixtures package instead.")
1075 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1077 (define-public python2-fixtures-bootstrap
1078 (package-with-python2 python-fixtures-bootstrap))
1080 (define-public python-fixtures
1082 (inherit python-fixtures-bootstrap)
1083 (name "python-fixtures")
1086 (modify-phases %standard-phases
1089 (zero? (system* "python" "-m" "testtools.run"
1090 "fixtures.test_suite")))))))
1092 ;; Fixtures uses pbr at runtime to check versions, etc.
1093 `(("python-pbr" ,python-pbr)
1094 ("python-six" ,python-six)))
1096 `(("python-mock" ,python-mock)
1097 ("python-testtools" ,python-testtools-bootstrap)))
1099 "Fixtures provides a way to create reusable state, useful when writing
1102 (define-public python2-fixtures
1103 (package-with-python2 python-fixtures))
1105 (define-public python-testrepository-bootstrap
1107 (name "python-testrepository-bootstrap")
1113 "https://pypi.python.org/packages/source/t/testrepository/testrepository-"
1117 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1118 (build-system python-build-system)
1119 (arguments '(#:tests? #f))
1121 `(("python-fixtures" ,python-fixtures-bootstrap)
1122 ("python-subunit" ,python-subunit-bootstrap)
1123 ("python-testtools" ,python-testtools-bootstrap)))
1125 `(("python-mimeparse" ,python-mimeparse)))
1126 (home-page "https://launchpad.net/testrepository")
1127 (synopsis "Database for Python test results")
1129 "Bootstrap package for python-testrepository. Don't use this.")
1130 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1132 (define-public python2-testrepository-bootstrap
1133 (package-with-python2 python-testrepository-bootstrap))
1135 (define-public python-testrepository
1137 (inherit python-testrepository-bootstrap)
1138 (name "python-testrepository")
1140 ;; FIXME: Many tests are failing.
1143 `(("python-fixtures" ,python-fixtures)
1144 ("python-subunit" ,python-subunit)
1145 ("python-testtools" ,python-testtools)))
1147 `(("python-mimeparse" ,python-mimeparse)))
1148 (description "Testrepository provides a database of test results which can
1149 be used as part of a developer's workflow to check things such as what tests
1150 have failed since the last commit or what tests are currently failing.")))
1152 (define-public python2-testrepository
1153 (package-with-python2 python-testrepository))
1155 (define-public python-coverage
1157 (name "python-coverage")
1162 (uri (pypi-uri "coverage" version))
1165 "097l4s3ssxm1vncsn0nw3a1pbzah28773q36c1ab9wz01r04973s"))))
1166 (build-system python-build-system)
1168 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1170 (home-page "http://nedbatchelder.com/code/coverage")
1171 (synopsis "Code coverage measurement for Python")
1173 "Coverage measures code coverage, typically during test execution. It
1174 uses the code analysis tools and tracing hooks provided in the Python standard
1175 library to determine which lines are executable, and which have been
1177 (license license:bsd-3)))
1179 (define-public python2-coverage
1180 (package-with-python2 python-coverage))
1182 (define-public python-cov-core
1184 (name "python-cov-core")
1189 (uri (pypi-uri "cov-core" version))
1192 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1193 (build-system python-build-system)
1195 `(("python-coverage" ,python-coverage)))
1196 (home-page "https://github.com/schlamar/cov-core")
1197 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
1199 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1200 and @code{nose2-cov}. It is useful for developing coverage plugins for these
1201 testing frameworks.")
1202 (license license:expat)))
1204 (define-public python2-cov-core
1205 (package-with-python2 python-cov-core))
1207 (define-public python-testpath
1209 (name "python-testpath")
1214 (uri (string-append "https://github.com/jupyter/testpath/archive/"
1216 (file-name (string-append name "-" version ".tar.gz"))
1219 "04kh3fgvmqz6cfcw79q70qwjz7ib7lxm27cc548iy2rpr33qqf55"))))
1220 (build-system python-build-system)
1222 `(#:tests? #f ; this package does not even have a setup.py
1223 #:modules ((guix build python-build-system)
1226 #:imported-modules (,@%python-build-system-modules
1229 (modify-phases %standard-phases
1232 (lambda* (#:key inputs outputs #:allow-other-keys)
1233 (let* ((version (last
1234 (string-split (assoc-ref inputs "python") #\-)))
1235 (x.y (string-join (take (string-split version #\.) 2)
1238 (assoc-ref outputs "out")
1239 "/lib/python" x.y "/site-packages/testpath")))
1241 (copy-recursively "testpath" dir))
1243 (home-page "https://github.com/takluyver/testpath")
1244 (synopsis "Test utilities for code working with files and commands")
1246 "Testpath is a collection of utilities for Python code working with files
1247 and commands. It contains functions to check things on the file system, and
1248 tools for mocking system commands and recording calls to those.")
1249 (license license:expat)))
1251 (define-public python2-testpath
1252 (package-with-python2 python-testpath))
1254 (define-public python-testlib
1256 (name "python-testlib")
1262 "https://pypi.python.org/packages/source/t/testlib/testlib-"
1265 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1266 (build-system python-build-system)
1268 `(("unzip" ,unzip))) ; for unpacking the source
1269 (synopsis "Python micro test suite harness")
1270 (description "A micro unittest suite harness for Python.")
1271 (home-page "https://github.com/trentm/testlib")
1272 (license license:expat)))
1274 (define-public python2-testlib
1275 (package-with-python2 python-testlib))
1277 ;;; The software provided by this package was integrated into pytest 2.8.
1278 (define-public python-pytest-cache
1280 (name "python-pytest-cache")
1284 (uri (pypi-uri "pytest-cache" version))
1287 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1288 (build-system python-build-system)
1290 `(("python-apipkg" ,python-apipkg)
1291 ("python-execnet" ,python-execnet)
1292 ("python-py" ,python-py)
1293 ("python-pytest" ,python-pytest)))
1294 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1295 (description "The pytest-cache plugin provides tools to rerun failures from
1296 the last py.test invocation.")
1297 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1298 (license license:expat)))
1300 (define-public python2-pytest-cache
1301 (package-with-python2 python-pytest-cache))
1303 (define-public python-pytest-localserver
1305 (name "python-pytest-localserver")
1309 (uri (pypi-uri "pytest-localserver" version))
1312 "08f06rvj31wqf0vgmd1waya87r7vy6x8ck48lxl3dxy83q5gcam7"))))
1313 (build-system python-build-system)
1315 `(#:phases (modify-phases %standard-phases
1318 (zero? (system* "py.test" "--genscript=runtests.py"))
1319 (zero? (system* "py.test")))))))
1321 `(("python-pytest" ,python-pytest)
1322 ("python-requests" ,python-requests)
1323 ("python-six" ,python-six)))
1325 `(("python-werkzeug" ,python-werkzeug)))
1326 (synopsis "Py.test plugin to test server connections locally")
1327 (description "Pytest-localserver is a plugin for the pytest testing
1328 framework which enables you to test server connections locally.")
1329 (home-page "https://pypi.python.org/pypi/pytest-localserver")
1330 (license license:expat)))
1332 (define-public python-pytest-xprocess
1334 (name "python-pytest-xprocess")
1338 (uri (pypi-uri "pytest-xprocess" version))
1341 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1342 (build-system python-build-system)
1344 `(("python-pytest" ,python-pytest)
1345 ("python-pytest-cache" ,python-pytest-cache)
1346 ("python-psutil" ,python-psutil)))
1347 (synopsis "Pytest plugin to manage external processes across test runs")
1348 (description "Pytest-xprocess is an experimental py.test plugin for managing
1349 processes across test runs.")
1350 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1351 (license license:expat)))
1353 (define-public python-pytest-subtesthack
1355 (name "python-pytest-subtesthack")
1359 (uri (pypi-uri "pytest-subtesthack" version))
1362 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1363 (build-system python-build-system)
1365 `(("python-pytest" ,python-pytest)))
1366 (synopsis "Set-up and tear-down fixtures for unit tests")
1367 (description "This plugin allows you to set up and tear down fixtures within
1368 unit test functions that use @code{py.test}. This is useful for using
1369 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1370 function multiple times, without setting up or tearing down fixture state as is
1371 normally the case.")
1372 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1373 (license license:unlicense)))
1375 (define-public python2-pytest-subtesthack
1376 (package-with-python2 python-pytest-subtesthack))
1378 (define-public python-hypothesis
1380 (name "python-hypothesis")
1384 (uri (pypi-uri "hypothesis" version))
1387 "0qyqq9akm4vshhn8cngjc1qykcvsn7cz6dlm6njfsgpbraqrmbbw"))))
1388 (build-system python-build-system)
1390 `(("python-flake8" ,python-flake8)
1391 ("python-pytest" ,python-pytest-bootstrap)))
1392 (synopsis "Library for property based testing")
1393 (description "Hypothesis is a library for testing your Python code against a
1394 much larger range of examples than you would ever want to write by hand. It’s
1395 based on the Haskell library, Quickcheck, and is designed to integrate
1396 seamlessly into your existing Python unit testing work flow.")
1397 (home-page "https://github.com/DRMacIver/hypothesis")
1398 (license license:mpl2.0)
1399 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1401 (define-public python2-hypothesis
1402 (let ((hypothesis (package-with-python2
1403 (strip-python2-variant python-hypothesis))))
1404 (package (inherit hypothesis)
1406 `(("python2-enum34" ,python2-enum34)
1407 ,@(package-propagated-inputs hypothesis))))))
1409 (define-public python-lit
1416 (uri (pypi-uri "lit" version))
1419 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
1420 (build-system python-build-system)
1423 (modify-phases %standard-phases
1426 (invoke "python" "lit.py" "tests"))))))
1429 (home-page "https://llvm.org/")
1430 (synopsis "LLVM Software Testing Tool")
1431 (description "@code{lit} is a portable tool for executing LLVM and Clang
1432 style test suites, summarizing their results, and providing indication of
1434 (license license:ncsa)))
1436 (define-public python2-lit
1437 (package-with-python2 python-lit))
1439 (define-public python-pytest-pep8
1441 (name "python-pytest-pep8")
1445 (uri (pypi-uri "pytest-pep8" version))
1448 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
1449 (build-system python-build-system)
1451 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
1453 `(("python-pytest" ,python-pytest)))
1455 `(("python-pep8" ,python-pep8)))
1456 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
1457 (synopsis "Py.test plugin to check PEP8 requirements")
1458 (description "Pytest plugin for checking PEP8 compliance.")
1459 (license license:expat)))
1461 (define-public python2-pytest-pep8
1462 (package-with-python2 python-pytest-pep8))
1464 (define-public python-pytest-flakes
1466 (name "python-pytest-flakes")
1470 (uri (pypi-uri "pytest-flakes" version))
1473 "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
1474 (build-system python-build-system)
1477 (modify-phases %standard-phases
1479 (add-after 'install 'check
1480 (lambda* (#:key outputs inputs #:allow-other-keys)
1481 ;; It's easier to run tests after install.
1482 ;; Make installed package available for running the tests
1483 (add-installed-pythonpath inputs outputs)
1484 (zero? (system* "py.test" "-vv")))))))
1486 `(("python-coverage" ,python-coverage)
1487 ("python-pytest" ,python-pytest)
1488 ("python-pytest-cache" ,python-pytest-cache)
1489 ("python-pytest-pep8" ,python-pytest-pep8)))
1491 `(("python-pyflakes" ,python-pyflakes)))
1492 (home-page "https://github.com/fschulze/pytest-flakes")
1493 (synopsis "Py.test plugin to check source code with pyflakes")
1494 (description "Pytest plugin for checking Python source code with pyflakes.")
1495 (license license:expat)))
1497 (define-public python2-pytest-flakes
1498 (package-with-python2 python-pytest-flakes))
1500 (define-public python2-coverage-test-runner
1502 (name "python2-coverage-test-runner")
1508 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
1509 "coverage-test-runner/snapshot/coverage-test-runner-"
1513 "0y1m7z3dl63kmhcmydl1mwg0hacnf6ghrx9dah17j9iasssfa3g7"))))
1514 (build-system python-build-system)
1516 `(#:python ,python-2
1518 (modify-phases %standard-phases
1521 (zero? (system* "./testrun")))))))
1523 `(("python2-coverage" ,python2-coverage)))
1524 (home-page "https://liw.fi/coverage-test-runner/")
1525 (synopsis "Python module for running unit tests")
1526 (description "@code{CoverageTestRunner} is a python module for running
1527 unit tests and failing them if the unit test module does not exercise all
1528 statements in the module it tests.")
1529 (license license:gpl3+)))
1531 (define-public python-pylint
1533 (name "python-pylint")
1539 "https://github.com/PyCQA/pylint/archive/pylint-"
1543 "0mzn1czhf1mgr2wiqfihb274sja02h899b85kywdpivppa9nwrmp"))))
1544 (build-system python-build-system)
1546 `(("python-pytest" ,python-pytest)
1547 ("python-pytest-runner" ,python-pytest-runner)
1548 ("python-tox" ,python-tox)))
1550 `(("python-astroid" ,python-astroid)
1551 ("python-isort" ,python-isort)
1552 ("python-mccabe" ,python-mccabe)
1553 ("python-six" ,python-six)))
1556 (modify-phases %standard-phases
1559 ;; Somehow, tests for python2-pylint
1560 ;; fail if run from the build directory
1561 (let ((work "/tmp/work"))
1563 (setenv "PYTHONPATH"
1564 (string-append (getenv "PYTHONPATH") ":" work))
1565 (copy-recursively "." work)
1566 (with-directory-excursion "/tmp"
1567 (zero? (system* "python" "-m" "unittest" "discover"
1568 "-s" (string-append work "/pylint/test")
1569 "-p" "*test_*.py")))))))))
1570 (home-page "https://github.com/PyCQA/pylint")
1571 (synopsis "Python source code analyzer which looks for coding standard
1573 (description "Pylint is a Python source code analyzer which looks
1574 for programming errors, helps enforcing a coding standard and sniffs
1575 for some code smells (as defined in Martin Fowler's Refactoring book).
1577 Pylint has many rules enabled by default, way too much to silence them
1578 all on a minimally sized program. It's highly configurable and handle
1579 pragmas to control it from within your code. Additionally, it is
1580 possible to write plugins to add your own checks.")
1581 (properties `((python2-variant . ,(delay python2-pylint))))
1582 (license license:gpl2+)))
1584 (define-public python2-pylint
1585 (let ((pylint (package-with-python2
1586 (strip-python2-variant python-pylint))))
1587 (package (inherit pylint)
1589 `(("python2-backports-functools-lru-cache"
1590 ,python2-backports-functools-lru-cache)
1591 ("python2-configparser" ,python2-configparser)
1592 ,@(package-propagated-inputs pylint))))))
1594 (define-public python-paramunittest
1596 (name "python-paramunittest")
1601 (uri (pypi-uri "ParamUnittest" version))
1604 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
1605 (build-system python-build-system)
1607 "https://github.com/rik0/ParamUnittest")
1609 "Simple extension to have parametrized unit tests")
1611 "This package allows to create parametrized unit-tests that work with the standard
1612 unittest package. A parametrized test case is automatically converted to multiple test
1613 cases. Since they are TestCase subclasses, they work with other test suites that
1614 recognize TestCases.")
1615 (license license:bsd-2)))
1617 (define-public python2-python-paramunittest
1618 (package-with-python2 python-paramunittest))
1620 (define-public python-pytest-warnings
1622 (name "python-pytest-warnings")
1627 (uri (pypi-uri "pytest-warnings" version))
1630 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
1631 (build-system python-build-system)
1633 `(("pytest" ,python-pytest)))
1634 (home-page "https://github.com/fschulze/pytest-warnings")
1635 (synopsis "Pytest plugin to list Python warnings in pytest report")
1637 "Python-pytest-warnings is a pytest plugin to list Python warnings in
1639 (license license:expat)
1640 (properties `((python2-variant . ,(delay python2-pytest-warnings))
1641 ;; This package is part of pytest as of version 3.1.0.
1642 (superseded . ,python-pytest)))))
1644 (define-public python2-pytest-warnings
1645 (package (inherit (package-with-python2
1646 (strip-python2-variant python-pytest-warnings)))
1647 (properties `((superseded . ,python2-pytest)))))
1649 (define-public python-pytest-capturelog
1651 (name "python-pytest-capturelog")
1656 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
1659 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
1660 (build-system python-build-system)
1662 `(("pytest" ,python-pytest)))
1663 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
1664 (synopsis "Pytest plugin to catch log messages")
1666 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
1667 (license license:expat)))
1669 (define-public python2-pytest-capturelog
1670 (package-with-python2 python-pytest-capturelog))
1672 (define-public python-pytest-catchlog
1674 (name "python-pytest-catchlog")
1679 (uri (pypi-uri "pytest-catchlog" version ".zip"))
1682 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
1683 (build-system python-build-system)
1685 `(("unzip" ,unzip)))
1687 `(("pytest" ,python-pytest)))
1688 (home-page "https://github.com/eisensheng/pytest-catchlog")
1689 (synopsis "Pytest plugin to catch log messages")
1691 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
1692 a fork of pytest-capturelog.")
1693 (license license:expat)))
1695 (define-public python2-pytest-catchlog
1696 (package-with-python2 python-pytest-catchlog))
1698 (define-public python-nosexcover
1700 (name "python-nosexcover")
1704 (uri (pypi-uri "nosexcover" version))
1707 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
1708 (build-system python-build-system)
1710 `(("python-coverage" ,python-coverage)
1711 ("python-nose" ,python-nose)))
1712 (home-page "http://github.com/cmheisel/nose-xcover")
1713 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
1714 (description "Nose-xcover is a companion to the built-in
1715 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
1716 to a file named coverage.xml.
1718 It will honor all the options you pass to the Nose coverage plugin,
1719 especially -cover-package.")
1720 (license license:expat)))
1722 (define-public python2-nosexcover
1723 (package-with-python2 python-nosexcover))
1725 (define-public python-discover
1727 (name "python-discover")
1733 "https://pypi.python.org/packages/source/d/discover/discover-"
1737 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
1738 (build-system python-build-system)
1739 (home-page "http://pypi.python.org/pypi/discover/")
1741 "Python test discovery for unittest")
1743 "Discover provides test discovery for unittest, a feature that has been
1744 backported from Python 2.7 for Python 2.4+.")
1745 (license license:bsd-3)))
1747 (define-public python2-discover
1748 (package-with-python2 python-discover))
1750 (define-public behave
1756 (uri (pypi-uri "behave" version))
1759 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))))
1760 (build-system python-build-system)
1762 `(("python-mock" ,python-mock)
1763 ("python-nose" ,python-nose)
1764 ("python-pathpy" ,python-pathpy)
1765 ("python-pyhamcrest" ,python-pyhamcrest)
1766 ("python-pytest" ,python-pytest)))
1768 `(("python-six" ,python-six)
1769 ("python-parse" ,python-parse)
1770 ("python-parse-type" ,python-parse-type)))
1772 '(#:test-target "behave_test"))
1773 (home-page "https://github.com/behave/behave")
1774 (synopsis "Python behavior-driven development")
1776 "Behave is a tool for behavior-driven development in python.
1777 Behavior-driven development (or BDD) is an agile software development
1778 technique that encourages collaboration between developers, QA and
1779 non-technical or business participants in a software project. Behave uses
1780 tests written in a natural language style, backed up by Python code.")
1781 (license license:x11)))
1783 (define-public python-behave-web-api
1785 (name "python-behave-web-api")
1790 (uri (pypi-uri "behave-web-api" version))
1793 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
1794 (build-system python-build-system)
1797 (modify-phases %standard-phases
1798 (add-after 'unpack 'fix-dependencies
1800 (substitute* "setup.py"
1801 (("'wheel'") "") ; We don't use it.
1802 (("'ordereddict==1.1'") ""))))))) ; Python >= 2.7 has it built-in.
1804 `(("behave" ,behave)
1805 ("python-requests" ,python-requests)))
1806 (home-page "https://github.com/jefersondaniel/behave-web-api")
1807 (synopsis "Provides testing for JSON APIs with Behave for Python")
1808 (description "This package provides testing utility modules for testing
1809 JSON APIs with Behave.")
1810 (license license:expat)))
1812 (define-public python2-behave-web-api
1813 (package-with-python2 python-behave-web-api))
1815 (define-public python-rednose
1817 (name "python-rednose")
1822 (uri (pypi-uri "rednose" version))
1825 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
1826 (build-system python-build-system)
1828 `(#:phases (modify-phases %standard-phases
1829 (add-after 'unpack 'patch-setup.py
1831 ;; Six is only required for tests and later versions
1833 (substitute* "setup.py"
1834 (("six==1.10.0") "six"))
1837 `(("python-colorama" ,python-colorama)
1838 ("python-termstyle" ,python-termstyle)))
1840 `(("python-six" ,python-six)
1841 ("python-nose" ,python-nose)))
1842 (home-page "https://github.com/JBKahn/rednose")
1843 (synopsis "Colored output for Python nosetests")
1844 (description "This package provides colored output for the
1845 @command{nosetests} command of the Python Nose unit test framework.")
1846 (license license:bsd-3)))
1848 (define-public python2-rednose
1849 (package-with-python2 python-rednose))
1851 (define-public python-nose-randomly
1853 (name "python-nose-randomly")
1858 (uri (pypi-uri "nose-randomly" version))
1861 "1cw9dlr1zh3w4i438kin7z0rm8092ki52hayisyc43h9pcplq7rn"))))
1862 (build-system python-build-system)
1864 `(("python-nose" ,python-nose)
1865 ("python-numpy" ,python-numpy)))
1866 (home-page "https://github.com/adamchainz/nose-randomly")
1868 "Nose plugin to randomly order tests and control random.seed")
1870 "This is a @code{Nose} plugin to randomly order tests which can be quite
1871 powerful in discovering hidden flaws in the tests themselves, while helping to
1872 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
1873 by resetting it to a repeatable number for each test, enabling the tests to
1874 create data based on random numbers and yet remain repeatable.")
1875 (license license:bsd-3)))
1877 (define-public python2-nose-randomly
1878 (package-with-python2 python-nose-randomly))
1880 (define-public python-nose-timer
1882 (name "python-nose-timer")
1887 (uri (pypi-uri "nose-timer" version))
1890 ;; This patch will not be needed in the next version.
1891 ;; It is taken from the master branch.
1892 "python-nose-timer-drop-ordereddict.patch"))
1895 "1s32ymsnby8lz2qk55ifj9zi50dqcg6swnj5cz2rmwxg2jsslsxp"))))
1896 (build-system python-build-system)
1898 `(("python-nose" ,python-nose)
1899 ("python-termcolor" ,python-termcolor)))
1900 (home-page "https://github.com/mahmoudimus/nose-timer")
1901 (synopsis "Timer plugin for nosetests")
1902 (description "Shows how much time was needed to run individual tests.")
1903 (license license:expat)))
1905 (define-public python2-nose-timer
1906 (package-with-python2 python-nose-timer))
1908 (define-public python-freezegun
1910 (name "python-freezegun")
1915 (uri (pypi-uri "freezegun" version))
1918 "1vhf3kgdy7gpy70n3bxa3y1n6aza316137md97z8p5k0gz6wqg3q"))))
1919 (build-system python-build-system)
1921 `(("python-mock" ,python-mock)
1922 ("python-nose" ,python-nose)
1923 ("python-coverage" ,python-coverage)))
1925 `(("python-six" ,python-six)
1926 ("python-dateutil" ,python-dateutil)))
1929 (modify-phases %standard-phases
1930 ;; The tests are normally executed via `make test`, but the PyPi
1931 ;; package does not include the Makefile.
1934 (zero? (system* "nosetests" "./tests/")))))))
1935 (home-page "https://github.com/spulec/freezegun")
1936 (synopsis "Test utility for mocking the datetime module")
1938 "FreezeGun is a library that allows your python tests to travel through
1939 time by mocking the datetime module.")
1940 (license license:asl2.0)))
1942 (define-public python2-freezegun
1943 (package-with-python2 python-freezegun))
1945 (define-public python-flexmock
1947 (name "python-flexmock")
1951 (uri (pypi-uri "flexmock" version))
1954 "0arc6njvs6i9v9hgvzk5m50296g7zy5m9d7pyb43vdsdgxrci5gy"))))
1955 (build-system python-build-system)
1956 (home-page "https://flexmock.readthedocs.org")
1957 (synopsis "Testing library for Python")
1959 "flexmock is a testing library for Python that makes it easy to create
1960 mocks, stubs and fakes.")
1961 (license license:bsd-3)))
1963 (define-public python2-flexmock
1964 (package-with-python2 python-flexmock))
1966 (define-public python-flaky
1968 (name "python-flaky")
1972 (uri (pypi-uri "flaky" version))
1975 "18pkmf79rfkfpy1d2rrx3v55nxj762ilyk9rvd6s6dccxw58imsa"))))
1976 (build-system python-build-system)
1978 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
1980 (home-page "https://github.com/box/flaky")
1981 (synopsis "Automatically rerun flaky tests")
1983 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
1986 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
1987 on components that aren't 100% reliable. With flaky, instead of removing
1988 those tests or marking them to @code{@@skip}, they can be automatically
1990 (license license:asl2.0)))
1992 (define-public python2-flaky
1993 (package-with-python2 python-flaky))
1995 (define-public python-pyhamcrest
1997 (name "python-pyhamcrest")
2003 "https://github.com/hamcrest/PyHamcrest/archive/V"
2007 (string-append name "-" version ".tar.gz"))
2010 "1lqjajhwf7x7igvvnj5p1cm31y9njy07qby94w18kl6zwbdjqrwy"))))
2011 (native-inputs ; All native inputs are for tests
2012 `(("python-pytest-cov" ,python-pytest-cov)
2013 ("python-mock" ,python-mock)
2014 ("python-pytest" ,python-pytest)
2015 ("python-hypothesis" ,python-hypothesis)))
2017 `(("python-six" ,python-six)))
2018 (build-system python-build-system)
2019 (home-page "http://hamcrest.org/")
2020 (synopsis "Hamcrest matchers for Python")
2022 "PyHamcrest is a framework for writing matcher objects,
2023 allowing you to declaratively define \"match\" rules.")
2024 (license license:bsd-3)))
2026 (define-public python2-pyhamcrest
2027 (package-with-python2 python-pyhamcrest))
2029 (define-public unittest-cpp
2031 (name "unittest-cpp")
2036 "https://github.com/unittest-cpp/unittest-cpp/archive/v"
2038 (file-name (string-append name "-" version ".tar.gz"))
2040 (base32 "1fgmna2la7z4pwwy2gd10gpgi2q1fk89npjfvkmzvhkxhyc231bl"))))
2042 `(#:tests? #f)) ; It's run after build automatically.
2043 (build-system cmake-build-system)
2044 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2045 (synopsis "Lightweight unit testing framework for C++")
2046 (description "UnitTest++ is a lightweight unit testing framework for C++.
2047 It was designed to do test-driven development on a wide variety of platforms.
2048 Simplicity, portability, speed, and small footprint are all very important
2049 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2050 of advanced library and language features, which means it should be easily
2051 portable to just about any platform.")
2052 (license license:expat)))