1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
3 ;;; Copyright © 2014 David Thompson <davet@gnu.org>
4 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
5 ;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
6 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
7 ;;; Copyright © 2015, 2017 Cyril Roelandt <tipecaml@gmail.com>
8 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
9 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
10 ;;; Copyright © 2015, 2016, 2018 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, 2018 Ludovic Courtès <ludo@gnu.org>
30 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
32 ;;; This file is part of GNU Guix.
34 ;;; GNU Guix is free software; you can redistribute it and/or modify it
35 ;;; under the terms of the GNU General Public License as published by
36 ;;; the Free Software Foundation; either version 3 of the License, or (at
37 ;;; your option) any later version.
39 ;;; GNU Guix is distributed in the hope that it will be useful, but
40 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
41 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42 ;;; GNU General Public License for more details.
44 ;;; You should have received a copy of the GNU General Public License
45 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
47 (define-module (gnu packages check)
48 #:use-module (gnu packages)
49 #:use-module (gnu packages autotools)
50 #:use-module (gnu packages bash)
51 #:use-module (gnu packages compression)
52 #:use-module (gnu packages llvm)
53 #:use-module (gnu packages golang)
54 #:use-module (gnu packages perl)
55 #:use-module (gnu packages python)
56 #:use-module (gnu packages python-web)
57 #:use-module (gnu packages time)
58 #:use-module (guix utils)
59 #:use-module ((guix licenses) #:prefix license:)
60 #:use-module (guix packages)
61 #:use-module (guix download)
62 #:use-module (guix git-download)
63 #:use-module (guix build-system cmake)
64 #:use-module (guix build-system gnu)
65 #:use-module (guix build-system go)
66 #:use-module (guix build-system python)
67 #:use-module (guix build-system trivial))
76 (uri (string-append "https://github.com/libcheck/check/releases/download/"
77 version "/check-" version ".tar.gz"))
80 "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6"))))
81 (build-system gnu-build-system)
82 (home-page "https://libcheck.github.io/check/")
83 (synopsis "Unit test framework for C")
85 "Check is a unit testing framework for C. It features a simple
86 interface for defining unit tests, putting little in the way of the
87 developer. Tests are run in a separate address space, so Check can
88 catch both assertion failures and code errors that cause segmentation
89 faults or other signals. The output from unit tests can be used within
90 source code editors and IDEs.")
91 (license license:lgpl2.1+)))
100 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
101 version "/CUnit-" version ".tar.bz2"))
104 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
105 (build-system gnu-build-system)
106 (arguments '(#:phases
107 (modify-phases %standard-phases
108 ;; XXX: The "bootstrap" phase detects the "bootstrap"
109 ;; script, but fails to execute it, so we bootstrap
112 (lambda _ (invoke "autoreconf" "-vfi"))))))
114 `(("automake" ,automake)
115 ("autoconf" ,autoconf)
116 ("libtool" ,libtool)))
117 (home-page "http://cunit.sourceforge.net/")
118 (synopsis "Automated testing framework for C")
120 "CUnit is a lightweight system for writing, administering, and running
121 unit tests in C. It provides C programmers with basic testing functionality
122 with a flexible variety of user interfaces.")
123 (license license:gpl2+)))
125 (define-public cppunit
131 (uri (string-append "http://dev-www.libreoffice.org/src/"
132 name "-" version ".tar.gz"))
135 "17s2kzmkw3kfjhpp72rfppyd7syr7bdq5s69syj2nvrlwd3d4irz"))))
136 ;; Explicitly link with libdl. This is expected to be done by packages
137 ;; relying on cppunit for their tests. However, not all of them do.
138 ;; If we added the linker flag to such packages, we would pollute all
139 ;; binaries, not only those used for testing.
141 `(#:make-flags '("LDFLAGS=-ldl")))
142 (build-system gnu-build-system)
143 (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
144 (synopsis "Unit testing framework for C++")
145 (description "CppUnit is the C++ port of the famous JUnit framework for
146 unit testing. Test output is in XML for automatic testing and GUI based for
148 (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
150 ;; Some packages require this newer version of cppunit. However, it needs
151 ;; C++11 support, which is not enabled by default in our current GCC, and
152 ;; updating in-place would require adding CXXFLAGS to many dependent packages.
153 ;; Thus, keep as a separate variable for now.
154 ;; TODO: Remove this when our default GCC is updated to 6 or higher.
155 (define-public cppunit-1.14
161 (uri (string-append "https://dev-www.libreoffice.org/src/"
162 "cppunit-" version ".tar.gz"))
165 "1027cyfx5gsjkdkaf6c2wnjh68882grw8n672018cj3vs9lrhmix"))))))
167 ;; When dependent packages upgraded to use newer version of catch, this one should
169 (define-public catch-framework
172 (version "1.3.5") ;Sub-minor is the build number
176 (url "https://github.com/philsquared/Catch")
178 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
179 (file-name (string-append name "-" version))
182 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
183 (build-system trivial-build-system)
185 `(#:modules ((guix build utils))
187 (use-modules (guix build utils))
188 (let* ((source (assoc-ref %build-inputs "source"))
189 (output (assoc-ref %outputs "out"))
190 (incdir (string-append output "/include"))
191 (docdir (string-append output "/share/doc/catch-"
193 (for-each mkdir-p (list incdir docdir))
194 (install-file (string-append source
195 "/single_include/catch.hpp")
197 (copy-recursively (string-append source "/docs")
200 (home-page "http://catch-lib.net/")
201 (synopsis "Automated test framework for C++ and Objective-C")
203 "Catch stands for C++ Automated Test Cases in Headers and is a
204 multi-paradigm automated test framework for C++ and Objective-C.")
205 (license license:boost1.0)))
207 (define-public catch-framework2
211 (home-page "https://github.com/catchorg/Catch2")
215 (url "https://github.com/catchorg/Catch2")
216 (commit (string-append "v" version))))
217 (file-name (git-file-name name version))
220 "1gdp5wm8khn02g2miz381llw3191k7309qj8s3jd6sasj01rhf23"))))
221 (build-system cmake-build-system)
222 (synopsis "Automated test framework for C++ and Objective-C")
223 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
224 a multi-paradigm automated test framework for C++ and Objective-C.")
225 (license license:boost1.0)))
227 (define-public cmdtest
233 (uri (string-append "http://git.liw.fi/cmdtest/snapshot/"
234 name "-" version ".tar.gz"))
237 "1jmfiyrrqmpvwdb273bkb8hjaf4rwx9njblx29pmr7giyahskwi5"))))
238 (build-system python-build-system)
242 (modify-phases %standard-phases
243 ;; check phase needs to be run before the build phase. If not, the
244 ;; coverage test runner looks for tests for the built source files,
247 (add-before 'build 'check
250 (("/bin/sh") (which "sh")))
251 ;; yarn uses python2-ttystatus to print messages.
252 ;; python2-ttystatus requires /dev/tty which is not present in
253 ;; the build environment. Hence assuming-failure test fails.
254 (delete-file "yarn.tests/assuming-failure.script")
255 (delete-file "yarn.tests/assuming-failure.stdout")
256 (invoke "python" "setup.py" "check"))))))
258 `(("python2-coverage-test-runner" ,python2-coverage-test-runner)))
260 `(("python2-cliapp" ,python2-cliapp)
261 ("python2-markdown" ,python2-markdown)
262 ("python2-ttystatus" ,python2-ttystatus)))
263 (home-page "https://liw.fi/cmdtest/")
264 (synopsis "Black box Unix program tester")
266 "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
267 given a command line and input files, and the expected output, and it verifies
268 that the command line produces the expected output. If not, it reports a
269 problem, and shows the differences.")
270 (license license:gpl3+)))
272 (define-public cmocka
278 (uri (string-append "https://cmocka.org/files/"
279 (version-major+minor version) "/cmocka-"
283 "1p9b6ccv939wjsgapn7wx24xw278awsw9h81lm0g4zw257hx276i"))))
284 (build-system cmake-build-system)
286 `(#:tests? #f)) ; no test target
287 (home-page "https://cmocka.org/")
288 (synopsis "Unit testing framework for C")
289 (description "Cmocka is a unit testing framework for C with support for
290 mock objects. It only requires the standard C library, and works with
291 different compilers. Cmocka supports several different message output formats
292 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
294 (license license:asl2.0)))
296 (define-public cppcheck
303 (url "https://github.com/danmar/cppcheck")
305 (file-name (git-file-name name version))
307 (base32 "0jr4aah72c7wy94a8vlj3k050rx6pmc7m9nvmll1jwbscxj5f7ff"))))
308 (build-system cmake-build-system)
310 '(#:configure-flags '("-DBUILD_TESTS=ON")))
311 (home-page "http://cppcheck.sourceforge.net")
312 (synopsis "Static C/C++ code analyzer")
313 (description "Cppcheck is a static code analyzer for C and C++. Unlike
314 C/C++ compilers and many other analysis tools it does not detect syntax errors
315 in the code. Cppcheck primarily detects the types of bugs that the compilers
316 normally do not detect. The goal is to detect only real errors in the code
317 (i.e. have zero false positives).")
318 (license license:gpl3+)))
320 (define-public go-gopkg.in-check.v1
321 (let ((commit "20d25e2804050c1cd24a7eea1e7a6447dd0e74ec")
324 (name "go-gopkg.in-check.v1")
325 (version (git-version "0.0.0" revision commit))
329 (url "https://github.com/go-check/check.git")
331 (file-name (git-file-name name version))
334 "0k1m83ji9l1a7ng8a7v40psbymxasmssbrrhpdv2wl4rhs0nc3np"))))
335 (build-system go-build-system)
337 '(#:import-path "gopkg.in/check.v1"))
338 (synopsis "Rich testing extension for Go's testing package")
340 "@code{check} is a rich testing extension for Go's testing package.")
341 (home-page "https://github.com/go-check/check")
342 (license license:bsd-2))))
344 (define-public go-github.com-smartystreets-gunit
346 (name "go-github.com-smartystreets-gunit")
351 (url "https://github.com/smartystreets/gunit")
353 (file-name (git-file-name name version))
356 "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
357 (build-system go-build-system)
359 '(;; TODO: This package depends on go-github.com-smartystreets-assertions
360 ;; for running the tests, but go-github.com-smartystreets-assertions
361 ;; depends on this package, so break this loop by not running the tests
364 #:import-path "github.com/smartystreets/gunit"))
365 (synopsis "Testing tool for Go, in the style of xUnit")
367 "@code{gunit} allows the test author to use a struct as the scope for a
368 group of related test cases, in the style of xUnit fixtures. This makes
369 extraction of setup/teardown behavior (as well as invoking the system under
370 test) much simpler.")
371 (home-page "https://github.com/smartystreets/gunit")
372 (license license:expat)))
374 (define-public go-github.com-smartystreets-assertions
376 (name "go-github.com-smartystreets-assertions")
381 (url "https://github.com/smartystreets/assertions")
383 (file-name (git-file-name name version))
386 "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
387 (build-system go-build-system)
389 '(#:import-path "github.com/smartystreets/assertions"))
391 `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
392 (synopsis "Assertions for testing with Go")
394 "The @code{assertions} package provides convinient assertion functions
395 for writing tests in Go.")
396 (home-page "https://github.com/smartystreets/assertions")
397 (license license:expat)))
399 (define-public go-github.com-smartystreets-goconvey
401 (name "go-github.com-smartystreets-goconvey")
406 (url "https://github.com/smartystreets/goconvey")
408 (file-name (git-file-name name version))
411 "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
412 (build-system go-build-system)
414 '(#:import-path "github.com/smartystreets/goconvey"))
416 `(("go-github.com-jtolds-gls" ,go-github.com-jtolds-gls)
417 ("go-github.com-smartystreets-assertions" ,go-github.com-smartystreets-assertions)))
418 (synopsis "Go testing tool with both a web and terminal user interface")
420 "GoConvey is a testing tool for Go. It integrates with go test, can show
421 test coverage and has a web user interface that will refresh automatically.")
422 (home-page "https://github.com/smartystreets/goconvey")
423 (license license:expat)))
425 ;; XXX When updating, check whether ZNC's GOOGLETEST-SOURCES can be
426 ;; switched back to simply using (PACKAGE-SOURCE ...).
427 (define-public googletest
434 (uri (string-append "https://github.com/google/googletest/archive/"
435 "release-" version ".tar.gz"))
436 (file-name (string-append name "-" version ".tar.gz"))
439 "1n5p1m2m3fjrjdj752lf92f9wq3pl5cbsfrb49jqbg52ghkz99jq"))))
440 (build-system cmake-build-system)
442 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
444 `(("python-2" ,python-2)))
445 (home-page "https://github.com/google/googletest/")
446 (synopsis "Test discovery and XUnit test framework")
447 (description "Google Test features an XUnit test framework, automated test
448 discovery, death tests, assertions, parameterized tests and XML test report
450 (license license:bsd-3)))
452 (define-public cpputest
459 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
460 version "/cpputest-" version ".tar.gz"))
463 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
464 (build-system gnu-build-system)
466 `(("googletest" ,googletest)))
467 (home-page "https://cpputest.github.io/")
468 (synopsis "Unit testing and mocking framework for C/C++")
470 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
471 C++ but is used in C and C++ projects and frequently used in embedded systems
472 but it works for any C/C++ project.")
473 (license license:bsd-3)))
475 (define-public python-parameterized
477 (name "python-parameterized")
482 (uri (pypi-uri "parameterized" version))
485 "1qj1939shm48d9ql6fm1nrdy4p7sdyj8clz1szh5swwpf1qqxxfa"))))
486 (build-system python-build-system)
487 (arguments '(#:tests? #f)) ; there are no tests
488 (home-page "https://github.com/wolever/parameterized")
489 (synopsis "Parameterized testing with any Python test framework")
491 "Parameterized is a Python library that aims to fix parameterized testing
492 for every Python test framework. It supports nose, py.test, and unittest.")
493 (license license:bsd-2)))
495 (define-public python2-parameterized
496 (package-with-python2 python-parameterized))
498 (define-public python-mock
505 (uri (pypi-uri "mock" version))
508 "1flbpksir5sqrvq2z0dp8sl4bzbadg21sj4d42w3klpdfvgvcn5i"))))
510 `(("python-pbr" ,python-pbr-minimal)
511 ("python-six" ,python-six)))
512 (build-system python-build-system)
514 `(("python-unittest2" ,python-unittest2)))
517 (modify-phases %standard-phases
520 (zero? (system* "unit2")))))))
521 (home-page "https://github.com/testing-cabal/mock")
522 (synopsis "Python mocking and patching library for testing")
524 "Mock is a library for testing in Python. It allows you to replace parts
525 of your system under test with mock objects and make assertions about how they
527 (properties `((python2-variant . ,(delay python2-mock))))
528 (license license:expat)))
530 (define-public python2-mock
531 (let ((base (package-with-python2
532 (strip-python2-variant python-mock))))
533 (package (inherit base)
535 `(("python2-functools32" ,python2-functools32)
536 ("python2-funcsigs" ,python2-funcsigs)
537 ,@(package-propagated-inputs base))))))
539 (define-public python-nose
546 (uri (pypi-uri "nose" version))
549 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
550 (build-system python-build-system)
552 '(#:tests? #f)) ; FIXME: test suite fails
553 (home-page "http://readthedocs.org/docs/nose/")
554 (synopsis "Python testing library")
556 "Nose extends the unittest library to make testing easier.")
557 (license license:lgpl2.0+)))
559 (define-public python2-nose
560 (package-with-python2 python-nose))
562 (define-public python-nose2
564 (name "python-nose2")
569 (uri (pypi-uri "nose2" version))
572 "1x4zjq1zlyrh8b9ba0cmafd3w94pxhid408kibyjd3s6h1lap6s7"))))
573 (build-system python-build-system)
574 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
576 `(("python-cov-core" ,python-cov-core)
577 ("python-pytest-cov" ,python-pytest-cov)
578 ("python-six" ,python-six)))
579 (home-page "https://github.com/nose-devs/nose2")
580 (synopsis "Next generation of nicer testing for Python")
582 "Nose2 is the next generation of nicer testing for Python, based on the
583 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
584 better plugin api, being easier for users to configure, and simplifying internal
585 interfaces and processes.")
586 (license license:bsd-2)))
588 (define-public python2-nose2
589 (package-with-python2 python-nose2))
591 (define-public python-unittest2
593 (name "python-unittest2")
598 (uri (pypi-uri "unittest2" version))
600 (search-patches "python-unittest2-python3-compat.patch"
601 "python-unittest2-remove-argparse.patch"))
604 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
605 (build-system python-build-system)
608 (modify-phases %standard-phases
611 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
613 `(("python-six" ,python-six)
614 ("python-traceback2" ,python-traceback2)))
615 (home-page "http://pypi.python.org/pypi/unittest2")
616 (synopsis "Python unit testing library")
618 "Unittest2 is a replacement for the unittest module in the Python
620 (license license:psfl)))
622 (define-public python2-unittest2
623 (package-with-python2 python-unittest2))
625 (define-public python-pytest
627 (name "python-pytest")
632 (uri (pypi-uri "pytest" version))
635 "17grcfvd6ggvvqmprwv5y8g319nayam70hr43ssjwj40ws27z858"))))
636 (build-system python-build-system)
639 (modify-phases %standard-phases
640 (add-before 'check 'disable-invalid-tests
642 ;; Some tests involves the /usr directory, and fails.
643 (substitute* "testing/test_argcomplete.py"
644 (("def test_remove_dir_prefix\\(self\\):")
645 "@pytest.mark.xfail\n def test_remove_dir_prefix(self):"))
646 (substitute* "testing/test_argcomplete.py"
647 (("def test_remove_dir_prefix" line)
648 (string-append "@pytest.mark.skip"
649 "(reason=\"Assumes that /usr exists.\")\n "
652 (replace 'check (lambda _ (invoke "pytest" "-vv"))))))
654 `(("python-atomicwrites" ,python-atomicwrites)
655 ("python-attrs" ,python-attrs-bootstrap)
656 ("python-more-itertools" ,python-more-itertools)
657 ("python-pluggy" ,python-pluggy)
658 ("python-py" ,python-py)
659 ("python-six" ,python-six-bootstrap)))
661 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
663 ("python-hypothesis" ,python-hypothesis)
664 ("python-nose" ,python-nose)
665 ("python-mock" ,python-mock)
666 ("python-pytest" ,python-pytest-bootstrap)
667 ("python-setuptools-scm" ,python-setuptools-scm)))
668 (home-page "http://pytest.org")
669 (synopsis "Python testing library")
671 "Pytest is a testing tool that provides auto-discovery of test modules
672 and functions, detailed info on failing assert statements, modular fixtures,
673 and many external plugins.")
674 (license license:expat)
675 (properties `((python2-variant . ,(delay python2-pytest))))))
677 (define-public python2-pytest
678 (let ((pytest (package-with-python2
679 (strip-python2-variant python-pytest))))
683 `(("python2-funcsigs" ,python2-funcsigs)
684 ("python2-pathlib2" ,python2-pathlib2)
685 ,@(package-propagated-inputs pytest))))))
687 (define-public python-pytest-bootstrap
689 (inherit (strip-python2-variant python-pytest))
690 (name "python-pytest-bootstrap")
691 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
692 (arguments `(#:tests? #f))
693 (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
695 (define-public python2-pytest-bootstrap
696 (let ((pytest (package-with-python2
697 (strip-python2-variant python-pytest-bootstrap))))
698 (package (inherit pytest)
700 `(("python2-funcsigs" ,python2-funcsigs-bootstrap)
701 ("python2-pathlib2" ,python2-pathlib2-bootstrap)
702 ,@(package-propagated-inputs pytest))))))
704 (define-public python-pytest-cov
706 (name "python-pytest-cov")
711 (uri (pypi-uri "pytest-cov" version))
714 "0bbfpwdh9k3636bxc88vz9fa7vf4akchgn513ql1vd0xy4n7bah3"))))
715 (build-system python-build-system)
718 (modify-phases %standard-phases
721 ;; options taken from tox.ini
722 ;; TODO: make "--restructuredtext" tests pass. They currently fail
723 ;; with "Duplicate implicit target name"
724 (invoke "python" "./setup.py" "check"
725 "--strict" "--metadata"))))))
727 `(("python-coverage" ,python-coverage)
728 ("python-pytest" ,python-pytest)))
729 (home-page "https://github.com/pytest-dev/pytest-cov")
730 (synopsis "Pytest plugin for measuring coverage")
732 "Pytest-cov produces coverage reports. It supports centralised testing and
733 distributed testing in both @code{load} and @code{each} modes. It also
734 supports coverage of subprocesses.")
735 (license license:expat)))
737 (define-public python2-pytest-cov
738 (package-with-python2 python-pytest-cov))
740 (define-public python-pytest-runner
742 (name "python-pytest-runner")
747 (uri (pypi-uri "pytest-runner" version))
750 "1gkpyphawxz38ni1gdq1fmwyqcg02m7ypzqvv46z06crwdxi2gyj"))))
751 (build-system python-build-system)
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 "1h6lgpmsvs9s8j2s80v06f9f3iaw1n1rc51mbrxk1f12sw4q56nq"))))
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 (patches (search-patches "python-testtools.patch"))))
890 (build-system python-build-system)
891 (arguments '(#:tests? #f))
893 `(("python-extras" ,python-extras)
894 ("python-fixtures" ,python-fixtures-bootstrap)
895 ("python-mimeparse" ,python-mimeparse)
896 ("python-pbr" ,python-pbr-minimal)
897 ("python-six" ,python-six)
898 ("python-traceback2" ,python-traceback2)
899 ("python-unittest2" ,python-unittest2)))
900 (home-page "https://github.com/testing-cabal/testtools")
902 "Extensions to the Python standard library unit testing framework")
904 "This package is only for bootstrapping. Do not use this.")
905 (license license:psfl)))
907 (define-public python2-testtools-bootstrap
908 (package-with-python2 python-testtools-bootstrap))
910 (define-public python-testtools
912 (inherit python-testtools-bootstrap)
913 (name "python-testtools")
915 `(#:phases (modify-phases %standard-phases
918 (invoke "python" "-m" "testtools.run"
919 "testtools.tests.test_suite"))))))
921 `(("python-extras" ,python-extras)
922 ("python-fixtures" ,python-fixtures)
923 ("python-mimeparse" ,python-mimeparse)
924 ("python-pbr" ,python-pbr)
925 ("python-six" ,python-six)
926 ("python-traceback2" ,python-traceback2)
927 ("python-unittest2" ,python-unittest2)))
929 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
931 "Testtools extends the Python standard library unit testing framework to
932 provide matchers, more debugging information, and cross-Python
935 (define-public python2-testtools
936 (package-with-python2 python-testtools))
938 (define-public python-testscenarios-bootstrap
940 (name "python-testscenarios-bootstrap")
945 (uri (pypi-uri "testscenarios" version))
948 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
949 (build-system python-build-system)
951 `(#:phases (modify-phases %standard-phases
954 (invoke "python" "-m" "testtools.run"
955 "testscenarios.test_suite"))))))
957 `(("python-pbr" ,python-pbr-minimal)
958 ("python-testtools" ,python-testtools-bootstrap)))
959 (home-page "https://launchpad.net/testscenarios")
960 (synopsis "Pyunit extension for dependency injection")
962 "This package is only for bootstrapping. Don't use this.")
963 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
965 (define-public python2-testscenarios-bootstrap
966 (package-with-python2 python-testscenarios-bootstrap))
968 (define-public python-testscenarios
970 (inherit python-testscenarios-bootstrap)
971 (name "python-testscenarios")
973 `(("python-pbr" ,python-pbr)
974 ("python-testtools" ,python-testtools)))
976 "Testscenarios provides clean dependency injection for Python unittest
979 (define-public python2-testscenarios
980 (package-with-python2 python-testscenarios))
982 ;; Testresources requires python-pbr at runtime, but pbr needs it for its
983 ;; own tests. Hence this bootstrap variant.
984 (define-public python-testresources-bootstrap
986 (name "python-testresources-bootstrap")
990 (uri (pypi-uri "testresources" version))
993 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
994 (build-system python-build-system)
995 (arguments '(#:tests? #f))
997 `(("python-pbr" ,python-pbr-minimal)))
998 (home-page "https://launchpad.net/testresources")
1000 "Pyunit extension for managing test resources")
1002 "This package is only here for bootstrapping purposes. Use the regular
1003 testresources package instead.")
1004 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1006 (define-public python2-testresources-bootstrap
1007 (package-with-python2 python-testresources-bootstrap))
1009 (define-public python-testresources
1011 (inherit python-testresources-bootstrap)
1012 (name "python-testresources")
1014 `(("python-pbr" ,python-pbr)))
1017 `(("python-fixtures" ,python-fixtures)
1018 ("python-testtols" ,python-testtools)))
1020 "Testresources is an extension to Python's unittest to allow declarative
1021 use of resources by test cases.")))
1023 (define-public python2-testresources
1024 (package-with-python2 python-testresources))
1026 (define-public python-subunit-bootstrap
1028 (name "python-subunit-bootstrap")
1033 (uri (pypi-uri "python-subunit" version))
1036 "1yii2gx3z6323as3iraj1yphj76dy7i3h6kj63pnc5y0hwjs5sgx"))))
1037 (build-system python-build-system)
1039 `(("python-extras" ,python-extras)
1040 ("python-testtools" ,python-testtools-bootstrap)))
1042 `(("python-fixtures" ,python-fixtures-bootstrap)
1043 ("python-hypothesis" ,python-hypothesis)
1044 ("python-testscenarios" ,python-testscenarios-bootstrap)))
1045 (home-page "http://launchpad.net/subunit")
1046 (synopsis "Python implementation of the subunit protocol")
1048 "This package is here for bootstrapping purposes only. Use the regular
1049 python-subunit package instead.")
1050 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1052 (define-public python2-subunit-bootstrap
1053 (package-with-python2 python-subunit-bootstrap))
1055 (define-public python-subunit
1057 (inherit python-subunit-bootstrap)
1058 (name "python-subunit")
1060 `(("python-extras" ,python-extras)
1061 ("python-testtools" ,python-testtools)))
1063 `(("python-fixtures" ,python-fixtures)
1064 ("python-hypothesis" ,python-hypothesis)
1065 ("python-testscenarios" ,python-testscenarios)))
1067 "Python-subunit is a Python implementation of the subunit test streaming
1070 (define-public python2-subunit
1071 (package-with-python2 python-subunit))
1073 ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
1074 ;; own tests. Hence this bootstrap variant.
1075 (define-public python-fixtures-bootstrap
1077 (name "python-fixtures-bootstrap")
1081 (uri (pypi-uri "fixtures" version))
1084 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
1085 (build-system python-build-system)
1086 (arguments `(#:tests? #f))
1088 `(("python-pbr-minimal" ,python-pbr-minimal)
1089 ("python-six" ,python-six)))
1090 (home-page "https://launchpad.net/python-fixtures")
1091 (synopsis "Python test fixture library")
1093 "This package is only used for bootstrapping. Use the regular
1094 python-fixtures package instead.")
1095 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1097 (define-public python2-fixtures-bootstrap
1098 (package-with-python2 python-fixtures-bootstrap))
1100 (define-public python-fixtures
1102 (inherit python-fixtures-bootstrap)
1103 (name "python-fixtures")
1106 (modify-phases %standard-phases
1109 (invoke "python" "-m" "testtools.run"
1110 "fixtures.test_suite"))))))
1112 ;; Fixtures uses pbr at runtime to check versions, etc.
1113 `(("python-pbr" ,python-pbr)
1114 ("python-six" ,python-six)))
1116 `(("python-mock" ,python-mock)
1117 ("python-testtools" ,python-testtools-bootstrap)))
1119 "Fixtures provides a way to create reusable state, useful when writing
1122 (define-public python2-fixtures
1123 (package-with-python2 python-fixtures))
1125 (define-public python-testrepository-bootstrap
1127 (name "python-testrepository-bootstrap")
1133 "https://pypi.python.org/packages/source/t/testrepository/testrepository-"
1137 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1138 (build-system python-build-system)
1139 (arguments '(#:tests? #f))
1141 `(("python-fixtures" ,python-fixtures-bootstrap)
1142 ("python-subunit" ,python-subunit-bootstrap)
1143 ("python-testtools" ,python-testtools-bootstrap)))
1145 `(("python-mimeparse" ,python-mimeparse)))
1146 (home-page "https://launchpad.net/testrepository")
1147 (synopsis "Database for Python test results")
1149 "Bootstrap package for python-testrepository. Don't use this.")
1150 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1152 (define-public python2-testrepository-bootstrap
1153 (package-with-python2 python-testrepository-bootstrap))
1155 (define-public python-testrepository
1157 (inherit python-testrepository-bootstrap)
1158 (name "python-testrepository")
1160 ;; FIXME: Many tests are failing.
1163 `(("python-fixtures" ,python-fixtures)
1164 ("python-subunit" ,python-subunit)
1165 ("python-testtools" ,python-testtools)))
1167 `(("python-mimeparse" ,python-mimeparse)))
1168 (description "Testrepository provides a database of test results which can
1169 be used as part of a developer's workflow to check things such as what tests
1170 have failed since the last commit or what tests are currently failing.")))
1172 (define-public python2-testrepository
1173 (package-with-python2 python-testrepository))
1175 (define-public python-coverage
1177 (name "python-coverage")
1182 (uri (pypi-uri "coverage" version))
1185 "097l4s3ssxm1vncsn0nw3a1pbzah28773q36c1ab9wz01r04973s"))))
1186 (build-system python-build-system)
1188 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1190 (home-page "http://nedbatchelder.com/code/coverage")
1191 (synopsis "Code coverage measurement for Python")
1193 "Coverage measures code coverage, typically during test execution. It
1194 uses the code analysis tools and tracing hooks provided in the Python standard
1195 library to determine which lines are executable, and which have been
1197 (license license:bsd-3)))
1199 (define-public python2-coverage
1200 (package-with-python2 python-coverage))
1202 (define-public python-cov-core
1204 (name "python-cov-core")
1209 (uri (pypi-uri "cov-core" version))
1212 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1213 (build-system python-build-system)
1215 `(("python-coverage" ,python-coverage)))
1216 (home-page "https://github.com/schlamar/cov-core")
1217 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
1219 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1220 and @code{nose2-cov}. It is useful for developing coverage plugins for these
1221 testing frameworks.")
1222 (license license:expat)))
1224 (define-public python2-cov-core
1225 (package-with-python2 python-cov-core))
1227 (define-public python-codecov
1229 (name "python-codecov")
1234 (uri (pypi-uri "codecov" version))
1237 "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1238 (build-system python-build-system)
1240 `(("python-unittest2" ,python-unittest2)))
1242 `(("python-coverage" ,python-coverage)
1243 ("python-requests" ,python-requests)))
1244 (home-page "http://github.com/codecov/codecov-python")
1245 (synopsis "Upload code coverage reports to @code{codecov.io}")
1247 "Codecov collects code coverage reports from code written in Python, Java,
1248 C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
1249 (license license:asl2.0)))
1251 (define-public python-testpath
1253 (name "python-testpath")
1259 (url "https://github.com/jupyter/testpath")
1261 (file-name (git-file-name name version))
1264 "0r4iiizjql6ny1ln7ciw7rrbjadz1s9zrf2hl0xkgnh3ypd8936f"))))
1265 (build-system python-build-system)
1267 `(#:tests? #f ; this package does not even have a setup.py
1268 #:modules ((guix build python-build-system)
1271 #:imported-modules (,@%python-build-system-modules
1274 (modify-phases %standard-phases
1277 (lambda* (#:key inputs outputs #:allow-other-keys)
1278 (let* ((version (last
1279 (string-split (assoc-ref inputs "python") #\-)))
1280 (x.y (string-join (take (string-split version #\.) 2)
1283 (assoc-ref outputs "out")
1284 "/lib/python" x.y "/site-packages/testpath")))
1286 (copy-recursively "testpath" dir))
1288 (home-page "https://github.com/takluyver/testpath")
1289 (synopsis "Test utilities for code working with files and commands")
1291 "Testpath is a collection of utilities for Python code working with files
1292 and commands. It contains functions to check things on the file system, and
1293 tools for mocking system commands and recording calls to those.")
1294 (license license:expat)))
1296 (define-public python2-testpath
1297 (package-with-python2 python-testpath))
1299 (define-public python-testlib
1301 (name "python-testlib")
1307 "https://pypi.python.org/packages/source/t/testlib/testlib-"
1310 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1311 (build-system python-build-system)
1313 `(("unzip" ,unzip))) ; for unpacking the source
1314 (synopsis "Python micro test suite harness")
1315 (description "A micro unittest suite harness for Python.")
1316 (home-page "https://github.com/trentm/testlib")
1317 (license license:expat)))
1319 (define-public python2-testlib
1320 (package-with-python2 python-testlib))
1322 ;;; The software provided by this package was integrated into pytest 2.8.
1323 (define-public python-pytest-cache
1325 (name "python-pytest-cache")
1329 (uri (pypi-uri "pytest-cache" version))
1332 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1333 (build-system python-build-system)
1335 `(("python-apipkg" ,python-apipkg)
1336 ("python-execnet" ,python-execnet)
1337 ("python-py" ,python-py)
1338 ("python-pytest" ,python-pytest)))
1339 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1340 (description "The pytest-cache plugin provides tools to rerun failures from
1341 the last py.test invocation.")
1342 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1343 (license license:expat)))
1345 (define-public python2-pytest-cache
1346 (package-with-python2 python-pytest-cache))
1348 (define-public python-pytest-localserver
1350 (name "python-pytest-localserver")
1354 (uri (pypi-uri "pytest-localserver" version))
1357 "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
1358 (build-system python-build-system)
1361 (modify-phases %standard-phases
1364 (invoke "py.test" "-v"))))))
1366 `(("python-pytest" ,python-pytest)
1367 ("python-requests" ,python-requests)
1368 ("python-six" ,python-six)))
1370 `(("python-werkzeug" ,python-werkzeug)))
1371 (synopsis "Py.test plugin to test server connections locally")
1372 (description "Pytest-localserver is a plugin for the pytest testing
1373 framework which enables you to test server connections locally.")
1374 (home-page "https://pypi.python.org/pypi/pytest-localserver")
1375 (license license:expat)))
1377 (define-public python-pytest-xprocess
1379 (name "python-pytest-xprocess")
1383 (uri (pypi-uri "pytest-xprocess" version))
1386 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1387 (build-system python-build-system)
1389 `(("python-pytest" ,python-pytest)
1390 ("python-pytest-cache" ,python-pytest-cache)
1391 ("python-psutil" ,python-psutil)))
1392 (synopsis "Pytest plugin to manage external processes across test runs")
1393 (description "Pytest-xprocess is an experimental py.test plugin for managing
1394 processes across test runs.")
1395 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1396 (license license:expat)))
1398 (define-public python-pytest-subtesthack
1400 (name "python-pytest-subtesthack")
1404 (uri (pypi-uri "pytest-subtesthack" version))
1407 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1408 (build-system python-build-system)
1410 `(("python-pytest" ,python-pytest)))
1411 (synopsis "Set-up and tear-down fixtures for unit tests")
1412 (description "This plugin allows you to set up and tear down fixtures within
1413 unit test functions that use @code{py.test}. This is useful for using
1414 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1415 function multiple times, without setting up or tearing down fixture state as is
1416 normally the case.")
1417 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1418 (license license:unlicense)))
1420 (define-public python2-pytest-subtesthack
1421 (package-with-python2 python-pytest-subtesthack))
1423 (define-public python-pytest-sugar
1425 (name "python-pytest-sugar")
1430 (uri (pypi-uri "pytest-sugar" version))
1433 "1asq7yc4g8bx2sn7yy974mhc9ywvaihasjab4inkirdwn9s7mn7w"))))
1434 (build-system python-build-system)
1436 `(("python-packaging" ,python-packaging)
1437 ("python-pytest" ,python-pytest)
1438 ("python-termcolor" ,python-termcolor)))
1439 (home-page "https://pivotfinland.com/pytest-sugar/")
1440 (synopsis "Plugin for pytest that changes the default look and feel")
1442 "@code{pytest-sugar} is a plugin for py.test that changes the default
1443 look and feel of py.test, using a progress bar and showing failures and errors
1445 (license license:bsd-3)))
1447 (define-public python-hypothesis
1449 (name "python-hypothesis")
1453 (uri (pypi-uri "hypothesis" version))
1456 "1rshs1japfmwgar98yrkq4hg4z2q76hlnq7w2n3lfbjnscn1jd9b"))))
1457 (build-system python-build-system)
1459 `(;; FIXME: Change to python-flake8 in the next rebuild cycle.
1460 ("python-flake8" ,python-flake8-3.5)
1461 ("python-pytest" ,python-pytest-bootstrap)))
1463 `(("python-attrs" ,python-attrs-bootstrap)
1464 ("python-coverage" ,python-coverage)))
1465 (synopsis "Library for property based testing")
1466 (description "Hypothesis is a library for testing your Python code against a
1467 much larger range of examples than you would ever want to write by hand. It’s
1468 based on the Haskell library, Quickcheck, and is designed to integrate
1469 seamlessly into your existing Python unit testing work flow.")
1470 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
1471 (license license:mpl2.0)
1472 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1474 (define-public python2-hypothesis
1475 (let ((hypothesis (package-with-python2
1476 (strip-python2-variant python-hypothesis))))
1477 (package (inherit hypothesis)
1479 `(("python2-enum34" ,python2-enum34)
1480 ,@(package-propagated-inputs hypothesis))))))
1482 (define-public python-lit
1489 (uri (pypi-uri "lit" version))
1492 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
1493 (build-system python-build-system)
1496 (modify-phases %standard-phases
1499 (invoke "python" "lit.py" "tests"))))))
1502 (home-page "https://llvm.org/")
1503 (synopsis "LLVM Software Testing Tool")
1504 (description "@code{lit} is a portable tool for executing LLVM and Clang
1505 style test suites, summarizing their results, and providing indication of
1507 (license license:ncsa)))
1509 (define-public python2-lit
1510 (package-with-python2 python-lit))
1512 (define-public python-pytest-pep8
1514 (name "python-pytest-pep8")
1518 (uri (pypi-uri "pytest-pep8" version))
1521 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
1522 (build-system python-build-system)
1524 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
1526 `(("python-pytest" ,python-pytest)))
1528 `(("python-pep8" ,python-pep8)))
1529 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
1530 (synopsis "Py.test plugin to check PEP8 requirements")
1531 (description "Pytest plugin for checking PEP8 compliance.")
1532 (license license:expat)))
1534 (define-public python2-pytest-pep8
1535 (package-with-python2 python-pytest-pep8))
1537 (define-public python-pytest-flakes
1539 (name "python-pytest-flakes")
1543 (uri (pypi-uri "pytest-flakes" version))
1546 "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
1547 (build-system python-build-system)
1550 (modify-phases %standard-phases
1552 (add-after 'install 'check
1553 (lambda* (#:key outputs inputs #:allow-other-keys)
1554 ;; It's easier to run tests after install.
1555 ;; Make installed package available for running the tests
1556 (add-installed-pythonpath inputs outputs)
1557 (invoke "py.test" "-vv"))))))
1559 `(("python-coverage" ,python-coverage)
1560 ("python-pytest" ,python-pytest)
1561 ("python-pytest-cache" ,python-pytest-cache)
1562 ("python-pytest-pep8" ,python-pytest-pep8)))
1564 `(("python-pyflakes" ,python-pyflakes)))
1565 (home-page "https://github.com/fschulze/pytest-flakes")
1566 (synopsis "Py.test plugin to check source code with pyflakes")
1567 (description "Pytest plugin for checking Python source code with pyflakes.")
1568 (license license:expat)))
1570 (define-public python2-pytest-flakes
1571 (package-with-python2 python-pytest-flakes))
1573 (define-public python2-coverage-test-runner
1575 (name "python2-coverage-test-runner")
1581 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
1582 "coverage-test-runner/snapshot/coverage-test-runner-"
1586 "0y1m7z3dl63kmhcmydl1mwg0hacnf6ghrx9dah17j9iasssfa3g7"))))
1587 (build-system python-build-system)
1589 `(#:python ,python-2
1591 (modify-phases %standard-phases
1594 (invoke "./testrun"))))))
1596 `(("python2-coverage" ,python2-coverage)))
1597 (home-page "https://liw.fi/coverage-test-runner/")
1598 (synopsis "Python module for running unit tests")
1599 (description "@code{CoverageTestRunner} is a python module for running
1600 unit tests and failing them if the unit test module does not exercise all
1601 statements in the module it tests.")
1602 (license license:gpl3+)))
1604 (define-public python-pylint
1606 (name "python-pylint")
1612 "https://github.com/PyCQA/pylint/archive/pylint-"
1616 "0mzn1czhf1mgr2wiqfihb274sja02h899b85kywdpivppa9nwrmp"))))
1617 (build-system python-build-system)
1619 `(("python-pytest" ,python-pytest)
1620 ("python-pytest-runner" ,python-pytest-runner)
1621 ("python-tox" ,python-tox)))
1623 `(("python-astroid" ,python-astroid)
1624 ("python-isort" ,python-isort)
1625 ("python-mccabe" ,python-mccabe)
1626 ("python-six" ,python-six)))
1629 (modify-phases %standard-phases
1632 ;; Somehow, tests for python2-pylint
1633 ;; fail if run from the build directory
1634 (let ((work "/tmp/work"))
1636 (setenv "PYTHONPATH"
1637 (string-append (getenv "PYTHONPATH") ":" work))
1638 (copy-recursively "." work)
1639 (with-directory-excursion "/tmp"
1640 (invoke "python" "-m" "unittest" "discover"
1641 "-s" (string-append work "/pylint/test")
1642 "-p" "*test_*.py"))))))))
1643 (home-page "https://github.com/PyCQA/pylint")
1644 (synopsis "Python source code analyzer which looks for coding standard
1646 (description "Pylint is a Python source code analyzer which looks
1647 for programming errors, helps enforcing a coding standard and sniffs
1648 for some code smells (as defined in Martin Fowler's Refactoring book).
1650 Pylint has many rules enabled by default, way too much to silence them
1651 all on a minimally sized program. It's highly configurable and handle
1652 pragmas to control it from within your code. Additionally, it is
1653 possible to write plugins to add your own checks.")
1654 (properties `((python2-variant . ,(delay python2-pylint))))
1655 (license license:gpl2+)))
1657 (define-public python2-pylint
1658 (let ((pylint (package-with-python2
1659 (strip-python2-variant python-pylint))))
1660 (package (inherit pylint)
1662 `(("python2-backports-functools-lru-cache"
1663 ,python2-backports-functools-lru-cache)
1664 ("python2-configparser" ,python2-configparser)
1665 ,@(package-propagated-inputs pylint))))))
1667 (define-public python-paramunittest
1669 (name "python-paramunittest")
1674 (uri (pypi-uri "ParamUnittest" version))
1677 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
1678 (build-system python-build-system)
1680 "https://github.com/rik0/ParamUnittest")
1682 "Simple extension to have parametrized unit tests")
1684 "This package allows to create parametrized unit-tests that work with the standard
1685 unittest package. A parametrized test case is automatically converted to multiple test
1686 cases. Since they are TestCase subclasses, they work with other test suites that
1687 recognize TestCases.")
1688 (license license:bsd-2)))
1690 (define-public python2-python-paramunittest
1691 (package-with-python2 python-paramunittest))
1693 (define-public python-pytest-warnings
1695 (name "python-pytest-warnings")
1700 (uri (pypi-uri "pytest-warnings" version))
1703 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
1704 (build-system python-build-system)
1706 `(("pytest" ,python-pytest)))
1707 (home-page "https://github.com/fschulze/pytest-warnings")
1708 (synopsis "Pytest plugin to list Python warnings in pytest report")
1710 "Python-pytest-warnings is a pytest plugin to list Python warnings in
1712 (license license:expat)
1713 (properties `((python2-variant . ,(delay python2-pytest-warnings))
1714 ;; This package is part of pytest as of version 3.1.0.
1715 (superseded . ,python-pytest)))))
1717 (define-public python2-pytest-warnings
1718 (package (inherit (package-with-python2
1719 (strip-python2-variant python-pytest-warnings)))
1720 (properties `((superseded . ,python2-pytest)))))
1722 (define-public python-pytest-capturelog
1724 (name "python-pytest-capturelog")
1729 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
1732 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
1733 (build-system python-build-system)
1735 `(("pytest" ,python-pytest)))
1736 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
1737 (synopsis "Pytest plugin to catch log messages")
1739 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
1740 (license license:expat)))
1742 (define-public python2-pytest-capturelog
1743 (package-with-python2 python-pytest-capturelog))
1745 (define-public python-pytest-catchlog
1747 (name "python-pytest-catchlog")
1752 (uri (pypi-uri "pytest-catchlog" version ".zip"))
1755 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
1756 (build-system python-build-system)
1758 `(("unzip" ,unzip)))
1760 `(("pytest" ,python-pytest)))
1761 (home-page "https://github.com/eisensheng/pytest-catchlog")
1762 (synopsis "Pytest plugin to catch log messages")
1764 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
1765 a fork of pytest-capturelog.")
1766 (license license:expat)))
1768 (define-public python2-pytest-catchlog
1769 (package-with-python2 python-pytest-catchlog))
1771 (define-public python-nosexcover
1773 (name "python-nosexcover")
1777 (uri (pypi-uri "nosexcover" version))
1780 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
1781 (build-system python-build-system)
1783 `(("python-coverage" ,python-coverage)
1784 ("python-nose" ,python-nose)))
1785 (home-page "http://github.com/cmheisel/nose-xcover")
1786 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
1787 (description "Nose-xcover is a companion to the built-in
1788 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
1789 to a file named coverage.xml.
1791 It will honor all the options you pass to the Nose coverage plugin,
1792 especially -cover-package.")
1793 (license license:expat)))
1795 (define-public python2-nosexcover
1796 (package-with-python2 python-nosexcover))
1798 (define-public python-discover
1800 (name "python-discover")
1806 "https://pypi.python.org/packages/source/d/discover/discover-"
1810 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
1811 (build-system python-build-system)
1812 (home-page "http://pypi.python.org/pypi/discover/")
1814 "Python test discovery for unittest")
1816 "Discover provides test discovery for unittest, a feature that has been
1817 backported from Python 2.7 for Python 2.4+.")
1818 (license license:bsd-3)))
1820 (define-public python2-discover
1821 (package-with-python2 python-discover))
1823 (define-public behave
1829 (uri (pypi-uri "behave" version))
1832 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))))
1833 (build-system python-build-system)
1835 `(("python-mock" ,python-mock)
1836 ("python-nose" ,python-nose)
1837 ("python-pathpy" ,python-pathpy)
1838 ("python-pyhamcrest" ,python-pyhamcrest)
1839 ("python-pytest" ,python-pytest)))
1841 `(("python-six" ,python-six)
1842 ("python-parse" ,python-parse)
1843 ("python-parse-type" ,python-parse-type)))
1845 '(#:test-target "behave_test"))
1846 (home-page "https://github.com/behave/behave")
1847 (synopsis "Python behavior-driven development")
1849 "Behave is a tool for behavior-driven development in python.
1850 Behavior-driven development (or BDD) is an agile software development
1851 technique that encourages collaboration between developers, QA and
1852 non-technical or business participants in a software project. Behave uses
1853 tests written in a natural language style, backed up by Python code.")
1854 (license license:x11)))
1856 (define-public python-behave-web-api
1858 (name "python-behave-web-api")
1863 (uri (pypi-uri "behave-web-api" version))
1866 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
1867 (build-system python-build-system)
1870 (modify-phases %standard-phases
1871 (add-after 'unpack 'fix-dependencies
1873 (substitute* "setup.py"
1874 (("'wheel'") "") ; We don't use it.
1875 (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
1878 `(("behave" ,behave)
1879 ("python-requests" ,python-requests)))
1880 (home-page "https://github.com/jefersondaniel/behave-web-api")
1881 (synopsis "Provides testing for JSON APIs with Behave for Python")
1882 (description "This package provides testing utility modules for testing
1883 JSON APIs with Behave.")
1884 (license license:expat)))
1886 (define-public python2-behave-web-api
1887 (package-with-python2 python-behave-web-api))
1889 (define-public python-rednose
1891 (name "python-rednose")
1896 (uri (pypi-uri "rednose" version))
1899 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
1900 (build-system python-build-system)
1902 `(#:phases (modify-phases %standard-phases
1903 (add-after 'unpack 'patch-setup.py
1905 ;; Six is only required for tests and later versions
1907 (substitute* "setup.py"
1908 (("six==1.10.0") "six"))
1911 `(("python-colorama" ,python-colorama)
1912 ("python-termstyle" ,python-termstyle)))
1914 `(("python-six" ,python-six)
1915 ("python-nose" ,python-nose)))
1916 (home-page "https://github.com/JBKahn/rednose")
1917 (synopsis "Colored output for Python nosetests")
1918 (description "This package provides colored output for the
1919 @command{nosetests} command of the Python Nose unit test framework.")
1920 (license license:bsd-3)))
1922 (define-public python2-rednose
1923 (package-with-python2 python-rednose))
1925 (define-public python-nose-randomly
1927 (name "python-nose-randomly")
1932 (uri (pypi-uri "nose-randomly" version))
1935 "1cw9dlr1zh3w4i438kin7z0rm8092ki52hayisyc43h9pcplq7rn"))))
1936 (build-system python-build-system)
1938 `(("python-nose" ,python-nose)
1939 ("python-numpy" ,python-numpy)))
1940 (home-page "https://github.com/adamchainz/nose-randomly")
1942 "Nose plugin to randomly order tests and control random.seed")
1944 "This is a @code{Nose} plugin to randomly order tests which can be quite
1945 powerful in discovering hidden flaws in the tests themselves, while helping to
1946 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
1947 by resetting it to a repeatable number for each test, enabling the tests to
1948 create data based on random numbers and yet remain repeatable.")
1949 (license license:bsd-3)))
1951 (define-public python2-nose-randomly
1952 (package-with-python2 python-nose-randomly))
1954 (define-public python-nose-timer
1956 (name "python-nose-timer")
1961 (uri (pypi-uri "nose-timer" version))
1964 "0hfz5aqnhf493i9kyb6prm4zm8vx7wmfsyg3nvsnh24lzh2kwx44"))))
1965 (build-system python-build-system)
1967 `(("python-nose" ,python-nose)
1968 ("python-termcolor" ,python-termcolor)))
1969 (home-page "https://github.com/mahmoudimus/nose-timer")
1970 (synopsis "Timer plugin for nosetests")
1971 (description "Shows how much time was needed to run individual tests.")
1972 (license license:expat)))
1974 (define-public python2-nose-timer
1975 (package-with-python2 python-nose-timer))
1977 (define-public python-freezegun
1979 (name "python-freezegun")
1984 (uri (pypi-uri "freezegun" version))
1987 "08m6b42yxb9hk5lv747v9n2qsxyadmkb0k6yg0gxdanwap0slg3h"))))
1988 (build-system python-build-system)
1990 `(("python-mock" ,python-mock)
1991 ("python-nose" ,python-nose)
1992 ("python-coverage" ,python-coverage)))
1994 `(("python-six" ,python-six)
1995 ("python-dateutil" ,python-dateutil)))
1998 (modify-phases %standard-phases
1999 ;; The tests are normally executed via `make test`, but the PyPi
2000 ;; package does not include the Makefile.
2003 (invoke "nosetests" "./tests/"))))))
2004 (home-page "https://github.com/spulec/freezegun")
2005 (synopsis "Test utility for mocking the datetime module")
2007 "FreezeGun is a library that allows your python tests to travel through
2008 time by mocking the datetime module.")
2009 (license license:asl2.0)))
2011 (define-public python2-freezegun
2012 (package-with-python2 python-freezegun))
2014 (define-public python-flexmock
2016 (name "python-flexmock")
2020 (uri (pypi-uri "flexmock" version))
2023 "0arc6njvs6i9v9hgvzk5m50296g7zy5m9d7pyb43vdsdgxrci5gy"))))
2024 (build-system python-build-system)
2025 (home-page "https://flexmock.readthedocs.org")
2026 (synopsis "Testing library for Python")
2028 "flexmock is a testing library for Python that makes it easy to create
2029 mocks, stubs and fakes.")
2030 (license license:bsd-3)))
2032 (define-public python2-flexmock
2033 (package-with-python2 python-flexmock))
2035 (define-public python-flaky
2037 (name "python-flaky")
2041 (uri (pypi-uri "flaky" version))
2044 "18pkmf79rfkfpy1d2rrx3v55nxj762ilyk9rvd6s6dccxw58imsa"))))
2045 (build-system python-build-system)
2047 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2049 (home-page "https://github.com/box/flaky")
2050 (synopsis "Automatically rerun flaky tests")
2052 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2055 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2056 on components that aren't 100% reliable. With flaky, instead of removing
2057 those tests or marking them to @code{@@skip}, they can be automatically
2059 (license license:asl2.0)))
2061 (define-public python2-flaky
2062 (package-with-python2 python-flaky))
2064 (define-public python-pyhamcrest
2066 (name "python-pyhamcrest")
2069 ;; Tests not distributed from pypi release.
2072 (url "https://github.com/hamcrest/PyHamcrest")
2073 (commit (string-append "V" version))))
2074 (file-name (git-file-name name version))
2077 "01qnzj9qnzz0y78qa3ing24ssvszb0adw59xc4qqmdn5wryy606b"))))
2078 (native-inputs ; All native inputs are for tests
2079 `(("python-pytest-cov" ,python-pytest-cov)
2080 ("python-mock" ,python-mock)
2081 ("python-pytest" ,python-pytest)
2082 ("python-hypothesis" ,python-hypothesis)))
2084 `(("python-six" ,python-six)))
2085 (build-system python-build-system)
2086 (home-page "http://hamcrest.org/")
2087 (synopsis "Hamcrest matchers for Python")
2089 "PyHamcrest is a framework for writing matcher objects,
2090 allowing you to declaratively define \"match\" rules.")
2091 (license license:bsd-3)))
2093 (define-public python2-pyhamcrest
2094 (package-with-python2 python-pyhamcrest))
2096 (define-public unittest-cpp
2098 (name "unittest-cpp")
2103 (url "https://github.com/unittest-cpp/unittest-cpp")
2104 (commit (string-append "v" version))))
2105 (file-name (git-file-name name version))
2107 (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
2109 `(#:tests? #f)) ; It's run after build automatically.
2110 (build-system cmake-build-system)
2111 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2112 (synopsis "Lightweight unit testing framework for C++")
2113 (description "UnitTest++ is a lightweight unit testing framework for C++.
2114 It was designed to do test-driven development on a wide variety of platforms.
2115 Simplicity, portability, speed, and small footprint are all very important
2116 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2117 of advanced library and language features, which means it should be easily
2118 portable to just about any platform.")
2119 (license license:expat)))
2121 (define-public libfaketime
2123 (name "libfaketime")
2125 (home-page "https://github.com/wolfcw/libfaketime")
2130 (commit (string-append "v" version))))
2133 "1cin1pqwpsswcv7amiwijirvcg3x1zf2l00s1x84nxc5602fzr5c"))
2134 (file-name (git-file-name name version))))
2135 (build-system gnu-build-system)
2137 '(#:phases (modify-phases %standard-phases
2139 (lambda* (#:key outputs #:allow-other-keys)
2140 (let ((out (assoc-ref outputs "out")))
2142 (setenv "PREFIX" out)
2144 (add-before 'check 'pre-check
2146 (substitute* "test/functests/test_exclude_mono.sh"
2147 (("/bin/bash") (which "bash")))
2149 #:test-target "test"))
2151 `(("perl" ,perl))) ;for tests
2152 (synopsis "Fake the system time for single applications")
2154 "The libfaketime library allows users to modify the system time that an
2155 application \"sees\". It is meant to be loaded using the dynamic linker's
2156 @code{LD_PRELOAD} environment variable. The @command{faketime} command
2157 provides a simple way to achieve this.")
2158 (license license:gpl2)))