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, 2019 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, 2019 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, 2019 Kei Kebreau <kkebreau@posteo.net>
26 ;;; Copyright © 2017 ng0 <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>
31 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
33 ;;; This file is part of GNU Guix.
35 ;;; GNU Guix is free software; you can redistribute it and/or modify it
36 ;;; under the terms of the GNU General Public License as published by
37 ;;; the Free Software Foundation; either version 3 of the License, or (at
38 ;;; your option) any later version.
40 ;;; GNU Guix is distributed in the hope that it will be useful, but
41 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
42 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43 ;;; GNU General Public License for more details.
45 ;;; You should have received a copy of the GNU General Public License
46 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
48 (define-module (gnu packages check)
49 #:use-module (gnu packages)
50 #:use-module (gnu packages autotools)
51 #:use-module (gnu packages base)
52 #:use-module (gnu packages bash)
53 #:use-module (gnu packages compression)
54 #:use-module (gnu packages linux)
55 #:use-module (gnu packages llvm)
56 #:use-module (gnu packages glib)
57 #:use-module (gnu packages gnome)
58 #:use-module (gnu packages golang)
59 #:use-module (gnu packages gtk)
60 #:use-module (gnu packages perl)
61 #:use-module (gnu packages pkg-config)
62 #:use-module (gnu packages python)
63 #:use-module (gnu packages python-web)
64 #:use-module (gnu packages python-xyz)
65 #:use-module (gnu packages time)
66 #:use-module (guix utils)
67 #:use-module ((guix licenses) #:prefix license:)
68 #:use-module (guix packages)
69 #:use-module (guix download)
70 #:use-module (guix git-download)
71 #:use-module (guix build-system cmake)
72 #:use-module (guix build-system gnu)
73 #:use-module (guix build-system go)
74 #:use-module (guix build-system python)
75 #:use-module (guix build-system trivial))
84 (uri (string-append "https://github.com/libcheck/check/releases/download/"
85 version "/check-" version ".tar.gz"))
88 "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6"))))
89 (build-system gnu-build-system)
90 (home-page "https://libcheck.github.io/check/")
91 (synopsis "Unit test framework for C")
93 "Check is a unit testing framework for C. It features a simple
94 interface for defining unit tests, putting little in the way of the
95 developer. Tests are run in a separate address space, so Check can
96 catch both assertion failures and code errors that cause segmentation
97 faults or other signals. The output from unit tests can be used within
98 source code editors and IDEs.")
99 (license license:lgpl2.1+)))
108 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
109 version "/CUnit-" version ".tar.bz2"))
112 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
113 (build-system gnu-build-system)
114 (arguments '(#:phases
115 (modify-phases %standard-phases
116 ;; XXX: The "bootstrap" phase detects the "bootstrap"
117 ;; script, but fails to execute it, so we bootstrap
120 (lambda _ (invoke "autoreconf" "-vfi"))))))
122 `(("automake" ,automake)
123 ("autoconf" ,autoconf)
124 ("libtool" ,libtool)))
125 (home-page "http://cunit.sourceforge.net/")
126 (synopsis "Automated testing framework for C")
128 "CUnit is a lightweight system for writing, administering, and running
129 unit tests in C. It provides C programmers with basic testing functionality
130 with a flexible variety of user interfaces.")
131 (license license:gpl2+)))
133 (define-public cppunit
139 (uri (string-append "http://dev-www.libreoffice.org/src/"
140 name "-" version ".tar.gz"))
143 "1027cyfx5gsjkdkaf6c2wnjh68882grw8n672018cj3vs9lrhmix"))))
144 ;; Explicitly link with libdl. This is expected to be done by packages
145 ;; relying on cppunit for their tests. However, not all of them do.
146 ;; If we added the linker flag to such packages, we would pollute all
147 ;; binaries, not only those used for testing.
149 `(#:make-flags '("LDFLAGS=-ldl")))
150 (build-system gnu-build-system)
151 (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
152 (synopsis "Unit testing framework for C++")
153 (description "CppUnit is the C++ port of the famous JUnit framework for
154 unit testing. Test output is in XML for automatic testing and GUI based for
156 (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
158 ;; When dependent packages upgraded to use newer version of catch, this one should
160 (define-public catch-framework
163 (version "1.3.5") ;Sub-minor is the build number
167 (url "https://github.com/philsquared/Catch")
169 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
170 (file-name (string-append name "-" version))
173 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
174 (build-system trivial-build-system)
176 `(#:modules ((guix build utils))
178 (use-modules (guix build utils))
179 (let* ((source (assoc-ref %build-inputs "source"))
180 (output (assoc-ref %outputs "out"))
181 (incdir (string-append output "/include"))
182 (docdir (string-append output "/share/doc/catch-"
184 (for-each mkdir-p (list incdir docdir))
185 (install-file (string-append source
186 "/single_include/catch.hpp")
188 (copy-recursively (string-append source "/docs")
191 (home-page "http://catch-lib.net/")
192 (synopsis "Automated test framework for C++ and Objective-C")
194 "Catch stands for C++ Automated Test Cases in Headers and is a
195 multi-paradigm automated test framework for C++ and Objective-C.")
196 (license license:boost1.0)))
198 (define-public catch-framework2
202 (home-page "https://github.com/catchorg/Catch2")
206 (url "https://github.com/catchorg/Catch2")
207 (commit (string-append "v" version))))
208 (file-name (git-file-name name version))
211 "1gdp5wm8khn02g2miz381llw3191k7309qj8s3jd6sasj01rhf23"))))
212 (build-system cmake-build-system)
213 (synopsis "Automated test framework for C++ and Objective-C")
214 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
215 a multi-paradigm automated test framework for C++ and Objective-C.")
216 (license license:boost1.0)))
218 (define-public cmdtest
224 (uri (string-append "http://git.liw.fi/cmdtest/snapshot/"
225 name "-" version ".tar.gz"))
228 "1jmfiyrrqmpvwdb273bkb8hjaf4rwx9njblx29pmr7giyahskwi5"))))
229 (build-system python-build-system)
233 (modify-phases %standard-phases
234 ;; check phase needs to be run before the build phase. If not, the
235 ;; coverage test runner looks for tests for the built source files,
238 (add-before 'build 'check
241 (("/bin/sh") (which "sh")))
242 ;; yarn uses python2-ttystatus to print messages.
243 ;; python2-ttystatus requires /dev/tty which is not present in
244 ;; the build environment. Hence assuming-failure test fails.
245 (delete-file "yarn.tests/assuming-failure.script")
246 (delete-file "yarn.tests/assuming-failure.stdout")
247 (invoke "python" "setup.py" "check"))))))
249 `(("python2-coverage-test-runner" ,python2-coverage-test-runner)))
251 `(("python2-cliapp" ,python2-cliapp)
252 ("python2-markdown" ,python2-markdown)
253 ("python2-ttystatus" ,python2-ttystatus)))
254 (home-page "https://liw.fi/cmdtest/")
255 (synopsis "Black box Unix program tester")
257 "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
258 given a command line and input files, and the expected output, and it verifies
259 that the command line produces the expected output. If not, it reports a
260 problem, and shows the differences.")
261 (license license:gpl3+)))
263 (define-public cmocka
269 (uri (string-append "https://cmocka.org/files/"
270 (version-major+minor version) "/cmocka-"
274 "1bxzzafjlwzgldcb07hjnlnqvh88wh21r2kw7z8f704w5bvvrsj3"))))
275 (build-system cmake-build-system)
277 `(#:tests? #f)) ; no test target
278 (home-page "https://cmocka.org/")
279 (synopsis "Unit testing framework for C")
280 (description "Cmocka is a unit testing framework for C with support for
281 mock objects. It only requires the standard C library, and works with
282 different compilers. Cmocka supports several different message output formats
283 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
285 (license license:asl2.0)))
287 (define-public cppcheck
294 (url "https://github.com/danmar/cppcheck")
296 (file-name (git-file-name name version))
298 (base32 "1xiy54rz99nzbpwj35jiyssd2nc6k5k0lw5ml6nh2qnmbfkl8swl"))))
299 (build-system cmake-build-system)
301 '(#:configure-flags '("-DBUILD_TESTS=ON")))
302 (home-page "http://cppcheck.sourceforge.net")
303 (synopsis "Static C/C++ code analyzer")
304 (description "Cppcheck is a static code analyzer for C and C++. Unlike
305 C/C++ compilers and many other analysis tools it does not detect syntax errors
306 in the code. Cppcheck primarily detects the types of bugs that the compilers
307 normally do not detect. The goal is to detect only real errors in the code
308 (i.e. have zero false positives).")
309 (license license:gpl3+)))
311 (define-public cxxtest
317 (uri (string-append "mirror://sourceforge/cxxtest/cxxtest/"
318 version "/cxxtest-" version ".tar.gz"))
321 "1n7pbj4z9ivx005hqvivj9ddhq8awynzg6jishfbypf6j7ply58w"))))
322 (build-system python-build-system)
325 (modify-phases %standard-phases
326 (add-after 'unpack 'chdir-to-source
330 (add-after 'install 'install-headers
331 (lambda* (#:key outputs #:allow-other-keys)
332 (let* ((out (assoc-ref outputs "out"))
333 (include-dir (string-append out "/include/cxxtest")))
334 (for-each (lambda (header-file)
335 (install-file header-file include-dir))
336 (find-files "../cxxtest"))
338 (add-after 'install 'install-doc
339 (lambda* (#:key outputs #:allow-other-keys)
340 (let* ((out (assoc-ref outputs "out"))
341 (doc-dir (string-append out "/share/doc/cxxtest")))
342 (install-file "../README" doc-dir)
343 (install-file "../doc/guide.txt" doc-dir)
344 (copy-recursively "../sample" (string-append doc-dir "/sample"))
347 `(("python-ply" ,python-ply)))
348 (home-page "https://cxxtest.com/")
349 (synopsis "Unit testing framework for C++")
350 (description "CxxTest is a unit testing framework for C++ that is similar
351 in spirit to JUnit, CppUnit, and xUnit. CxxTest does not require precompiling
352 a CxxTest testing library, it employs no advanced features of C++ (e.g. RTTI)
353 and it supports a very flexible form of test discovery.")
354 (license license:lgpl3+)))
356 (define-public go-gopkg.in-check.v1
357 (let ((commit "788fd78401277ebd861206a03c884797c6ec5541")
360 (name "go-gopkg.in-check.v1")
361 (version (git-version "0.0.0" revision commit))
365 (url "https://github.com/go-check/check.git")
367 (file-name (git-file-name name version))
370 "0v3bim0j375z81zrpr5qv42knqs0y2qv2vkjiqi5axvb78slki1a"))))
371 (build-system go-build-system)
373 '(#:import-path "gopkg.in/check.v1"))
375 `(("go-github-com-kr-pretty" ,go-github-com-kr-pretty)))
376 (synopsis "Rich testing extension for Go's testing package")
378 "@code{check} is a rich testing extension for Go's testing package.")
379 (home-page "https://github.com/go-check/check")
380 (license license:bsd-2))))
382 (define-public go-github.com-smartystreets-gunit
384 (name "go-github.com-smartystreets-gunit")
389 (url "https://github.com/smartystreets/gunit")
391 (file-name (git-file-name name version))
394 "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
395 (build-system go-build-system)
397 '(;; TODO: This package depends on go-github.com-smartystreets-assertions
398 ;; for running the tests, but go-github.com-smartystreets-assertions
399 ;; depends on this package, so break this loop by not running the tests
402 #:import-path "github.com/smartystreets/gunit"))
403 (synopsis "Testing tool for Go, in the style of xUnit")
405 "@code{gunit} allows the test author to use a struct as the scope for a
406 group of related test cases, in the style of xUnit fixtures. This makes
407 extraction of setup/teardown behavior (as well as invoking the system under
408 test) much simpler.")
409 (home-page "https://github.com/smartystreets/gunit")
410 (license license:expat)))
412 (define-public go-github.com-smartystreets-assertions
414 (name "go-github.com-smartystreets-assertions")
419 (url "https://github.com/smartystreets/assertions")
421 (file-name (git-file-name name version))
424 "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
425 (build-system go-build-system)
427 '(#:import-path "github.com/smartystreets/assertions"))
429 `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
430 (synopsis "Assertions for testing with Go")
432 "The @code{assertions} package provides convinient assertion functions
433 for writing tests in Go.")
434 (home-page "https://github.com/smartystreets/assertions")
435 (license license:expat)))
437 (define-public go-github.com-smartystreets-goconvey
439 (name "go-github.com-smartystreets-goconvey")
444 (url "https://github.com/smartystreets/goconvey")
446 (file-name (git-file-name name version))
449 "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
450 (build-system go-build-system)
452 '(#:import-path "github.com/smartystreets/goconvey"))
454 `(("go-github.com-jtolds-gls" ,go-github.com-jtolds-gls)
455 ("go-github.com-smartystreets-assertions" ,go-github.com-smartystreets-assertions)))
456 (synopsis "Go testing tool with both a web and terminal user interface")
458 "GoConvey is a testing tool for Go. It integrates with go test, can show
459 test coverage and has a web user interface that will refresh automatically.")
460 (home-page "https://github.com/smartystreets/goconvey")
461 (license license:expat)))
463 ;; XXX When updating, check whether ZNC's GOOGLETEST-SOURCES can be
464 ;; switched back to simply using (PACKAGE-SOURCE ...).
465 (define-public googletest
472 (uri (string-append "https://github.com/google/googletest/archive/"
473 "release-" version ".tar.gz"))
474 (file-name (string-append name "-" version ".tar.gz"))
477 "1n5p1m2m3fjrjdj752lf92f9wq3pl5cbsfrb49jqbg52ghkz99jq"))))
478 (build-system cmake-build-system)
480 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
482 `(("python-2" ,python-2)))
483 (home-page "https://github.com/google/googletest/")
484 (synopsis "Test discovery and XUnit test framework")
485 (description "Google Test features an XUnit test framework, automated test
486 discovery, death tests, assertions, parameterized tests and XML test report
488 (license license:bsd-3)))
490 (define-public cpputest
497 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
498 version "/cpputest-" version ".tar.gz"))
501 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
502 (build-system gnu-build-system)
504 `(("googletest" ,googletest)))
505 (home-page "https://cpputest.github.io/")
506 (synopsis "Unit testing and mocking framework for C/C++")
508 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
509 C++ but is used in C and C++ projects and frequently used in embedded systems
510 but it works for any C/C++ project.")
511 (license license:bsd-3)))
513 (define-public python-parameterized
515 (name "python-parameterized")
520 (uri (pypi-uri "parameterized" version))
523 "1qj1939shm48d9ql6fm1nrdy4p7sdyj8clz1szh5swwpf1qqxxfa"))))
524 (build-system python-build-system)
525 (arguments '(#:tests? #f)) ; there are no tests
526 (home-page "https://github.com/wolever/parameterized")
527 (synopsis "Parameterized testing with any Python test framework")
529 "Parameterized is a Python library that aims to fix parameterized testing
530 for every Python test framework. It supports nose, py.test, and unittest.")
531 (license license:bsd-2)))
533 (define-public python2-parameterized
534 (package-with-python2 python-parameterized))
536 (define-public python-minimock
538 (name "python-minimock")
543 (uri (pypi-uri "MiniMock" version))
546 "0k2sxb1ibnyg05iblz7zhbv825f1zk9906rab7883iqgvzmdzpsz"))))
547 (build-system python-build-system)
548 (home-page "https://pypi.org/project/MiniMock")
549 (synopsis "Simple Python library for using mock objects")
550 (description "MiniMock is a simple library for building mock objects with
552 (license license:expat)))
554 (define-public python2-minimock
555 (package-with-python2 python-minimock))
557 (define-public python-mock
564 (uri (pypi-uri "mock" version))
567 "1flbpksir5sqrvq2z0dp8sl4bzbadg21sj4d42w3klpdfvgvcn5i"))))
569 `(("python-pbr" ,python-pbr-minimal)
570 ("python-six" ,python-six)))
571 (build-system python-build-system)
573 `(("python-unittest2" ,python-unittest2)))
576 (modify-phases %standard-phases
579 (zero? (system* "unit2")))))))
580 (home-page "https://github.com/testing-cabal/mock")
581 (synopsis "Python mocking and patching library for testing")
583 "Mock is a library for testing in Python. It allows you to replace parts
584 of your system under test with mock objects and make assertions about how they
586 (properties `((python2-variant . ,(delay python2-mock))))
587 (license license:expat)))
589 (define-public python2-mock
590 (let ((base (package-with-python2
591 (strip-python2-variant python-mock))))
592 (package (inherit base)
594 `(("python2-functools32" ,python2-functools32)
595 ("python2-funcsigs" ,python2-funcsigs)
596 ,@(package-propagated-inputs base))))))
598 (define-public python-nose
605 (uri (pypi-uri "nose" version))
608 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
609 (build-system python-build-system)
611 '(#:tests? #f)) ; FIXME: test suite fails
612 (home-page "http://readthedocs.org/docs/nose/")
613 (synopsis "Python testing library")
615 "Nose extends the unittest library to make testing easier.")
616 (license license:lgpl2.0+)))
618 (define-public python2-nose
619 (package-with-python2 python-nose))
621 (define-public python-nose2
623 (name "python-nose2")
628 (uri (pypi-uri "nose2" version))
631 "1x4zjq1zlyrh8b9ba0cmafd3w94pxhid408kibyjd3s6h1lap6s7"))))
632 (build-system python-build-system)
633 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
635 `(("python-cov-core" ,python-cov-core)
636 ("python-pytest-cov" ,python-pytest-cov)
637 ("python-six" ,python-six)))
638 (home-page "https://github.com/nose-devs/nose2")
639 (synopsis "Next generation of nicer testing for Python")
641 "Nose2 is the next generation of nicer testing for Python, based on the
642 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
643 better plugin api, being easier for users to configure, and simplifying internal
644 interfaces and processes.")
645 (license license:bsd-2)))
647 (define-public python2-nose2
648 (package-with-python2 python-nose2))
650 (define-public python-unittest2
652 (name "python-unittest2")
657 (uri (pypi-uri "unittest2" version))
659 (search-patches "python-unittest2-python3-compat.patch"
660 "python-unittest2-remove-argparse.patch"))
663 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
664 (build-system python-build-system)
667 (modify-phases %standard-phases
670 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
672 `(("python-six" ,python-six)
673 ("python-traceback2" ,python-traceback2)))
674 (home-page "http://pypi.python.org/pypi/unittest2")
675 (synopsis "Python unit testing library")
677 "Unittest2 is a replacement for the unittest module in the Python
679 (license license:psfl)))
681 (define-public python2-unittest2
682 (package-with-python2 python-unittest2))
684 (define-public python-pytest
686 (name "python-pytest")
691 (uri (pypi-uri "pytest" version))
694 "08q58ad8vaxyb57ll8m611yb4xwzzhp09kxafmyqrrps6cnalbjr"))))
695 (build-system python-build-system)
698 (modify-phases %standard-phases
701 (invoke "pytest" "-vv" "-k"
703 ;; These tests involve the /usr directory, and fails.
704 "not test_remove_dir_prefix"
705 " and not test_argcomplete"
706 ;; This test tries to override PYTHONPATH, and
707 ;; subsequently fails to locate the test libraries.
708 " and not test_collection"
709 ;; These tests fail when run in verbose mode:
710 ;; <https://github.com/pytest-dev/pytest/issues/4879>.
711 " and not test_dont_rewrite_if_hasattr_fails"
713 " and not test_custom_repr"
714 " and not test_name")))))))
716 `(("python-atomicwrites" ,python-atomicwrites)
717 ("python-attrs" ,python-attrs-bootstrap)
718 ("python-more-itertools" ,python-more-itertools)
719 ("python-pluggy" ,python-pluggy)
720 ("python-py" ,python-py)
721 ("python-six" ,python-six-bootstrap)))
723 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
725 ("python-hypothesis" ,python-hypothesis)
726 ("python-nose" ,python-nose)
727 ("python-mock" ,python-mock)
728 ("python-pytest" ,python-pytest-bootstrap)
729 ("python-setuptools-scm" ,python-setuptools-scm)))
730 (home-page "https://docs.pytest.org/en/latest/")
731 (synopsis "Python testing library")
733 "Pytest is a testing tool that provides auto-discovery of test modules
734 and functions, detailed info on failing assert statements, modular fixtures,
735 and many external plugins.")
736 (license license:expat)
737 (properties `((python2-variant . ,(delay python2-pytest))))))
739 (define-public python2-pytest
740 (let ((pytest (package-with-python2
741 (strip-python2-variant python-pytest))))
745 `(("python2-funcsigs" ,python2-funcsigs)
746 ("python2-pathlib2" ,python2-pathlib2)
747 ,@(package-propagated-inputs pytest))))))
749 (define-public python-pytest-bootstrap
751 (inherit (strip-python2-variant python-pytest))
752 (name "python-pytest-bootstrap")
753 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
754 (arguments `(#:tests? #f))
755 (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
757 (define-public python2-pytest-bootstrap
758 (let ((pytest (package-with-python2
759 (strip-python2-variant python-pytest-bootstrap))))
760 (package (inherit pytest)
762 `(("python2-funcsigs" ,python2-funcsigs-bootstrap)
763 ("python2-pathlib2" ,python2-pathlib2-bootstrap)
764 ,@(package-propagated-inputs pytest))))))
766 (define-public python-pytest-cov
768 (name "python-pytest-cov")
773 (uri (pypi-uri "pytest-cov" version))
775 (base32 "0cyxbbghx2l4p60w10k00j1j74q1ngfiffr0pxn73ababjr69dha"))))
776 (build-system python-build-system)
779 (modify-phases %standard-phases
782 ;; Options taken from tox.ini.
783 ;; TODO: make "--restructuredtext" tests pass. They currently fail
784 ;; with "Duplicate implicit target name".
785 (invoke "python" "./setup.py" "check"
786 "--strict" "--metadata"))))))
788 `(("python-coverage" ,python-coverage)
789 ("python-pytest" ,python-pytest)))
790 (home-page "https://github.com/pytest-dev/pytest-cov")
791 (synopsis "Pytest plugin for measuring coverage")
793 "Pytest-cov produces coverage reports. It supports centralised testing and
794 distributed testing in both @code{load} and @code{each} modes. It also
795 supports coverage of subprocesses.")
796 (license license:expat)))
798 (define-public python2-pytest-cov
799 (package-with-python2 python-pytest-cov))
801 (define-public python-pytest-runner
803 (name "python-pytest-runner")
808 (uri (pypi-uri "pytest-runner" version))
811 "1x0d9n40lsiphblbs61rdc0d5r31f6vh0vcahqdv0mffakbnrb80"))))
812 (build-system python-build-system)
814 `(("python-pytest" ,python-pytest-bootstrap)
815 ("python-setuptools-scm" ,python-setuptools-scm)))
816 (home-page "https://github.com/pytest-dev/pytest-runner")
817 (synopsis "Invoke py.test as a distutils command")
819 "This package provides a @command{pytest-runner} command that
820 @file{setup.py} files can use to run tests.")
821 (license license:expat)))
823 (define-public python2-pytest-runner
824 (package-with-python2 python-pytest-runner))
826 (define-public python-pytest-mock
828 (name "python-pytest-mock")
833 (uri (pypi-uri "pytest-mock" version))
836 "1i5mg3ff1qk0wqfcxfz60hwy3q5dskdp36i10ckigkzffg8hc3ad"))))
837 (build-system python-build-system)
839 `(("python-setuptools-scm" ,python-setuptools-scm)))
841 `(("python-pytest" ,python-pytest)))
842 (home-page "https://github.com/pytest-dev/pytest-mock/")
843 (synopsis "Thin-wrapper around the mock package for easier use with py.test")
845 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
846 around the patching API provided by the @code{mock} package, but with the
847 benefit of not having to worry about undoing patches at the end of a test.
848 The mocker fixture has the same API as @code{mock.patch}, supporting the
850 (properties `((python2-variant . ,(delay python2-pytest-mock))))
851 (license license:expat)))
853 (define-public python2-pytest-mock
854 (let ((base (package-with-python2
855 (strip-python2-variant python-pytest-mock))))
856 (package (inherit base)
858 `(("python2-mock" ,python2-mock)
859 ,@(package-propagated-inputs base))))))
861 (define-public python-pytest-xdist
863 (name "python-pytest-xdist")
868 (uri (pypi-uri "pytest-xdist" version))
871 "1d812apvcmshh2l8f38spqwb3bpp0x43yy7lyfpxxzc99h4r7y4n"))
872 (modules '((guix build utils)))
875 ;; Remove pre-compiled .pyc files from source.
876 (for-each delete-file-recursively
877 (find-files "." "__pycache__" #:directories? #t))
878 (for-each delete-file (find-files "." "\\.pyc$"))
880 (build-system python-build-system)
882 '(#:tests? #f)) ;FIXME: Some tests are failing.
884 ;; (modify-phases %standard-phases
886 ;; (add-after 'install 'check
887 ;; (lambda* (#:key inputs outputs #:allow-other-keys)
888 ;; (add-installed-pythonpath inputs outputs)
889 ;; (zero? (system* "py.test" "-v")))))
891 `(("python-setuptools-scm" ,python-setuptools-scm)))
893 `(("python-execnet" ,python-execnet)
894 ("python-pytest" ,python-pytest)
895 ("python-py" ,python-py)))
897 "https://github.com/pytest-dev/pytest-xdist")
899 "Plugin for py.test with distributed testing and loop-on-failing modes")
901 "The pytest-xdist plugin extends py.test with some unique test execution
902 modes: parallelization, running tests in boxed subprocesses, the ability
903 to run tests repeatedly when failed, and the ability to run tests on multiple
904 Python interpreters or platforms. It uses rsync to copy the existing
905 program code to a remote location, executes there, and then syncs the
907 (license license:expat)))
909 (define-public python2-pytest-xdist
910 (package-with-python2 python-pytest-xdist))
912 (define-public python-scripttest
914 (name "python-scripttest")
919 (uri (pypi-uri "scripttest" version))
922 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
923 (build-system python-build-system)
925 `(("python-pytest" ,python-pytest)))
926 (home-page "http://pythonpaste.org/scripttest/")
927 (synopsis "Python library to test command-line scripts")
928 (description "Scripttest is a Python helper library for testing
929 interactive command-line applications. With it you can run a script in a
930 subprocess and see the output as well as any file modifications.")
931 (license license:expat)))
933 (define-public python2-scripttest
934 (package-with-python2 python-scripttest))
936 (define-public python-testtools-bootstrap
938 (name "python-testtools-bootstrap")
943 (uri (pypi-uri "testtools" version))
946 "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
947 (patches (search-patches "python-testtools.patch"))))
948 (build-system python-build-system)
949 (arguments '(#:tests? #f))
951 `(("python-extras" ,python-extras)
952 ("python-fixtures" ,python-fixtures-bootstrap)
953 ("python-mimeparse" ,python-mimeparse)
954 ("python-pbr" ,python-pbr-minimal)
955 ("python-six" ,python-six)
956 ("python-traceback2" ,python-traceback2)
957 ("python-unittest2" ,python-unittest2)))
958 (home-page "https://github.com/testing-cabal/testtools")
960 "Extensions to the Python standard library unit testing framework")
962 "This package is only for bootstrapping. Do not use this.")
963 (license license:psfl)))
965 (define-public python2-testtools-bootstrap
966 (package-with-python2 python-testtools-bootstrap))
968 (define-public python-testtools
970 (inherit python-testtools-bootstrap)
971 (name "python-testtools")
973 `(#:phases (modify-phases %standard-phases
976 (invoke "python" "-m" "testtools.run"
977 "testtools.tests.test_suite"))))))
979 `(("python-extras" ,python-extras)
980 ("python-fixtures" ,python-fixtures)
981 ("python-mimeparse" ,python-mimeparse)
982 ("python-pbr" ,python-pbr)
983 ("python-six" ,python-six)
984 ("python-traceback2" ,python-traceback2)
985 ("python-unittest2" ,python-unittest2)))
987 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
989 "Testtools extends the Python standard library unit testing framework to
990 provide matchers, more debugging information, and cross-Python
993 (define-public python2-testtools
994 (package-with-python2 python-testtools))
996 (define-public python-testscenarios-bootstrap
998 (name "python-testscenarios-bootstrap")
1003 (uri (pypi-uri "testscenarios" version))
1006 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
1007 (build-system python-build-system)
1009 `(#:phases (modify-phases %standard-phases
1012 (invoke "python" "-m" "testtools.run"
1013 "testscenarios.test_suite"))))))
1015 `(("python-pbr" ,python-pbr-minimal)
1016 ("python-testtools" ,python-testtools-bootstrap)))
1017 (home-page "https://launchpad.net/testscenarios")
1018 (synopsis "Pyunit extension for dependency injection")
1020 "This package is only for bootstrapping. Don't use this.")
1021 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1023 (define-public python2-testscenarios-bootstrap
1024 (package-with-python2 python-testscenarios-bootstrap))
1026 (define-public python-testscenarios
1028 (inherit python-testscenarios-bootstrap)
1029 (name "python-testscenarios")
1031 `(("python-pbr" ,python-pbr)
1032 ("python-testtools" ,python-testtools)))
1034 "Testscenarios provides clean dependency injection for Python unittest
1037 (define-public python2-testscenarios
1038 (package-with-python2 python-testscenarios))
1040 ;; Testresources requires python-pbr at runtime, but pbr needs it for its
1041 ;; own tests. Hence this bootstrap variant.
1042 (define-public python-testresources-bootstrap
1044 (name "python-testresources-bootstrap")
1048 (uri (pypi-uri "testresources" version))
1051 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
1052 (build-system python-build-system)
1053 (arguments '(#:tests? #f))
1055 `(("python-pbr" ,python-pbr-minimal)))
1056 (home-page "https://launchpad.net/testresources")
1058 "Pyunit extension for managing test resources")
1060 "This package is only here for bootstrapping purposes. Use the regular
1061 testresources package instead.")
1062 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1064 (define-public python2-testresources-bootstrap
1065 (package-with-python2 python-testresources-bootstrap))
1067 (define-public python-testresources
1069 (inherit python-testresources-bootstrap)
1070 (name "python-testresources")
1072 `(("python-pbr" ,python-pbr)))
1075 `(("python-fixtures" ,python-fixtures)
1076 ("python-testtols" ,python-testtools)))
1078 "Testresources is an extension to Python's unittest to allow declarative
1079 use of resources by test cases.")))
1081 (define-public python2-testresources
1082 (package-with-python2 python-testresources))
1084 (define-public python-subunit-bootstrap
1086 (name "python-subunit-bootstrap")
1091 (uri (pypi-uri "python-subunit" version))
1094 "1fsw8rsn1s3nklx06mayrg5rn2zbky6wwjc5z07s7rf1wjzfs1wn"))))
1095 (build-system python-build-system)
1097 `(("python-extras" ,python-extras)
1098 ("python-testtools" ,python-testtools-bootstrap)))
1100 `(("python-fixtures" ,python-fixtures-bootstrap)
1101 ("python-hypothesis" ,python-hypothesis)
1102 ("python-testscenarios" ,python-testscenarios-bootstrap)))
1103 (home-page "https://launchpad.net/subunit")
1104 (synopsis "Python implementation of the subunit protocol")
1106 "This package is here for bootstrapping purposes only. Use the regular
1107 python-subunit package instead.")
1108 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1110 (define-public python2-subunit-bootstrap
1111 (package-with-python2 python-subunit-bootstrap))
1113 (define-public python-subunit
1115 (inherit python-subunit-bootstrap)
1116 (name "python-subunit")
1118 `(("python-extras" ,python-extras)
1119 ("python-testtools" ,python-testtools)))
1121 `(("python-fixtures" ,python-fixtures)
1122 ("python-hypothesis" ,python-hypothesis)
1123 ("python-testscenarios" ,python-testscenarios)))
1125 "Python-subunit is a Python implementation of the subunit test streaming
1128 (define-public python2-subunit
1129 (package-with-python2 python-subunit))
1131 ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
1132 ;; own tests. Hence this bootstrap variant.
1133 (define-public python-fixtures-bootstrap
1135 (name "python-fixtures-bootstrap")
1139 (uri (pypi-uri "fixtures" version))
1142 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
1143 (build-system python-build-system)
1144 (arguments `(#:tests? #f))
1146 `(("python-pbr-minimal" ,python-pbr-minimal)
1147 ("python-six" ,python-six)))
1148 (home-page "https://launchpad.net/python-fixtures")
1149 (synopsis "Python test fixture library")
1151 "This package is only used for bootstrapping. Use the regular
1152 python-fixtures package instead.")
1153 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1155 (define-public python2-fixtures-bootstrap
1156 (package-with-python2 python-fixtures-bootstrap))
1158 (define-public python-fixtures
1160 (inherit python-fixtures-bootstrap)
1161 (name "python-fixtures")
1164 (modify-phases %standard-phases
1167 (invoke "python" "-m" "testtools.run"
1168 "fixtures.test_suite"))))))
1170 ;; Fixtures uses pbr at runtime to check versions, etc.
1171 `(("python-pbr" ,python-pbr)
1172 ("python-six" ,python-six)))
1174 `(("python-mock" ,python-mock)
1175 ("python-testtools" ,python-testtools-bootstrap)))
1177 "Fixtures provides a way to create reusable state, useful when writing
1180 (define-public python2-fixtures
1181 (package-with-python2 python-fixtures))
1183 (define-public python-testrepository-bootstrap
1185 (name "python-testrepository-bootstrap")
1190 (uri (pypi-uri "testrepository" version))
1193 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1194 (build-system python-build-system)
1195 (arguments '(#:tests? #f))
1197 `(("python-fixtures" ,python-fixtures-bootstrap)
1198 ("python-subunit" ,python-subunit-bootstrap)
1199 ("python-testtools" ,python-testtools-bootstrap)))
1201 `(("python-mimeparse" ,python-mimeparse)))
1202 (home-page "https://launchpad.net/testrepository")
1203 (synopsis "Database for Python test results")
1205 "Bootstrap package for python-testrepository. Don't use this.")
1206 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1208 (define-public python2-testrepository-bootstrap
1209 (package-with-python2 python-testrepository-bootstrap))
1211 (define-public python-testrepository
1213 (inherit python-testrepository-bootstrap)
1214 (name "python-testrepository")
1216 ;; FIXME: Many tests are failing.
1219 `(("python-fixtures" ,python-fixtures)
1220 ("python-subunit" ,python-subunit)
1221 ("python-testtools" ,python-testtools)))
1223 `(("python-mimeparse" ,python-mimeparse)))
1224 (description "Testrepository provides a database of test results which can
1225 be used as part of a developer's workflow to check things such as what tests
1226 have failed since the last commit or what tests are currently failing.")))
1228 (define-public python2-testrepository
1229 (package-with-python2 python-testrepository))
1231 (define-public python-coverage
1233 (name "python-coverage")
1238 (uri (pypi-uri "coverage" version))
1241 "02f6m073qdispn96rc616hg0rnmw1pgqzw3bgxwiwza4zf9hirlx"))))
1242 (build-system python-build-system)
1244 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1246 (home-page "http://nedbatchelder.com/code/coverage")
1247 (synopsis "Code coverage measurement for Python")
1249 "Coverage measures code coverage, typically during test execution. It
1250 uses the code analysis tools and tracing hooks provided in the Python standard
1251 library to determine which lines are executable, and which have been
1253 (license license:bsd-3)))
1255 (define-public python2-coverage
1256 (package-with-python2 python-coverage))
1258 (define-public python-cov-core
1260 (name "python-cov-core")
1265 (uri (pypi-uri "cov-core" version))
1268 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1269 (build-system python-build-system)
1271 `(("python-coverage" ,python-coverage)))
1272 (home-page "https://github.com/schlamar/cov-core")
1273 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
1275 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1276 and @code{nose2-cov}. It is useful for developing coverage plugins for these
1277 testing frameworks.")
1278 (license license:expat)))
1280 (define-public python2-cov-core
1281 (package-with-python2 python-cov-core))
1283 (define-public python-codecov
1285 (name "python-codecov")
1290 (uri (pypi-uri "codecov" version))
1293 "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1294 (build-system python-build-system)
1296 `(("python-unittest2" ,python-unittest2)))
1298 `(("python-coverage" ,python-coverage)
1299 ("python-requests" ,python-requests)))
1300 (home-page "http://github.com/codecov/codecov-python")
1301 (synopsis "Upload code coverage reports to @code{codecov.io}")
1303 "Codecov collects code coverage reports from code written in Python, Java,
1304 C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
1305 (license license:asl2.0)))
1307 (define-public python-testpath
1309 (name "python-testpath")
1315 (url "https://github.com/jupyter/testpath")
1317 (file-name (git-file-name name version))
1320 "0r4iiizjql6ny1ln7ciw7rrbjadz1s9zrf2hl0xkgnh3ypd8936f"))))
1321 (build-system python-build-system)
1323 `(#:tests? #f ; this package does not even have a setup.py
1324 #:modules ((guix build python-build-system)
1327 #:imported-modules (,@%python-build-system-modules
1330 (modify-phases %standard-phases
1333 (lambda* (#:key inputs outputs #:allow-other-keys)
1334 (let* ((version (last
1335 (string-split (assoc-ref inputs "python") #\-)))
1336 (x.y (string-join (take (string-split version #\.) 2)
1339 (assoc-ref outputs "out")
1340 "/lib/python" x.y "/site-packages/testpath")))
1342 (copy-recursively "testpath" dir))
1344 (home-page "https://github.com/takluyver/testpath")
1345 (synopsis "Test utilities for code working with files and commands")
1347 "Testpath is a collection of utilities for Python code working with files
1348 and commands. It contains functions to check things on the file system, and
1349 tools for mocking system commands and recording calls to those.")
1350 (license license:expat)))
1352 (define-public python2-testpath
1353 (package-with-python2 python-testpath))
1355 (define-public python-testlib
1357 (name "python-testlib")
1362 (uri (pypi-uri "testlib" version ".zip"))
1364 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1365 (build-system python-build-system)
1367 `(("unzip" ,unzip))) ; for unpacking the source
1368 (synopsis "Python micro test suite harness")
1369 (description "A micro unittest suite harness for Python.")
1370 (home-page "https://github.com/trentm/testlib")
1371 (license license:expat)))
1373 (define-public python2-testlib
1374 (package-with-python2 python-testlib))
1376 ;;; The software provided by this package was integrated into pytest 2.8.
1377 (define-public python-pytest-cache
1379 (name "python-pytest-cache")
1383 (uri (pypi-uri "pytest-cache" version))
1386 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1387 (build-system python-build-system)
1389 `(("python-apipkg" ,python-apipkg)
1390 ("python-execnet" ,python-execnet)
1391 ("python-py" ,python-py)
1392 ("python-pytest" ,python-pytest)))
1393 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1394 (description "The pytest-cache plugin provides tools to rerun failures from
1395 the last py.test invocation.")
1396 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1397 (license license:expat)))
1399 (define-public python2-pytest-cache
1400 (package-with-python2 python-pytest-cache))
1402 (define-public python-pytest-localserver
1404 (name "python-pytest-localserver")
1408 (uri (pypi-uri "pytest-localserver" version))
1411 "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
1412 (build-system python-build-system)
1415 (modify-phases %standard-phases
1418 (invoke "py.test" "-v"))))))
1420 `(("python-pytest" ,python-pytest)
1421 ("python-requests" ,python-requests)
1422 ("python-six" ,python-six)))
1424 `(("python-werkzeug" ,python-werkzeug)))
1425 (synopsis "Py.test plugin to test server connections locally")
1426 (description "Pytest-localserver is a plugin for the pytest testing
1427 framework which enables you to test server connections locally.")
1428 (home-page "https://pypi.python.org/pypi/pytest-localserver")
1429 (license license:expat)))
1431 (define-public python-pytest-xprocess
1433 (name "python-pytest-xprocess")
1437 (uri (pypi-uri "pytest-xprocess" version))
1440 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1441 (build-system python-build-system)
1443 `(("python-pytest" ,python-pytest)
1444 ("python-pytest-cache" ,python-pytest-cache)
1445 ("python-psutil" ,python-psutil)))
1446 (synopsis "Pytest plugin to manage external processes across test runs")
1447 (description "Pytest-xprocess is an experimental py.test plugin for managing
1448 processes across test runs.")
1449 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1450 (license license:expat)))
1452 (define-public python-pytest-subtesthack
1454 (name "python-pytest-subtesthack")
1458 (uri (pypi-uri "pytest-subtesthack" version))
1461 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1462 (build-system python-build-system)
1464 `(("python-pytest" ,python-pytest)))
1465 (synopsis "Set-up and tear-down fixtures for unit tests")
1466 (description "This plugin allows you to set up and tear down fixtures within
1467 unit test functions that use @code{py.test}. This is useful for using
1468 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1469 function multiple times, without setting up or tearing down fixture state as is
1470 normally the case.")
1471 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1472 (license license:unlicense)))
1474 (define-public python2-pytest-subtesthack
1475 (package-with-python2 python-pytest-subtesthack))
1477 (define-public python-pytest-sugar
1479 (name "python-pytest-sugar")
1484 (uri (pypi-uri "pytest-sugar" version))
1487 "1asq7yc4g8bx2sn7yy974mhc9ywvaihasjab4inkirdwn9s7mn7w"))))
1488 (build-system python-build-system)
1490 `(("python-packaging" ,python-packaging)
1491 ("python-pytest" ,python-pytest)
1492 ("python-termcolor" ,python-termcolor)))
1493 (home-page "https://pivotfinland.com/pytest-sugar/")
1494 (synopsis "Plugin for pytest that changes the default look and feel")
1496 "@code{pytest-sugar} is a plugin for py.test that changes the default
1497 look and feel of py.test, using a progress bar and showing failures and errors
1499 (license license:bsd-3)))
1501 (define-public python-hypothesis
1503 (name "python-hypothesis")
1507 (uri (pypi-uri "hypothesis" version))
1510 "18740bkpvj4ygmvzxnhakxdmj2igvgyayczyajll9gz5x47d9mjy"))))
1511 (build-system python-build-system)
1513 `(("python-flake8" ,python-flake8)
1514 ("python-pytest" ,python-pytest-bootstrap)))
1516 `(("python-attrs" ,python-attrs-bootstrap)
1517 ("python-coverage" ,python-coverage)))
1518 (synopsis "Library for property based testing")
1519 (description "Hypothesis is a library for testing your Python code against a
1520 much larger range of examples than you would ever want to write by hand. It’s
1521 based on the Haskell library, Quickcheck, and is designed to integrate
1522 seamlessly into your existing Python unit testing work flow.")
1523 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
1524 (license license:mpl2.0)
1525 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1527 (define-public python2-hypothesis
1528 (let ((hypothesis (package-with-python2
1529 (strip-python2-variant python-hypothesis))))
1530 (package (inherit hypothesis)
1532 `(("python2-enum34" ,python2-enum34)
1533 ,@(package-propagated-inputs hypothesis))))))
1535 (define-public python-lit
1542 (uri (pypi-uri "lit" version))
1545 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
1546 (build-system python-build-system)
1549 (modify-phases %standard-phases
1552 (invoke "python" "lit.py" "tests"))))))
1555 (home-page "https://llvm.org/")
1556 (synopsis "LLVM Software Testing Tool")
1557 (description "@code{lit} is a portable tool for executing LLVM and Clang
1558 style test suites, summarizing their results, and providing indication of
1560 (license license:ncsa)))
1562 (define-public python2-lit
1563 (package-with-python2 python-lit))
1565 (define-public python-pytest-pep8
1567 (name "python-pytest-pep8")
1571 (uri (pypi-uri "pytest-pep8" version))
1574 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
1575 (build-system python-build-system)
1577 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
1579 `(("python-pytest" ,python-pytest)))
1581 `(("python-pep8" ,python-pep8)))
1582 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
1583 (synopsis "Py.test plugin to check PEP8 requirements")
1584 (description "Pytest plugin for checking PEP8 compliance.")
1585 (license license:expat)))
1587 (define-public python2-pytest-pep8
1588 (package-with-python2 python-pytest-pep8))
1590 (define-public python-pytest-flakes
1592 (name "python-pytest-flakes")
1596 (uri (pypi-uri "pytest-flakes" version))
1599 "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
1600 (build-system python-build-system)
1603 (modify-phases %standard-phases
1605 (add-after 'install 'check
1606 (lambda* (#:key outputs inputs #:allow-other-keys)
1607 ;; It's easier to run tests after install.
1608 ;; Make installed package available for running the tests
1609 (add-installed-pythonpath inputs outputs)
1610 (invoke "py.test" "-vv"))))))
1612 `(("python-coverage" ,python-coverage)
1613 ("python-pytest" ,python-pytest)
1614 ("python-pytest-cache" ,python-pytest-cache)
1615 ("python-pytest-pep8" ,python-pytest-pep8)))
1617 `(("python-pyflakes" ,python-pyflakes)))
1618 (home-page "https://github.com/fschulze/pytest-flakes")
1619 (synopsis "Py.test plugin to check source code with pyflakes")
1620 (description "Pytest plugin for checking Python source code with pyflakes.")
1621 (license license:expat)))
1623 (define-public python2-pytest-flakes
1624 (package-with-python2 python-pytest-flakes))
1626 (define-public python2-coverage-test-runner
1628 (name "python2-coverage-test-runner")
1634 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
1635 "coverage-test-runner/snapshot/coverage-test-runner-"
1639 "1kjjb9llckycnfxag8zcvqsn4z1s3dwyw6b1n0avxydihgf30rny"))))
1640 (build-system python-build-system)
1642 `(#:python ,python-2
1644 (modify-phases %standard-phases
1647 (invoke "./testrun"))))))
1649 `(("python2-coverage" ,python2-coverage)))
1650 (home-page "https://liw.fi/coverage-test-runner/")
1651 (synopsis "Python module for running unit tests")
1652 (description "@code{CoverageTestRunner} is a python module for running
1653 unit tests and failing them if the unit test module does not exercise all
1654 statements in the module it tests.")
1655 (license license:gpl3+)))
1657 (define-public python-pylint
1659 (name "python-pylint")
1665 "https://github.com/PyCQA/pylint/archive/pylint-"
1669 "0mzn1czhf1mgr2wiqfihb274sja02h899b85kywdpivppa9nwrmp"))))
1670 (build-system python-build-system)
1672 `(("python-pytest" ,python-pytest)
1673 ("python-pytest-runner" ,python-pytest-runner)
1674 ("python-tox" ,python-tox)))
1676 `(("python-astroid" ,python-astroid)
1677 ("python-isort" ,python-isort)
1678 ("python-mccabe" ,python-mccabe)
1679 ("python-six" ,python-six)))
1682 (modify-phases %standard-phases
1685 ;; Somehow, tests for python2-pylint
1686 ;; fail if run from the build directory
1687 (let ((work "/tmp/work"))
1689 (setenv "PYTHONPATH"
1690 (string-append (getenv "PYTHONPATH") ":" work))
1691 (copy-recursively "." work)
1692 (with-directory-excursion "/tmp"
1693 (invoke "python" "-m" "unittest" "discover"
1694 "-s" (string-append work "/pylint/test")
1695 "-p" "*test_*.py"))))))))
1696 (home-page "https://github.com/PyCQA/pylint")
1697 (synopsis "Python source code analyzer which looks for coding standard
1699 (description "Pylint is a Python source code analyzer which looks
1700 for programming errors, helps enforcing a coding standard and sniffs
1701 for some code smells (as defined in Martin Fowler's Refactoring book).
1703 Pylint has many rules enabled by default, way too much to silence them
1704 all on a minimally sized program. It's highly configurable and handle
1705 pragmas to control it from within your code. Additionally, it is
1706 possible to write plugins to add your own checks.")
1707 (properties `((python2-variant . ,(delay python2-pylint))))
1708 (license license:gpl2+)))
1710 (define-public python2-pylint
1711 (let ((pylint (package-with-python2
1712 (strip-python2-variant python-pylint))))
1713 (package (inherit pylint)
1715 `(("python2-backports-functools-lru-cache"
1716 ,python2-backports-functools-lru-cache)
1717 ("python2-configparser" ,python2-configparser)
1718 ,@(package-propagated-inputs pylint))))))
1720 (define-public python-paramunittest
1722 (name "python-paramunittest")
1727 (uri (pypi-uri "ParamUnittest" version))
1730 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
1731 (build-system python-build-system)
1733 "https://github.com/rik0/ParamUnittest")
1735 "Simple extension to have parametrized unit tests")
1737 "This package allows to create parametrized unit-tests that work with the standard
1738 unittest package. A parametrized test case is automatically converted to multiple test
1739 cases. Since they are TestCase subclasses, they work with other test suites that
1740 recognize TestCases.")
1741 (license license:bsd-2)))
1743 (define-public python2-python-paramunittest
1744 (package-with-python2 python-paramunittest))
1746 (define-public python-pytest-warnings
1748 (name "python-pytest-warnings")
1753 (uri (pypi-uri "pytest-warnings" version))
1756 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
1757 (build-system python-build-system)
1759 `(("pytest" ,python-pytest)))
1760 (home-page "https://github.com/fschulze/pytest-warnings")
1761 (synopsis "Pytest plugin to list Python warnings in pytest report")
1763 "Python-pytest-warnings is a pytest plugin to list Python warnings in
1765 (license license:expat)
1766 (properties `((python2-variant . ,(delay python2-pytest-warnings))
1767 ;; This package is part of pytest as of version 3.1.0.
1768 (superseded . ,python-pytest)))))
1770 (define-public python2-pytest-warnings
1771 (package (inherit (package-with-python2
1772 (strip-python2-variant python-pytest-warnings)))
1773 (properties `((superseded . ,python2-pytest)))))
1775 (define-public python-pytest-capturelog
1777 (name "python-pytest-capturelog")
1782 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
1785 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
1786 (build-system python-build-system)
1788 `(("pytest" ,python-pytest)))
1789 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
1790 (synopsis "Pytest plugin to catch log messages")
1792 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
1793 (license license:expat)))
1795 (define-public python2-pytest-capturelog
1796 (package-with-python2 python-pytest-capturelog))
1798 (define-public python-pytest-catchlog
1800 (name "python-pytest-catchlog")
1805 (uri (pypi-uri "pytest-catchlog" version ".zip"))
1808 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
1809 (build-system python-build-system)
1811 `(("unzip" ,unzip)))
1813 `(("pytest" ,python-pytest)))
1814 (home-page "https://github.com/eisensheng/pytest-catchlog")
1815 (synopsis "Pytest plugin to catch log messages")
1817 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
1818 a fork of pytest-capturelog.")
1819 (license license:expat)))
1821 (define-public python2-pytest-catchlog
1822 (package-with-python2 python-pytest-catchlog))
1824 (define-public python-nosexcover
1826 (name "python-nosexcover")
1830 (uri (pypi-uri "nosexcover" version))
1833 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
1834 (build-system python-build-system)
1836 `(("python-coverage" ,python-coverage)
1837 ("python-nose" ,python-nose)))
1838 (home-page "http://github.com/cmheisel/nose-xcover")
1839 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
1840 (description "Nose-xcover is a companion to the built-in
1841 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
1842 to a file named coverage.xml.
1844 It will honor all the options you pass to the Nose coverage plugin,
1845 especially -cover-package.")
1846 (license license:expat)))
1848 (define-public python2-nosexcover
1849 (package-with-python2 python-nosexcover))
1851 (define-public python-discover
1853 (name "python-discover")
1858 (uri (pypi-uri "discover" version))
1861 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
1862 (build-system python-build-system)
1863 (home-page "http://pypi.python.org/pypi/discover/")
1865 "Python test discovery for unittest")
1867 "Discover provides test discovery for unittest, a feature that has been
1868 backported from Python 2.7 for Python 2.4+.")
1869 (license license:bsd-3)))
1871 (define-public python2-discover
1872 (package-with-python2 python-discover))
1874 (define-public behave
1880 (uri (pypi-uri "behave" version))
1883 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))))
1884 (build-system python-build-system)
1886 `(("python-mock" ,python-mock)
1887 ("python-nose" ,python-nose)
1888 ("python-pathpy" ,python-pathpy)
1889 ("python-pyhamcrest" ,python-pyhamcrest)
1890 ("python-pytest" ,python-pytest)))
1892 `(("python-six" ,python-six)
1893 ("python-parse" ,python-parse)
1894 ("python-parse-type" ,python-parse-type)))
1896 '(#:test-target "behave_test"))
1897 (home-page "https://github.com/behave/behave")
1898 (synopsis "Python behavior-driven development")
1900 "Behave is a tool for behavior-driven development in python.
1901 Behavior-driven development (or BDD) is an agile software development
1902 technique that encourages collaboration between developers, QA and
1903 non-technical or business participants in a software project. Behave uses
1904 tests written in a natural language style, backed up by Python code.")
1905 (license license:x11)))
1907 (define-public python-behave-web-api
1909 (name "python-behave-web-api")
1914 (uri (pypi-uri "behave-web-api" version))
1917 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
1918 (build-system python-build-system)
1921 (modify-phases %standard-phases
1922 (add-after 'unpack 'fix-dependencies
1924 (substitute* "setup.py"
1925 (("'wheel'") "") ; We don't use it.
1926 (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
1929 `(("behave" ,behave)
1930 ("python-requests" ,python-requests)))
1931 (home-page "https://github.com/jefersondaniel/behave-web-api")
1932 (synopsis "Provides testing for JSON APIs with Behave for Python")
1933 (description "This package provides testing utility modules for testing
1934 JSON APIs with Behave.")
1935 (license license:expat)))
1937 (define-public python2-behave-web-api
1938 (package-with-python2 python-behave-web-api))
1940 (define-public python-rednose
1942 (name "python-rednose")
1947 (uri (pypi-uri "rednose" version))
1950 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
1951 (build-system python-build-system)
1953 `(#:phases (modify-phases %standard-phases
1954 (add-after 'unpack 'patch-setup.py
1956 ;; Six is only required for tests and later versions
1958 (substitute* "setup.py"
1959 (("six==1.10.0") "six"))
1962 `(("python-colorama" ,python-colorama)
1963 ("python-termstyle" ,python-termstyle)))
1965 `(("python-six" ,python-six)
1966 ("python-nose" ,python-nose)))
1967 (home-page "https://github.com/JBKahn/rednose")
1968 (synopsis "Colored output for Python nosetests")
1969 (description "This package provides colored output for the
1970 @command{nosetests} command of the Python Nose unit test framework.")
1971 (license license:bsd-3)))
1973 (define-public python2-rednose
1974 (package-with-python2 python-rednose))
1976 (define-public python-nose-randomly
1978 (name "python-nose-randomly")
1983 (uri (pypi-uri "nose-randomly" version))
1985 (base32 "0z662rqhfk4bjmg806mn4frb8nz4gbh7mrddsrhfffp1g4yklj3y"))))
1986 (build-system python-build-system)
1988 `(("python-nose" ,python-nose)
1989 ("python-numpy" ,python-numpy)))
1990 (home-page "https://github.com/adamchainz/nose-randomly")
1992 "Nose plugin to randomly order tests and control random.seed")
1994 "This is a @code{Nose} plugin to randomly order tests which can be quite
1995 powerful in discovering hidden flaws in the tests themselves, while helping to
1996 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
1997 by resetting it to a repeatable number for each test, enabling the tests to
1998 create data based on random numbers and yet remain repeatable.")
1999 (license license:bsd-3)))
2001 (define-public python2-nose-randomly
2002 (package-with-python2 python-nose-randomly))
2004 (define-public python-nose-timer
2006 (name "python-nose-timer")
2011 (uri (pypi-uri "nose-timer" version))
2013 (base32 "04inck7l1sgkjbiinhifxk45wk2b3czbwh1x2a390hi183fq1q12"))))
2014 (build-system python-build-system)
2016 `(("python-nose" ,python-nose)
2017 ("python-termcolor" ,python-termcolor)))
2018 (home-page "https://github.com/mahmoudimus/nose-timer")
2019 (synopsis "Timer plugin for nosetests")
2020 (description "Shows how much time was needed to run individual tests.")
2021 (license license:expat)))
2023 (define-public python2-nose-timer
2024 (package-with-python2 python-nose-timer))
2026 (define-public python-freezegun
2028 (name "python-freezegun")
2033 (uri (pypi-uri "freezegun" version))
2035 (base32 "1nh0fzqjwg88n57k3qa8mxnmiwrr7lqyd5xvc96qn5g8zcxv8fg8"))))
2036 (build-system python-build-system)
2038 `(("python-mock" ,python-mock)
2039 ("python-nose" ,python-nose)
2040 ("python-coverage" ,python-coverage)))
2042 `(("python-six" ,python-six)
2043 ("python-dateutil" ,python-dateutil)))
2046 (modify-phases %standard-phases
2047 ;; The tests are normally executed via `make test`, but the PyPi
2048 ;; package does not include the Makefile.
2051 (invoke "nosetests" "./tests/"))))))
2052 (home-page "https://github.com/spulec/freezegun")
2053 (synopsis "Test utility for mocking the datetime module")
2055 "FreezeGun is a library that allows your python tests to travel through
2056 time by mocking the datetime module.")
2057 (license license:asl2.0)))
2059 (define-public python2-freezegun
2060 (package-with-python2 python-freezegun))
2062 (define-public python-flexmock
2064 (name "python-flexmock")
2068 (uri (pypi-uri "flexmock" version))
2071 "031c624pdqm7cc0xh4yz5k69gqxn2bbrjz13s17684q5shn0ik21"))))
2072 (build-system python-build-system)
2073 (home-page "https://flexmock.readthedocs.org")
2074 (synopsis "Testing library for Python")
2076 "flexmock is a testing library for Python that makes it easy to create
2077 mocks, stubs and fakes.")
2078 (license license:bsd-3)))
2080 (define-public python2-flexmock
2081 (package-with-python2 python-flexmock))
2083 (define-public python-flaky
2085 (name "python-flaky")
2089 (uri (pypi-uri "flaky" version))
2092 "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j"))))
2093 (build-system python-build-system)
2095 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2097 (home-page "https://github.com/box/flaky")
2098 (synopsis "Automatically rerun flaky tests")
2100 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2103 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2104 on components that aren't 100% reliable. With flaky, instead of removing
2105 those tests or marking them to @code{@@skip}, they can be automatically
2107 (license license:asl2.0)))
2109 (define-public python2-flaky
2110 (package-with-python2 python-flaky))
2112 (define-public python-pyhamcrest
2114 (name "python-pyhamcrest")
2117 ;; Tests not distributed from pypi release.
2120 (url "https://github.com/hamcrest/PyHamcrest")
2121 (commit (string-append "V" version))))
2122 (file-name (git-file-name name version))
2125 "01qnzj9qnzz0y78qa3ing24ssvszb0adw59xc4qqmdn5wryy606b"))))
2126 (native-inputs ; All native inputs are for tests
2127 `(("python-pytest-cov" ,python-pytest-cov)
2128 ("python-mock" ,python-mock)
2129 ("python-pytest" ,python-pytest)
2130 ("python-hypothesis" ,python-hypothesis)))
2132 `(("python-six" ,python-six)))
2133 (build-system python-build-system)
2134 (home-page "http://hamcrest.org/")
2135 (synopsis "Hamcrest matchers for Python")
2137 "PyHamcrest is a framework for writing matcher objects,
2138 allowing you to declaratively define \"match\" rules.")
2139 (license license:bsd-3)))
2141 (define-public python2-pyhamcrest
2142 (package-with-python2 python-pyhamcrest))
2144 (define-public unittest-cpp
2146 (name "unittest-cpp")
2151 (url "https://github.com/unittest-cpp/unittest-cpp")
2152 (commit (string-append "v" version))))
2153 (file-name (git-file-name name version))
2155 (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
2157 `(#:tests? #f)) ; It's run after build automatically.
2158 (build-system cmake-build-system)
2159 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2160 (synopsis "Lightweight unit testing framework for C++")
2161 (description "UnitTest++ is a lightweight unit testing framework for C++.
2162 It was designed to do test-driven development on a wide variety of platforms.
2163 Simplicity, portability, speed, and small footprint are all very important
2164 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2165 of advanced library and language features, which means it should be easily
2166 portable to just about any platform.")
2167 (license license:expat)))
2169 (define-public libfaketime
2171 (name "libfaketime")
2173 (home-page "https://github.com/wolfcw/libfaketime")
2178 (commit (string-append "v" version))))
2181 "1cin1pqwpsswcv7amiwijirvcg3x1zf2l00s1x84nxc5602fzr5c"))
2182 (file-name (git-file-name name version))))
2183 (build-system gnu-build-system)
2185 '(#:phases (modify-phases %standard-phases
2187 (lambda* (#:key outputs #:allow-other-keys)
2188 (let ((out (assoc-ref outputs "out")))
2190 (setenv "PREFIX" out)
2192 (add-before 'check 'pre-check
2194 (substitute* "test/functests/test_exclude_mono.sh"
2195 (("/bin/bash") (which "bash")))
2197 #:test-target "test"))
2199 `(("perl" ,perl))) ;for tests
2200 (synopsis "Fake the system time for single applications")
2202 "The libfaketime library allows users to modify the system time that an
2203 application \"sees\". It is meant to be loaded using the dynamic linker's
2204 @code{LD_PRELOAD} environment variable. The @command{faketime} command
2205 provides a simple way to achieve this.")
2206 (license license:gpl2)))
2208 (define-public umockdev
2214 (uri (string-append "https://github.com/martinpitt/umockdev/"
2215 "releases/download/" version "/"
2216 "umockdev-" version ".tar.xz"))
2219 "1hx5jm9afng6hw9wyp524z8nwdp6w053pca0w2c0gqpgrmvjxvd2"))))
2220 (build-system gnu-build-system)
2223 (modify-phases %standard-phases
2224 (add-after 'unpack 'skip-broken-test
2226 (substitute* "tests/test-umockdev.c"
2227 (("/\\* sys/ in other dir")
2228 (string-append "return; // ")))
2232 ("python" ,python) ; for tests
2233 ("which" ,which) ; for tests
2234 ("gtk-doc" ,gtk-doc)
2235 ("pkg-config" ,pkg-config)))
2239 ("libgudev" ,libgudev)
2240 ("gobject-introspection" ,gobject-introspection)))
2241 (home-page "https://github.com/martinpitt/umockdev/")
2242 (synopsis "Mock hardware devices for creating unit tests")
2243 (description "umockdev mocks hardware devices for creating integration
2244 tests for hardware related libraries and programs. It also provides tools to
2245 record the properties and behaviour of particular devices, and to run a
2246 program or test suite under a test bed with the previously recorded devices
2248 (license license:lgpl2.1+)))