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