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
302 (uri (string-append "https://github.com/danmar/cppcheck/archive/"
305 (base32 "18qlddf1i9bk5nnvy1v2nfxjd46y8wvp3rqz2hrfxjxsyvrfq5yw"))
306 (file-name (string-append name "-" version ".tar.gz"))))
307 (build-system cmake-build-system)
308 (home-page "http://cppcheck.sourceforge.net")
309 (synopsis "Static C/C++ code analyzer")
310 (description "Cppcheck is a static code analyzer for C and C++. Unlike
311 C/C++ compilers and many other analysis tools it does not detect syntax errors
312 in the code. Cppcheck primarily detects the types of bugs that the compilers
313 normally do not detect. The goal is to detect only real errors in the code
314 (i.e. have zero false positives).")
315 (license license:gpl3+)))
317 (define-public go-gopkg.in-check.v1
318 (let ((commit "20d25e2804050c1cd24a7eea1e7a6447dd0e74ec")
321 (name "go-gopkg.in-check.v1")
322 (version (git-version "0.0.0" revision commit))
326 (url "https://github.com/go-check/check.git")
328 (file-name (git-file-name name version))
331 "0k1m83ji9l1a7ng8a7v40psbymxasmssbrrhpdv2wl4rhs0nc3np"))))
332 (build-system go-build-system)
334 '(#:import-path "gopkg.in/check.v1"))
335 (synopsis "Rich testing extension for Go's testing package")
337 "@code{check} is a rich testing extension for Go's testing package.")
338 (home-page "https://github.com/go-check/check")
339 (license license:bsd-2))))
341 (define-public go-github.com-smartystreets-gunit
343 (name "go-github.com-smartystreets-gunit")
348 (url "https://github.com/smartystreets/gunit")
350 (file-name (git-file-name name version))
353 "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
354 (build-system go-build-system)
356 '(;; TODO: This package depends on go-github.com-smartystreets-assertions
357 ;; for running the tests, but go-github.com-smartystreets-assertions
358 ;; depends on this package, so break this loop by not running the tests
361 #:import-path "github.com/smartystreets/gunit"))
362 (synopsis "Testing tool for Go, in the style of xUnit")
364 "@code{gunit} allows the test author to use a struct as the scope for a
365 group of related test cases, in the style of xUnit fixtures. This makes
366 extraction of setup/teardown behavior (as well as invoking the system under
367 test) much simpler.")
368 (home-page "https://github.com/smartystreets/gunit")
369 (license license:expat)))
371 (define-public go-github.com-smartystreets-assertions
373 (name "go-github.com-smartystreets-assertions")
378 (url "https://github.com/smartystreets/assertions")
380 (file-name (git-file-name name version))
383 "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
384 (build-system go-build-system)
386 '(#:import-path "github.com/smartystreets/assertions"))
388 `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
389 (synopsis "Assertions for testing with Go")
391 "The @code{assertions} package provides convinient assertion functions
392 for writing tests in Go.")
393 (home-page "https://github.com/smartystreets/assertions")
394 (license license:expat)))
396 (define-public go-github.com-smartystreets-goconvey
398 (name "go-github.com-smartystreets-goconvey")
403 (url "https://github.com/smartystreets/goconvey")
405 (file-name (git-file-name name version))
408 "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
409 (build-system go-build-system)
411 '(#:import-path "github.com/smartystreets/goconvey"))
413 `(("go-github.com-jtolds-gls" ,go-github.com-jtolds-gls)
414 ("go-github.com-smartystreets-assertions" ,go-github.com-smartystreets-assertions)))
415 (synopsis "Go testing tool with both a web and terminal user interface")
417 "GoConvey is a testing tool for Go. It integrates with go test, can show
418 test coverage and has a web user interface that will refresh automatically.")
419 (home-page "https://github.com/smartystreets/goconvey")
420 (license license:expat)))
422 ;; XXX When updating, check whether ZNC's GOOGLETEST-SOURCES can be
423 ;; switched back to simply using (PACKAGE-SOURCE ...).
424 (define-public googletest
431 (uri (string-append "https://github.com/google/googletest/archive/"
432 "release-" version ".tar.gz"))
433 (file-name (string-append name "-" version ".tar.gz"))
436 "1n5p1m2m3fjrjdj752lf92f9wq3pl5cbsfrb49jqbg52ghkz99jq"))))
437 (build-system cmake-build-system)
439 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
441 `(("python-2" ,python-2)))
442 (home-page "https://github.com/google/googletest/")
443 (synopsis "Test discovery and XUnit test framework")
444 (description "Google Test features an XUnit test framework, automated test
445 discovery, death tests, assertions, parameterized tests and XML test report
447 (license license:bsd-3)))
449 (define-public cpputest
456 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
457 version "/cpputest-" version ".tar.gz"))
460 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
461 (build-system gnu-build-system)
463 `(("googletest" ,googletest)))
464 (home-page "https://cpputest.github.io/")
465 (synopsis "Unit testing and mocking framework for C/C++")
467 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
468 C++ but is used in C and C++ projects and frequently used in embedded systems
469 but it works for any C/C++ project.")
470 (license license:bsd-3)))
472 (define-public python-parameterized
474 (name "python-parameterized")
479 (uri (pypi-uri "parameterized" version))
482 "1qj1939shm48d9ql6fm1nrdy4p7sdyj8clz1szh5swwpf1qqxxfa"))))
483 (build-system python-build-system)
484 (arguments '(#:tests? #f)) ; there are no tests
485 (home-page "https://github.com/wolever/parameterized")
486 (synopsis "Parameterized testing with any Python test framework")
488 "Parameterized is a Python library that aims to fix parameterized testing
489 for every Python test framework. It supports nose, py.test, and unittest.")
490 (license license:bsd-2)))
492 (define-public python2-parameterized
493 (package-with-python2 python-parameterized))
495 (define-public python-mock
502 (uri (pypi-uri "mock" version))
505 "1flbpksir5sqrvq2z0dp8sl4bzbadg21sj4d42w3klpdfvgvcn5i"))))
507 `(("python-pbr" ,python-pbr-minimal)
508 ("python-six" ,python-six)))
509 (build-system python-build-system)
511 `(("python-unittest2" ,python-unittest2)))
514 (modify-phases %standard-phases
517 (zero? (system* "unit2")))))))
518 (home-page "https://github.com/testing-cabal/mock")
519 (synopsis "Python mocking and patching library for testing")
521 "Mock is a library for testing in Python. It allows you to replace parts
522 of your system under test with mock objects and make assertions about how they
524 (properties `((python2-variant . ,(delay python2-mock))))
525 (license license:expat)))
527 (define-public python2-mock
528 (let ((base (package-with-python2
529 (strip-python2-variant python-mock))))
530 (package (inherit base)
532 `(("python2-functools32" ,python2-functools32)
533 ("python2-funcsigs" ,python2-funcsigs)
534 ,@(package-propagated-inputs base))))))
536 (define-public python-nose
543 (uri (pypi-uri "nose" version))
546 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
547 (build-system python-build-system)
549 '(#:tests? #f)) ; FIXME: test suite fails
550 (home-page "http://readthedocs.org/docs/nose/")
551 (synopsis "Python testing library")
553 "Nose extends the unittest library to make testing easier.")
554 (license license:lgpl2.0+)))
556 (define-public python2-nose
557 (package-with-python2 python-nose))
559 (define-public python-nose2
561 (name "python-nose2")
566 (uri (pypi-uri "nose2" version))
569 "1x4zjq1zlyrh8b9ba0cmafd3w94pxhid408kibyjd3s6h1lap6s7"))))
570 (build-system python-build-system)
571 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
573 `(("python-cov-core" ,python-cov-core)
574 ("python-pytest-cov" ,python-pytest-cov)
575 ("python-six" ,python-six)))
576 (home-page "https://github.com/nose-devs/nose2")
577 (synopsis "Next generation of nicer testing for Python")
579 "Nose2 is the next generation of nicer testing for Python, based on the
580 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
581 better plugin api, being easier for users to configure, and simplifying internal
582 interfaces and processes.")
583 (license license:bsd-2)))
585 (define-public python2-nose2
586 (package-with-python2 python-nose2))
588 (define-public python-unittest2
590 (name "python-unittest2")
595 (uri (pypi-uri "unittest2" version))
597 (search-patches "python-unittest2-python3-compat.patch"
598 "python-unittest2-remove-argparse.patch"))
601 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
602 (build-system python-build-system)
605 (modify-phases %standard-phases
608 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
610 `(("python-six" ,python-six)
611 ("python-traceback2" ,python-traceback2)))
612 (home-page "http://pypi.python.org/pypi/unittest2")
613 (synopsis "Python unit testing library")
615 "Unittest2 is a replacement for the unittest module in the Python
617 (license license:psfl)))
619 (define-public python2-unittest2
620 (package-with-python2 python-unittest2))
622 (define-public python-pytest
624 (name "python-pytest")
629 (uri (pypi-uri "pytest" version))
632 "17grcfvd6ggvvqmprwv5y8g319nayam70hr43ssjwj40ws27z858"))))
633 (build-system python-build-system)
636 (modify-phases %standard-phases
637 (add-before 'check 'disable-invalid-tests
639 ;; Some tests involves the /usr directory, and fails.
640 (substitute* "testing/test_argcomplete.py"
641 (("def test_remove_dir_prefix\\(self\\):")
642 "@pytest.mark.xfail\n def test_remove_dir_prefix(self):"))
643 (substitute* "testing/test_argcomplete.py"
644 (("def test_remove_dir_prefix" line)
645 (string-append "@pytest.mark.skip"
646 "(reason=\"Assumes that /usr exists.\")\n "
649 (replace 'check (lambda _ (invoke "pytest" "-vv"))))))
651 `(("python-atomicwrites" ,python-atomicwrites)
652 ("python-attrs" ,python-attrs-bootstrap)
653 ("python-more-itertools" ,python-more-itertools)
654 ("python-pluggy" ,python-pluggy)
655 ("python-py" ,python-py)
656 ("python-six" ,python-six-bootstrap)))
658 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
660 ("python-hypothesis" ,python-hypothesis)
661 ("python-nose" ,python-nose)
662 ("python-mock" ,python-mock)
663 ("python-pytest" ,python-pytest-bootstrap)
664 ("python-setuptools-scm" ,python-setuptools-scm)))
665 (home-page "http://pytest.org")
666 (synopsis "Python testing library")
668 "Pytest is a testing tool that provides auto-discovery of test modules
669 and functions, detailed info on failing assert statements, modular fixtures,
670 and many external plugins.")
671 (license license:expat)
672 (properties `((python2-variant . ,(delay python2-pytest))))))
674 (define-public python2-pytest
675 (let ((pytest (package-with-python2
676 (strip-python2-variant python-pytest))))
680 `(("python2-funcsigs" ,python2-funcsigs)
681 ("python2-pathlib2" ,python2-pathlib2)
682 ,@(package-propagated-inputs pytest))))))
684 (define-public python-pytest-bootstrap
686 (inherit (strip-python2-variant python-pytest))
687 (name "python-pytest-bootstrap")
688 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
689 (arguments `(#:tests? #f))
690 (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
692 (define-public python2-pytest-bootstrap
693 (let ((pytest (package-with-python2
694 (strip-python2-variant python-pytest-bootstrap))))
695 (package (inherit pytest)
697 `(("python2-funcsigs" ,python2-funcsigs-bootstrap)
698 ("python2-pathlib2" ,python2-pathlib2-bootstrap)
699 ,@(package-propagated-inputs pytest))))))
701 (define-public python-pytest-cov
703 (name "python-pytest-cov")
708 (uri (pypi-uri "pytest-cov" version))
711 "0bbfpwdh9k3636bxc88vz9fa7vf4akchgn513ql1vd0xy4n7bah3"))))
712 (build-system python-build-system)
715 (modify-phases %standard-phases
718 ;; options taken from tox.ini
719 ;; TODO: make "--restructuredtext" tests pass. They currently fail
720 ;; with "Duplicate implicit target name"
721 (invoke "python" "./setup.py" "check"
722 "--strict" "--metadata"))))))
724 `(("python-coverage" ,python-coverage)
725 ("python-pytest" ,python-pytest)))
726 (home-page "https://github.com/pytest-dev/pytest-cov")
727 (synopsis "Pytest plugin for measuring coverage")
729 "Pytest-cov produces coverage reports. It supports centralised testing and
730 distributed testing in both @code{load} and @code{each} modes. It also
731 supports coverage of subprocesses.")
732 (license license:expat)))
734 (define-public python2-pytest-cov
735 (package-with-python2 python-pytest-cov))
737 (define-public python-pytest-runner
739 (name "python-pytest-runner")
744 (uri (pypi-uri "pytest-runner" version))
747 "1gkpyphawxz38ni1gdq1fmwyqcg02m7ypzqvv46z06crwdxi2gyj"))))
748 (build-system python-build-system)
750 `(("python-pytest" ,python-pytest-bootstrap)
751 ("python-setuptools-scm" ,python-setuptools-scm)))
752 (home-page "https://github.com/pytest-dev/pytest-runner")
753 (synopsis "Invoke py.test as a distutils command")
755 "This package provides a @command{pytest-runner} command that
756 @file{setup.py} files can use to run tests.")
757 (license license:expat)))
759 (define-public python2-pytest-runner
760 (package-with-python2 python-pytest-runner))
762 (define-public python-pytest-mock
764 (name "python-pytest-mock")
769 (uri (pypi-uri "pytest-mock" version))
772 "1h6lgpmsvs9s8j2s80v06f9f3iaw1n1rc51mbrxk1f12sw4q56nq"))))
773 (build-system python-build-system)
775 `(("python-setuptools-scm" ,python-setuptools-scm)))
777 `(("python-pytest" ,python-pytest)))
778 (home-page "https://github.com/pytest-dev/pytest-mock/")
779 (synopsis "Thin-wrapper around the mock package for easier use with py.test")
781 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
782 around the patching API provided by the @code{mock} package, but with the
783 benefit of not having to worry about undoing patches at the end of a test.
784 The mocker fixture has the same API as @code{mock.patch}, supporting the
786 (properties `((python2-variant . ,(delay python2-pytest-mock))))
787 (license license:expat)))
789 (define-public python2-pytest-mock
790 (let ((base (package-with-python2
791 (strip-python2-variant python-pytest-mock))))
792 (package (inherit base)
794 `(("python2-mock" ,python2-mock)
795 ,@(package-propagated-inputs base))))))
797 (define-public python-pytest-xdist
799 (name "python-pytest-xdist")
804 (uri (pypi-uri "pytest-xdist" version ".zip"))
807 "08rn2l39ds60xshs4js787l84pfckksqklfq2wq9x8ig2aci2pja"))
808 (modules '((guix build utils)))
811 ;; Remove pre-compiled .pyc files from source.
812 (for-each delete-file-recursively
813 (find-files "." "__pycache__" #:directories? #t))
814 (for-each delete-file (find-files "." "\\.pyc$"))
816 (build-system python-build-system)
818 '(#:tests? #f)) ;FIXME: Some tests are failing.
820 ;; (modify-phases %standard-phases
822 ;; (add-after 'install 'check
823 ;; (lambda* (#:key inputs outputs #:allow-other-keys)
824 ;; (add-installed-pythonpath inputs outputs)
825 ;; (zero? (system* "py.test" "-v")))))
828 ("python-setuptools-scm" ,python-setuptools-scm)))
830 `(("python-execnet" ,python-execnet)
831 ("python-pytest" ,python-pytest)
832 ("python-py" ,python-py)))
834 "https://github.com/pytest-dev/pytest-xdist")
836 "Plugin for py.test with distributed testing and loop-on-failing modes")
838 "The pytest-xdist plugin extends py.test with some unique test execution
839 modes: parallelization, running tests in boxed subprocesses, the ability
840 to run tests repeatedly when failed, and the ability to run tests on multiple
841 Python interpreters or platforms. It uses rsync to copy the existing
842 program code to a remote location, executes there, and then syncs the
844 (license license:expat)))
846 (define-public python2-pytest-xdist
847 (package-with-python2 python-pytest-xdist))
849 (define-public python-scripttest
851 (name "python-scripttest")
857 "https://pypi.python.org/packages/source/s/scripttest/scripttest-"
861 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
862 (build-system python-build-system)
864 `(("python-pytest" ,python-pytest)))
865 (home-page "http://pythonpaste.org/scripttest/")
866 (synopsis "Python library to test command-line scripts")
867 (description "Scripttest is a Python helper library for testing
868 interactive command-line applications. With it you can run a script in a
869 subprocess and see the output as well as any file modifications.")
870 (license license:expat)))
872 (define-public python2-scripttest
873 (package-with-python2 python-scripttest))
875 (define-public python-testtools-bootstrap
877 (name "python-testtools-bootstrap")
882 (uri (pypi-uri "testtools" version))
885 "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
886 (patches (search-patches "python-testtools.patch"))))
887 (build-system python-build-system)
888 (arguments '(#:tests? #f))
890 `(("python-extras" ,python-extras)
891 ("python-fixtures" ,python-fixtures-bootstrap)
892 ("python-mimeparse" ,python-mimeparse)
893 ("python-pbr" ,python-pbr-minimal)
894 ("python-six" ,python-six)
895 ("python-traceback2" ,python-traceback2)
896 ("python-unittest2" ,python-unittest2)))
897 (home-page "https://github.com/testing-cabal/testtools")
899 "Extensions to the Python standard library unit testing framework")
901 "This package is only for bootstrapping. Do not use this.")
902 (license license:psfl)))
904 (define-public python2-testtools-bootstrap
905 (package-with-python2 python-testtools-bootstrap))
907 (define-public python-testtools
909 (inherit python-testtools-bootstrap)
910 (name "python-testtools")
912 `(#:phases (modify-phases %standard-phases
915 (invoke "python" "-m" "testtools.run"
916 "testtools.tests.test_suite"))))))
918 `(("python-extras" ,python-extras)
919 ("python-fixtures" ,python-fixtures)
920 ("python-mimeparse" ,python-mimeparse)
921 ("python-pbr" ,python-pbr)
922 ("python-six" ,python-six)
923 ("python-traceback2" ,python-traceback2)
924 ("python-unittest2" ,python-unittest2)))
926 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
928 "Testtools extends the Python standard library unit testing framework to
929 provide matchers, more debugging information, and cross-Python
932 (define-public python2-testtools
933 (package-with-python2 python-testtools))
935 (define-public python-testscenarios-bootstrap
937 (name "python-testscenarios-bootstrap")
942 (uri (pypi-uri "testscenarios" version))
945 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
946 (build-system python-build-system)
948 `(#:phases (modify-phases %standard-phases
951 (invoke "python" "-m" "testtools.run"
952 "testscenarios.test_suite"))))))
954 `(("python-pbr" ,python-pbr-minimal)
955 ("python-testtools" ,python-testtools-bootstrap)))
956 (home-page "https://launchpad.net/testscenarios")
957 (synopsis "Pyunit extension for dependency injection")
959 "This package is only for bootstrapping. Don't use this.")
960 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
962 (define-public python2-testscenarios-bootstrap
963 (package-with-python2 python-testscenarios-bootstrap))
965 (define-public python-testscenarios
967 (inherit python-testscenarios-bootstrap)
968 (name "python-testscenarios")
970 `(("python-pbr" ,python-pbr)
971 ("python-testtools" ,python-testtools)))
973 "Testscenarios provides clean dependency injection for Python unittest
976 (define-public python2-testscenarios
977 (package-with-python2 python-testscenarios))
979 ;; Testresources requires python-pbr at runtime, but pbr needs it for its
980 ;; own tests. Hence this bootstrap variant.
981 (define-public python-testresources-bootstrap
983 (name "python-testresources-bootstrap")
987 (uri (pypi-uri "testresources" version))
990 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
991 (build-system python-build-system)
992 (arguments '(#:tests? #f))
994 `(("python-pbr" ,python-pbr-minimal)))
995 (home-page "https://launchpad.net/testresources")
997 "Pyunit extension for managing test resources")
999 "This package is only here for bootstrapping purposes. Use the regular
1000 testresources package instead.")
1001 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1003 (define-public python2-testresources-bootstrap
1004 (package-with-python2 python-testresources-bootstrap))
1006 (define-public python-testresources
1008 (inherit python-testresources-bootstrap)
1009 (name "python-testresources")
1011 `(("python-pbr" ,python-pbr)))
1014 `(("python-fixtures" ,python-fixtures)
1015 ("python-testtols" ,python-testtools)))
1017 "Testresources is an extension to Python's unittest to allow declarative
1018 use of resources by test cases.")))
1020 (define-public python2-testresources
1021 (package-with-python2 python-testresources))
1023 (define-public python-subunit-bootstrap
1025 (name "python-subunit-bootstrap")
1030 (uri (pypi-uri "python-subunit" version))
1033 "1yii2gx3z6323as3iraj1yphj76dy7i3h6kj63pnc5y0hwjs5sgx"))))
1034 (build-system python-build-system)
1036 `(("python-extras" ,python-extras)
1037 ("python-testtools" ,python-testtools-bootstrap)))
1039 `(("python-fixtures" ,python-fixtures-bootstrap)
1040 ("python-hypothesis" ,python-hypothesis)
1041 ("python-testscenarios" ,python-testscenarios-bootstrap)))
1042 (home-page "http://launchpad.net/subunit")
1043 (synopsis "Python implementation of the subunit protocol")
1045 "This package is here for bootstrapping purposes only. Use the regular
1046 python-subunit package instead.")
1047 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1049 (define-public python2-subunit-bootstrap
1050 (package-with-python2 python-subunit-bootstrap))
1052 (define-public python-subunit
1054 (inherit python-subunit-bootstrap)
1055 (name "python-subunit")
1057 `(("python-extras" ,python-extras)
1058 ("python-testtools" ,python-testtools)))
1060 `(("python-fixtures" ,python-fixtures)
1061 ("python-hypothesis" ,python-hypothesis)
1062 ("python-testscenarios" ,python-testscenarios)))
1064 "Python-subunit is a Python implementation of the subunit test streaming
1067 (define-public python2-subunit
1068 (package-with-python2 python-subunit))
1070 ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
1071 ;; own tests. Hence this bootstrap variant.
1072 (define-public python-fixtures-bootstrap
1074 (name "python-fixtures-bootstrap")
1078 (uri (pypi-uri "fixtures" version))
1081 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
1082 (build-system python-build-system)
1083 (arguments `(#:tests? #f))
1085 `(("python-pbr-minimal" ,python-pbr-minimal)
1086 ("python-six" ,python-six)))
1087 (home-page "https://launchpad.net/python-fixtures")
1088 (synopsis "Python test fixture library")
1090 "This package is only used for bootstrapping. Use the regular
1091 python-fixtures package instead.")
1092 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1094 (define-public python2-fixtures-bootstrap
1095 (package-with-python2 python-fixtures-bootstrap))
1097 (define-public python-fixtures
1099 (inherit python-fixtures-bootstrap)
1100 (name "python-fixtures")
1103 (modify-phases %standard-phases
1106 (invoke "python" "-m" "testtools.run"
1107 "fixtures.test_suite"))))))
1109 ;; Fixtures uses pbr at runtime to check versions, etc.
1110 `(("python-pbr" ,python-pbr)
1111 ("python-six" ,python-six)))
1113 `(("python-mock" ,python-mock)
1114 ("python-testtools" ,python-testtools-bootstrap)))
1116 "Fixtures provides a way to create reusable state, useful when writing
1119 (define-public python2-fixtures
1120 (package-with-python2 python-fixtures))
1122 (define-public python-testrepository-bootstrap
1124 (name "python-testrepository-bootstrap")
1130 "https://pypi.python.org/packages/source/t/testrepository/testrepository-"
1134 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1135 (build-system python-build-system)
1136 (arguments '(#:tests? #f))
1138 `(("python-fixtures" ,python-fixtures-bootstrap)
1139 ("python-subunit" ,python-subunit-bootstrap)
1140 ("python-testtools" ,python-testtools-bootstrap)))
1142 `(("python-mimeparse" ,python-mimeparse)))
1143 (home-page "https://launchpad.net/testrepository")
1144 (synopsis "Database for Python test results")
1146 "Bootstrap package for python-testrepository. Don't use this.")
1147 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1149 (define-public python2-testrepository-bootstrap
1150 (package-with-python2 python-testrepository-bootstrap))
1152 (define-public python-testrepository
1154 (inherit python-testrepository-bootstrap)
1155 (name "python-testrepository")
1157 ;; FIXME: Many tests are failing.
1160 `(("python-fixtures" ,python-fixtures)
1161 ("python-subunit" ,python-subunit)
1162 ("python-testtools" ,python-testtools)))
1164 `(("python-mimeparse" ,python-mimeparse)))
1165 (description "Testrepository provides a database of test results which can
1166 be used as part of a developer's workflow to check things such as what tests
1167 have failed since the last commit or what tests are currently failing.")))
1169 (define-public python2-testrepository
1170 (package-with-python2 python-testrepository))
1172 (define-public python-coverage
1174 (name "python-coverage")
1179 (uri (pypi-uri "coverage" version))
1182 "097l4s3ssxm1vncsn0nw3a1pbzah28773q36c1ab9wz01r04973s"))))
1183 (build-system python-build-system)
1185 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1187 (home-page "http://nedbatchelder.com/code/coverage")
1188 (synopsis "Code coverage measurement for Python")
1190 "Coverage measures code coverage, typically during test execution. It
1191 uses the code analysis tools and tracing hooks provided in the Python standard
1192 library to determine which lines are executable, and which have been
1194 (license license:bsd-3)))
1196 (define-public python2-coverage
1197 (package-with-python2 python-coverage))
1199 (define-public python-cov-core
1201 (name "python-cov-core")
1206 (uri (pypi-uri "cov-core" version))
1209 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1210 (build-system python-build-system)
1212 `(("python-coverage" ,python-coverage)))
1213 (home-page "https://github.com/schlamar/cov-core")
1214 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
1216 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1217 and @code{nose2-cov}. It is useful for developing coverage plugins for these
1218 testing frameworks.")
1219 (license license:expat)))
1221 (define-public python2-cov-core
1222 (package-with-python2 python-cov-core))
1224 (define-public python-codecov
1226 (name "python-codecov")
1231 (uri (pypi-uri "codecov" version))
1234 "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1235 (build-system python-build-system)
1237 `(("python-unittest2" ,python-unittest2)))
1239 `(("python-coverage" ,python-coverage)
1240 ("python-requests" ,python-requests)))
1241 (home-page "http://github.com/codecov/codecov-python")
1242 (synopsis "Upload code coverage reports to @code{codecov.io}")
1244 "Codecov collects code coverage reports from code written in Python, Java,
1245 C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
1246 (license license:asl2.0)))
1248 (define-public python-testpath
1250 (name "python-testpath")
1255 (uri (string-append "https://github.com/jupyter/testpath/archive/"
1257 (file-name (string-append name "-" version ".tar.gz"))
1260 "04kh3fgvmqz6cfcw79q70qwjz7ib7lxm27cc548iy2rpr33qqf55"))))
1261 (build-system python-build-system)
1263 `(#:tests? #f ; this package does not even have a setup.py
1264 #:modules ((guix build python-build-system)
1267 #:imported-modules (,@%python-build-system-modules
1270 (modify-phases %standard-phases
1273 (lambda* (#:key inputs outputs #:allow-other-keys)
1274 (let* ((version (last
1275 (string-split (assoc-ref inputs "python") #\-)))
1276 (x.y (string-join (take (string-split version #\.) 2)
1279 (assoc-ref outputs "out")
1280 "/lib/python" x.y "/site-packages/testpath")))
1282 (copy-recursively "testpath" dir))
1284 (home-page "https://github.com/takluyver/testpath")
1285 (synopsis "Test utilities for code working with files and commands")
1287 "Testpath is a collection of utilities for Python code working with files
1288 and commands. It contains functions to check things on the file system, and
1289 tools for mocking system commands and recording calls to those.")
1290 (license license:expat)))
1292 (define-public python2-testpath
1293 (package-with-python2 python-testpath))
1295 (define-public python-testlib
1297 (name "python-testlib")
1303 "https://pypi.python.org/packages/source/t/testlib/testlib-"
1306 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1307 (build-system python-build-system)
1309 `(("unzip" ,unzip))) ; for unpacking the source
1310 (synopsis "Python micro test suite harness")
1311 (description "A micro unittest suite harness for Python.")
1312 (home-page "https://github.com/trentm/testlib")
1313 (license license:expat)))
1315 (define-public python2-testlib
1316 (package-with-python2 python-testlib))
1318 ;;; The software provided by this package was integrated into pytest 2.8.
1319 (define-public python-pytest-cache
1321 (name "python-pytest-cache")
1325 (uri (pypi-uri "pytest-cache" version))
1328 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1329 (build-system python-build-system)
1331 `(("python-apipkg" ,python-apipkg)
1332 ("python-execnet" ,python-execnet)
1333 ("python-py" ,python-py)
1334 ("python-pytest" ,python-pytest)))
1335 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1336 (description "The pytest-cache plugin provides tools to rerun failures from
1337 the last py.test invocation.")
1338 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1339 (license license:expat)))
1341 (define-public python2-pytest-cache
1342 (package-with-python2 python-pytest-cache))
1344 (define-public python-pytest-localserver
1346 (name "python-pytest-localserver")
1350 (uri (pypi-uri "pytest-localserver" version))
1353 "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
1354 (build-system python-build-system)
1357 (modify-phases %standard-phases
1360 (invoke "py.test" "-v"))))))
1362 `(("python-pytest" ,python-pytest)
1363 ("python-requests" ,python-requests)
1364 ("python-six" ,python-six)))
1366 `(("python-werkzeug" ,python-werkzeug)))
1367 (synopsis "Py.test plugin to test server connections locally")
1368 (description "Pytest-localserver is a plugin for the pytest testing
1369 framework which enables you to test server connections locally.")
1370 (home-page "https://pypi.python.org/pypi/pytest-localserver")
1371 (license license:expat)))
1373 (define-public python-pytest-xprocess
1375 (name "python-pytest-xprocess")
1379 (uri (pypi-uri "pytest-xprocess" version))
1382 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1383 (build-system python-build-system)
1385 `(("python-pytest" ,python-pytest)
1386 ("python-pytest-cache" ,python-pytest-cache)
1387 ("python-psutil" ,python-psutil)))
1388 (synopsis "Pytest plugin to manage external processes across test runs")
1389 (description "Pytest-xprocess is an experimental py.test plugin for managing
1390 processes across test runs.")
1391 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1392 (license license:expat)))
1394 (define-public python-pytest-subtesthack
1396 (name "python-pytest-subtesthack")
1400 (uri (pypi-uri "pytest-subtesthack" version))
1403 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1404 (build-system python-build-system)
1406 `(("python-pytest" ,python-pytest)))
1407 (synopsis "Set-up and tear-down fixtures for unit tests")
1408 (description "This plugin allows you to set up and tear down fixtures within
1409 unit test functions that use @code{py.test}. This is useful for using
1410 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1411 function multiple times, without setting up or tearing down fixture state as is
1412 normally the case.")
1413 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1414 (license license:unlicense)))
1416 (define-public python2-pytest-subtesthack
1417 (package-with-python2 python-pytest-subtesthack))
1419 (define-public python-pytest-sugar
1421 (name "python-pytest-sugar")
1426 (uri (pypi-uri "pytest-sugar" version))
1429 "1asq7yc4g8bx2sn7yy974mhc9ywvaihasjab4inkirdwn9s7mn7w"))))
1430 (build-system python-build-system)
1432 `(("python-packaging" ,python-packaging)
1433 ("python-pytest" ,python-pytest)
1434 ("python-termcolor" ,python-termcolor)))
1435 (home-page "https://pivotfinland.com/pytest-sugar/")
1436 (synopsis "Plugin for pytest that changes the default look and feel")
1438 "@code{pytest-sugar} is a plugin for py.test that changes the default
1439 look and feel of py.test, using a progress bar and showing failures and errors
1441 (license license:bsd-3)))
1443 (define-public python-hypothesis
1445 (name "python-hypothesis")
1449 (uri (pypi-uri "hypothesis" version))
1452 "1rshs1japfmwgar98yrkq4hg4z2q76hlnq7w2n3lfbjnscn1jd9b"))))
1453 (build-system python-build-system)
1455 `(;; FIXME: Change to python-flake8 in the next rebuild cycle.
1456 ("python-flake8" ,python-flake8-3.5)
1457 ("python-pytest" ,python-pytest-bootstrap)))
1459 `(("python-attrs" ,python-attrs-bootstrap)
1460 ("python-coverage" ,python-coverage)))
1461 (synopsis "Library for property based testing")
1462 (description "Hypothesis is a library for testing your Python code against a
1463 much larger range of examples than you would ever want to write by hand. It’s
1464 based on the Haskell library, Quickcheck, and is designed to integrate
1465 seamlessly into your existing Python unit testing work flow.")
1466 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
1467 (license license:mpl2.0)
1468 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1470 (define-public python2-hypothesis
1471 (let ((hypothesis (package-with-python2
1472 (strip-python2-variant python-hypothesis))))
1473 (package (inherit hypothesis)
1475 `(("python2-enum34" ,python2-enum34)
1476 ,@(package-propagated-inputs hypothesis))))))
1478 (define-public python-lit
1485 (uri (pypi-uri "lit" version))
1488 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
1489 (build-system python-build-system)
1492 (modify-phases %standard-phases
1495 (invoke "python" "lit.py" "tests"))))))
1498 (home-page "https://llvm.org/")
1499 (synopsis "LLVM Software Testing Tool")
1500 (description "@code{lit} is a portable tool for executing LLVM and Clang
1501 style test suites, summarizing their results, and providing indication of
1503 (license license:ncsa)))
1505 (define-public python2-lit
1506 (package-with-python2 python-lit))
1508 (define-public python-pytest-pep8
1510 (name "python-pytest-pep8")
1514 (uri (pypi-uri "pytest-pep8" version))
1517 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
1518 (build-system python-build-system)
1520 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
1522 `(("python-pytest" ,python-pytest)))
1524 `(("python-pep8" ,python-pep8)))
1525 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
1526 (synopsis "Py.test plugin to check PEP8 requirements")
1527 (description "Pytest plugin for checking PEP8 compliance.")
1528 (license license:expat)))
1530 (define-public python2-pytest-pep8
1531 (package-with-python2 python-pytest-pep8))
1533 (define-public python-pytest-flakes
1535 (name "python-pytest-flakes")
1539 (uri (pypi-uri "pytest-flakes" version))
1542 "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
1543 (build-system python-build-system)
1546 (modify-phases %standard-phases
1548 (add-after 'install 'check
1549 (lambda* (#:key outputs inputs #:allow-other-keys)
1550 ;; It's easier to run tests after install.
1551 ;; Make installed package available for running the tests
1552 (add-installed-pythonpath inputs outputs)
1553 (invoke "py.test" "-vv"))))))
1555 `(("python-coverage" ,python-coverage)
1556 ("python-pytest" ,python-pytest)
1557 ("python-pytest-cache" ,python-pytest-cache)
1558 ("python-pytest-pep8" ,python-pytest-pep8)))
1560 `(("python-pyflakes" ,python-pyflakes)))
1561 (home-page "https://github.com/fschulze/pytest-flakes")
1562 (synopsis "Py.test plugin to check source code with pyflakes")
1563 (description "Pytest plugin for checking Python source code with pyflakes.")
1564 (license license:expat)))
1566 (define-public python2-pytest-flakes
1567 (package-with-python2 python-pytest-flakes))
1569 (define-public python2-coverage-test-runner
1571 (name "python2-coverage-test-runner")
1577 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
1578 "coverage-test-runner/snapshot/coverage-test-runner-"
1582 "0y1m7z3dl63kmhcmydl1mwg0hacnf6ghrx9dah17j9iasssfa3g7"))))
1583 (build-system python-build-system)
1585 `(#:python ,python-2
1587 (modify-phases %standard-phases
1590 (invoke "./testrun"))))))
1592 `(("python2-coverage" ,python2-coverage)))
1593 (home-page "https://liw.fi/coverage-test-runner/")
1594 (synopsis "Python module for running unit tests")
1595 (description "@code{CoverageTestRunner} is a python module for running
1596 unit tests and failing them if the unit test module does not exercise all
1597 statements in the module it tests.")
1598 (license license:gpl3+)))
1600 (define-public python-pylint
1602 (name "python-pylint")
1608 "https://github.com/PyCQA/pylint/archive/pylint-"
1612 "0mzn1czhf1mgr2wiqfihb274sja02h899b85kywdpivppa9nwrmp"))))
1613 (build-system python-build-system)
1615 `(("python-pytest" ,python-pytest)
1616 ("python-pytest-runner" ,python-pytest-runner)
1617 ("python-tox" ,python-tox)))
1619 `(("python-astroid" ,python-astroid)
1620 ("python-isort" ,python-isort)
1621 ("python-mccabe" ,python-mccabe)
1622 ("python-six" ,python-six)))
1625 (modify-phases %standard-phases
1628 ;; Somehow, tests for python2-pylint
1629 ;; fail if run from the build directory
1630 (let ((work "/tmp/work"))
1632 (setenv "PYTHONPATH"
1633 (string-append (getenv "PYTHONPATH") ":" work))
1634 (copy-recursively "." work)
1635 (with-directory-excursion "/tmp"
1636 (invoke "python" "-m" "unittest" "discover"
1637 "-s" (string-append work "/pylint/test")
1638 "-p" "*test_*.py"))))))))
1639 (home-page "https://github.com/PyCQA/pylint")
1640 (synopsis "Python source code analyzer which looks for coding standard
1642 (description "Pylint is a Python source code analyzer which looks
1643 for programming errors, helps enforcing a coding standard and sniffs
1644 for some code smells (as defined in Martin Fowler's Refactoring book).
1646 Pylint has many rules enabled by default, way too much to silence them
1647 all on a minimally sized program. It's highly configurable and handle
1648 pragmas to control it from within your code. Additionally, it is
1649 possible to write plugins to add your own checks.")
1650 (properties `((python2-variant . ,(delay python2-pylint))))
1651 (license license:gpl2+)))
1653 (define-public python2-pylint
1654 (let ((pylint (package-with-python2
1655 (strip-python2-variant python-pylint))))
1656 (package (inherit pylint)
1658 `(("python2-backports-functools-lru-cache"
1659 ,python2-backports-functools-lru-cache)
1660 ("python2-configparser" ,python2-configparser)
1661 ,@(package-propagated-inputs pylint))))))
1663 (define-public python-paramunittest
1665 (name "python-paramunittest")
1670 (uri (pypi-uri "ParamUnittest" version))
1673 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
1674 (build-system python-build-system)
1676 "https://github.com/rik0/ParamUnittest")
1678 "Simple extension to have parametrized unit tests")
1680 "This package allows to create parametrized unit-tests that work with the standard
1681 unittest package. A parametrized test case is automatically converted to multiple test
1682 cases. Since they are TestCase subclasses, they work with other test suites that
1683 recognize TestCases.")
1684 (license license:bsd-2)))
1686 (define-public python2-python-paramunittest
1687 (package-with-python2 python-paramunittest))
1689 (define-public python-pytest-warnings
1691 (name "python-pytest-warnings")
1696 (uri (pypi-uri "pytest-warnings" version))
1699 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
1700 (build-system python-build-system)
1702 `(("pytest" ,python-pytest)))
1703 (home-page "https://github.com/fschulze/pytest-warnings")
1704 (synopsis "Pytest plugin to list Python warnings in pytest report")
1706 "Python-pytest-warnings is a pytest plugin to list Python warnings in
1708 (license license:expat)
1709 (properties `((python2-variant . ,(delay python2-pytest-warnings))
1710 ;; This package is part of pytest as of version 3.1.0.
1711 (superseded . ,python-pytest)))))
1713 (define-public python2-pytest-warnings
1714 (package (inherit (package-with-python2
1715 (strip-python2-variant python-pytest-warnings)))
1716 (properties `((superseded . ,python2-pytest)))))
1718 (define-public python-pytest-capturelog
1720 (name "python-pytest-capturelog")
1725 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
1728 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
1729 (build-system python-build-system)
1731 `(("pytest" ,python-pytest)))
1732 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
1733 (synopsis "Pytest plugin to catch log messages")
1735 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
1736 (license license:expat)))
1738 (define-public python2-pytest-capturelog
1739 (package-with-python2 python-pytest-capturelog))
1741 (define-public python-pytest-catchlog
1743 (name "python-pytest-catchlog")
1748 (uri (pypi-uri "pytest-catchlog" version ".zip"))
1751 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
1752 (build-system python-build-system)
1754 `(("unzip" ,unzip)))
1756 `(("pytest" ,python-pytest)))
1757 (home-page "https://github.com/eisensheng/pytest-catchlog")
1758 (synopsis "Pytest plugin to catch log messages")
1760 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
1761 a fork of pytest-capturelog.")
1762 (license license:expat)))
1764 (define-public python2-pytest-catchlog
1765 (package-with-python2 python-pytest-catchlog))
1767 (define-public python-nosexcover
1769 (name "python-nosexcover")
1773 (uri (pypi-uri "nosexcover" version))
1776 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
1777 (build-system python-build-system)
1779 `(("python-coverage" ,python-coverage)
1780 ("python-nose" ,python-nose)))
1781 (home-page "http://github.com/cmheisel/nose-xcover")
1782 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
1783 (description "Nose-xcover is a companion to the built-in
1784 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
1785 to a file named coverage.xml.
1787 It will honor all the options you pass to the Nose coverage plugin,
1788 especially -cover-package.")
1789 (license license:expat)))
1791 (define-public python2-nosexcover
1792 (package-with-python2 python-nosexcover))
1794 (define-public python-discover
1796 (name "python-discover")
1802 "https://pypi.python.org/packages/source/d/discover/discover-"
1806 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
1807 (build-system python-build-system)
1808 (home-page "http://pypi.python.org/pypi/discover/")
1810 "Python test discovery for unittest")
1812 "Discover provides test discovery for unittest, a feature that has been
1813 backported from Python 2.7 for Python 2.4+.")
1814 (license license:bsd-3)))
1816 (define-public python2-discover
1817 (package-with-python2 python-discover))
1819 (define-public behave
1825 (uri (pypi-uri "behave" version))
1828 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))))
1829 (build-system python-build-system)
1831 `(("python-mock" ,python-mock)
1832 ("python-nose" ,python-nose)
1833 ("python-pathpy" ,python-pathpy)
1834 ("python-pyhamcrest" ,python-pyhamcrest)
1835 ("python-pytest" ,python-pytest)))
1837 `(("python-six" ,python-six)
1838 ("python-parse" ,python-parse)
1839 ("python-parse-type" ,python-parse-type)))
1841 '(#:test-target "behave_test"))
1842 (home-page "https://github.com/behave/behave")
1843 (synopsis "Python behavior-driven development")
1845 "Behave is a tool for behavior-driven development in python.
1846 Behavior-driven development (or BDD) is an agile software development
1847 technique that encourages collaboration between developers, QA and
1848 non-technical or business participants in a software project. Behave uses
1849 tests written in a natural language style, backed up by Python code.")
1850 (license license:x11)))
1852 (define-public python-behave-web-api
1854 (name "python-behave-web-api")
1859 (uri (pypi-uri "behave-web-api" version))
1862 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
1863 (build-system python-build-system)
1866 (modify-phases %standard-phases
1867 (add-after 'unpack 'fix-dependencies
1869 (substitute* "setup.py"
1870 (("'wheel'") "") ; We don't use it.
1871 (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
1874 `(("behave" ,behave)
1875 ("python-requests" ,python-requests)))
1876 (home-page "https://github.com/jefersondaniel/behave-web-api")
1877 (synopsis "Provides testing for JSON APIs with Behave for Python")
1878 (description "This package provides testing utility modules for testing
1879 JSON APIs with Behave.")
1880 (license license:expat)))
1882 (define-public python2-behave-web-api
1883 (package-with-python2 python-behave-web-api))
1885 (define-public python-rednose
1887 (name "python-rednose")
1892 (uri (pypi-uri "rednose" version))
1895 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
1896 (build-system python-build-system)
1898 `(#:phases (modify-phases %standard-phases
1899 (add-after 'unpack 'patch-setup.py
1901 ;; Six is only required for tests and later versions
1903 (substitute* "setup.py"
1904 (("six==1.10.0") "six"))
1907 `(("python-colorama" ,python-colorama)
1908 ("python-termstyle" ,python-termstyle)))
1910 `(("python-six" ,python-six)
1911 ("python-nose" ,python-nose)))
1912 (home-page "https://github.com/JBKahn/rednose")
1913 (synopsis "Colored output for Python nosetests")
1914 (description "This package provides colored output for the
1915 @command{nosetests} command of the Python Nose unit test framework.")
1916 (license license:bsd-3)))
1918 (define-public python2-rednose
1919 (package-with-python2 python-rednose))
1921 (define-public python-nose-randomly
1923 (name "python-nose-randomly")
1928 (uri (pypi-uri "nose-randomly" version))
1931 "1cw9dlr1zh3w4i438kin7z0rm8092ki52hayisyc43h9pcplq7rn"))))
1932 (build-system python-build-system)
1934 `(("python-nose" ,python-nose)
1935 ("python-numpy" ,python-numpy)))
1936 (home-page "https://github.com/adamchainz/nose-randomly")
1938 "Nose plugin to randomly order tests and control random.seed")
1940 "This is a @code{Nose} plugin to randomly order tests which can be quite
1941 powerful in discovering hidden flaws in the tests themselves, while helping to
1942 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
1943 by resetting it to a repeatable number for each test, enabling the tests to
1944 create data based on random numbers and yet remain repeatable.")
1945 (license license:bsd-3)))
1947 (define-public python2-nose-randomly
1948 (package-with-python2 python-nose-randomly))
1950 (define-public python-nose-timer
1952 (name "python-nose-timer")
1957 (uri (pypi-uri "nose-timer" version))
1960 "0hfz5aqnhf493i9kyb6prm4zm8vx7wmfsyg3nvsnh24lzh2kwx44"))))
1961 (build-system python-build-system)
1963 `(("python-nose" ,python-nose)
1964 ("python-termcolor" ,python-termcolor)))
1965 (home-page "https://github.com/mahmoudimus/nose-timer")
1966 (synopsis "Timer plugin for nosetests")
1967 (description "Shows how much time was needed to run individual tests.")
1968 (license license:expat)))
1970 (define-public python2-nose-timer
1971 (package-with-python2 python-nose-timer))
1973 (define-public python-freezegun
1975 (name "python-freezegun")
1980 (uri (pypi-uri "freezegun" version))
1983 "08m6b42yxb9hk5lv747v9n2qsxyadmkb0k6yg0gxdanwap0slg3h"))))
1984 (build-system python-build-system)
1986 `(("python-mock" ,python-mock)
1987 ("python-nose" ,python-nose)
1988 ("python-coverage" ,python-coverage)))
1990 `(("python-six" ,python-six)
1991 ("python-dateutil" ,python-dateutil)))
1994 (modify-phases %standard-phases
1995 ;; The tests are normally executed via `make test`, but the PyPi
1996 ;; package does not include the Makefile.
1999 (invoke "nosetests" "./tests/"))))))
2000 (home-page "https://github.com/spulec/freezegun")
2001 (synopsis "Test utility for mocking the datetime module")
2003 "FreezeGun is a library that allows your python tests to travel through
2004 time by mocking the datetime module.")
2005 (license license:asl2.0)))
2007 (define-public python2-freezegun
2008 (package-with-python2 python-freezegun))
2010 (define-public python-flexmock
2012 (name "python-flexmock")
2016 (uri (pypi-uri "flexmock" version))
2019 "0arc6njvs6i9v9hgvzk5m50296g7zy5m9d7pyb43vdsdgxrci5gy"))))
2020 (build-system python-build-system)
2021 (home-page "https://flexmock.readthedocs.org")
2022 (synopsis "Testing library for Python")
2024 "flexmock is a testing library for Python that makes it easy to create
2025 mocks, stubs and fakes.")
2026 (license license:bsd-3)))
2028 (define-public python2-flexmock
2029 (package-with-python2 python-flexmock))
2031 (define-public python-flaky
2033 (name "python-flaky")
2037 (uri (pypi-uri "flaky" version))
2040 "18pkmf79rfkfpy1d2rrx3v55nxj762ilyk9rvd6s6dccxw58imsa"))))
2041 (build-system python-build-system)
2043 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2045 (home-page "https://github.com/box/flaky")
2046 (synopsis "Automatically rerun flaky tests")
2048 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2051 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2052 on components that aren't 100% reliable. With flaky, instead of removing
2053 those tests or marking them to @code{@@skip}, they can be automatically
2055 (license license:asl2.0)))
2057 (define-public python2-flaky
2058 (package-with-python2 python-flaky))
2060 (define-public python-pyhamcrest
2062 (name "python-pyhamcrest")
2068 "https://github.com/hamcrest/PyHamcrest/archive/V"
2072 (string-append name "-" version ".tar.gz"))
2075 "1lqjajhwf7x7igvvnj5p1cm31y9njy07qby94w18kl6zwbdjqrwy"))))
2076 (native-inputs ; All native inputs are for tests
2077 `(("python-pytest-cov" ,python-pytest-cov)
2078 ("python-mock" ,python-mock)
2079 ("python-pytest" ,python-pytest)
2080 ("python-hypothesis" ,python-hypothesis)))
2082 `(("python-six" ,python-six)))
2083 (build-system python-build-system)
2084 (home-page "http://hamcrest.org/")
2085 (synopsis "Hamcrest matchers for Python")
2087 "PyHamcrest is a framework for writing matcher objects,
2088 allowing you to declaratively define \"match\" rules.")
2089 (license license:bsd-3)))
2091 (define-public python2-pyhamcrest
2092 (package-with-python2 python-pyhamcrest))
2094 (define-public unittest-cpp
2096 (name "unittest-cpp")
2101 "https://github.com/unittest-cpp/unittest-cpp/archive/v"
2103 (file-name (string-append name "-" version ".tar.gz"))
2105 (base32 "1fgmna2la7z4pwwy2gd10gpgi2q1fk89npjfvkmzvhkxhyc231bl"))))
2107 `(#:tests? #f)) ; It's run after build automatically.
2108 (build-system cmake-build-system)
2109 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2110 (synopsis "Lightweight unit testing framework for C++")
2111 (description "UnitTest++ is a lightweight unit testing framework for C++.
2112 It was designed to do test-driven development on a wide variety of platforms.
2113 Simplicity, portability, speed, and small footprint are all very important
2114 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2115 of advanced library and language features, which means it should be easily
2116 portable to just about any platform.")
2117 (license license:expat)))
2119 (define-public libfaketime
2121 (name "libfaketime")
2123 (home-page "https://github.com/wolfcw/libfaketime")
2128 (commit (string-append "v" version))))
2131 "1cin1pqwpsswcv7amiwijirvcg3x1zf2l00s1x84nxc5602fzr5c"))
2132 (file-name (git-file-name name version))))
2133 (build-system gnu-build-system)
2135 '(#:phases (modify-phases %standard-phases
2137 (lambda* (#:key outputs #:allow-other-keys)
2138 (let ((out (assoc-ref outputs "out")))
2140 (setenv "PREFIX" out)
2142 (add-before 'check 'pre-check
2144 (substitute* "test/functests/test_exclude_mono.sh"
2145 (("/bin/bash") (which "bash")))
2147 #:test-target "test"))
2149 `(("perl" ,perl))) ;for tests
2150 (synopsis "Fake the system time for single applications")
2152 "The libfaketime library allows users to modify the system time that an
2153 application \"sees\". It is meant to be loaded using the dynamic linker's
2154 @code{LD_PRELOAD} environment variable. The @command{faketime} command
2155 provides a simple way to achieve this.")
2156 (license license:gpl2)))