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, 2020 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, 2019 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, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
29 ;;; Copyright © 2017, 2018, 2020 Ludovic Courtès <ludo@gnu.org>
30 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
31 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
32 ;;; Copyright © 2019 Chris Marusich <cmmarusich@gmail.com>
34 ;;; This file is part of GNU Guix.
36 ;;; GNU Guix is free software; you can redistribute it and/or modify it
37 ;;; under the terms of the GNU General Public License as published by
38 ;;; the Free Software Foundation; either version 3 of the License, or (at
39 ;;; your option) any later version.
41 ;;; GNU Guix is distributed in the hope that it will be useful, but
42 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
43 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44 ;;; GNU General Public License for more details.
46 ;;; You should have received a copy of the GNU General Public License
47 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
49 (define-module (gnu packages check)
50 #:use-module (gnu packages)
51 #:use-module (gnu packages autotools)
52 #:use-module (gnu packages base)
53 #:use-module (gnu packages bash)
54 #:use-module (gnu packages compression)
55 #:use-module (gnu packages linux)
56 #:use-module (gnu packages llvm)
57 #:use-module (gnu packages glib)
58 #:use-module (gnu packages gnome)
59 #:use-module (gnu packages golang)
60 #:use-module (gnu packages gtk)
61 #:use-module (gnu packages perl)
62 #:use-module (gnu packages pkg-config)
63 #:use-module (gnu packages python)
64 #:use-module (gnu packages python-web)
65 #:use-module (gnu packages python-xyz)
66 #:use-module (gnu packages time)
67 #:use-module (guix utils)
68 #:use-module ((guix licenses) #:prefix license:)
69 #:use-module (guix packages)
70 #:use-module (guix download)
71 #:use-module (guix git-download)
72 #:use-module (guix build-system cmake)
73 #:use-module (guix build-system gnu)
74 #:use-module (guix build-system go)
75 #:use-module (guix build-system python)
76 #:use-module (guix build-system trivial))
85 (uri (string-append "https://github.com/libcheck/check/releases/download/"
86 version "/check-" version ".tar.gz"))
89 "02zkfiyklckmivrfvdsrlzvzphkdsgjrz3igncw05dv5pshhq3xx"))))
90 (build-system gnu-build-system)
91 (home-page "https://libcheck.github.io/check/")
92 (synopsis "Unit test framework for C")
94 "Check is a unit testing framework for C. It features a simple
95 interface for defining unit tests, putting little in the way of the
96 developer. Tests are run in a separate address space, so Check can
97 catch both assertion failures and code errors that cause segmentation
98 faults or other signals. The output from unit tests can be used within
99 source code editors and IDEs.")
100 (license license:lgpl2.1+)))
102 ;; Some packages require this older version. Removed once no longer needed.
103 (define-public check-0.12
109 (uri (string-append "https://github.com/libcheck/check/releases"
110 "/download/" version "/check-" version ".tar.gz"))
113 "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6"))))))
122 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
123 version "/CUnit-" version ".tar.bz2"))
126 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
127 (build-system gnu-build-system)
128 (arguments '(#:phases
129 (modify-phases %standard-phases
130 ;; XXX: The "bootstrap" phase detects the "bootstrap"
131 ;; script, but fails to execute it, so we bootstrap
134 (lambda _ (invoke "autoreconf" "-vfi"))))))
136 `(("automake" ,automake)
137 ("autoconf" ,autoconf)
138 ("libtool" ,libtool)))
139 (home-page "http://cunit.sourceforge.net/")
140 (synopsis "Automated testing framework for C")
142 "CUnit is a lightweight system for writing, administering, and running
143 unit tests in C. It provides C programmers with basic testing functionality
144 with a flexible variety of user interfaces.")
145 (license license:gpl2+)))
147 (define-public cppunit
153 (uri (string-append "http://dev-www.libreoffice.org/src/"
154 name "-" version ".tar.gz"))
157 "1027cyfx5gsjkdkaf6c2wnjh68882grw8n672018cj3vs9lrhmix"))))
158 ;; Explicitly link with libdl. This is expected to be done by packages
159 ;; relying on cppunit for their tests. However, not all of them do.
160 ;; If we added the linker flag to such packages, we would pollute all
161 ;; binaries, not only those used for testing.
163 `(#:make-flags '("LDFLAGS=-ldl")))
164 (build-system gnu-build-system)
165 (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
166 (synopsis "Unit testing framework for C++")
167 (description "CppUnit is the C++ port of the famous JUnit framework for
168 unit testing. Test output is in XML for automatic testing and GUI based for
170 (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
172 ;; When dependent packages upgraded to use newer version of catch, this one should
174 (define-public catch-framework
177 (version "1.3.5") ;Sub-minor is the build number
181 (url "https://github.com/philsquared/Catch")
183 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
184 (file-name (string-append name "-" version))
187 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
188 (build-system trivial-build-system)
190 `(#:modules ((guix build utils))
192 (use-modules (guix build utils))
193 (let* ((source (assoc-ref %build-inputs "source"))
194 (output (assoc-ref %outputs "out"))
195 (incdir (string-append output "/include"))
196 (docdir (string-append output "/share/doc/catch-"
198 (for-each mkdir-p (list incdir docdir))
199 (install-file (string-append source
200 "/single_include/catch.hpp")
202 (copy-recursively (string-append source "/docs")
205 (home-page "http://catch-lib.net/")
206 (synopsis "Automated test framework for C++ and Objective-C")
208 "Catch stands for C++ Automated Test Cases in Headers and is a
209 multi-paradigm automated test framework for C++ and Objective-C.")
210 (license license:boost1.0)))
212 (define-public catch-framework2-1
216 (home-page "https://github.com/catchorg/Catch2")
220 (url "https://github.com/catchorg/Catch2")
221 (commit (string-append "v" version))))
222 (file-name (git-file-name name version))
225 "1gdp5wm8khn02g2miz381llw3191k7309qj8s3jd6sasj01rhf23"))))
226 (build-system cmake-build-system)
227 (synopsis "Automated test framework for C++ and Objective-C")
228 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
229 a multi-paradigm automated test framework for C++ and Objective-C.")
230 (license license:boost1.0)))
232 (define-public catch-framework2
236 (home-page "https://github.com/catchorg/Catch2")
240 (url "https://github.com/catchorg/Catch2")
241 (commit (string-append "v" version))))
242 (file-name (git-file-name name version))
245 "14vcckqmbydjsg40ngi6iv999zimysh2l7fmrqj1d7xl990qz233"))))
246 (build-system cmake-build-system)
248 `(("python" ,python-wrapper)))
249 (synopsis "Automated test framework for C++ and Objective-C")
250 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
251 a multi-paradigm automated test framework for C++ and Objective-C.")
252 (license license:boost1.0)))
254 (define-public cmdtest
260 (uri (string-append "http://git.liw.fi/cmdtest/snapshot/"
261 name "-" version ".tar.gz"))
264 "1jmfiyrrqmpvwdb273bkb8hjaf4rwx9njblx29pmr7giyahskwi5"))))
265 (build-system python-build-system)
269 (modify-phases %standard-phases
270 ;; check phase needs to be run before the build phase. If not, the
271 ;; coverage test runner looks for tests for the built source files,
274 (add-before 'build 'check
277 (("/bin/sh") (which "sh")))
278 ;; yarn uses python2-ttystatus to print messages.
279 ;; python2-ttystatus requires /dev/tty which is not present in
280 ;; the build environment. Hence assuming-failure test fails.
281 (delete-file "yarn.tests/assuming-failure.script")
282 (delete-file "yarn.tests/assuming-failure.stdout")
283 (invoke "python" "setup.py" "check"))))))
285 `(("python2-coverage-test-runner" ,python2-coverage-test-runner)))
287 `(("python2-cliapp" ,python2-cliapp)
288 ("python2-markdown" ,python2-markdown)
289 ("python2-ttystatus" ,python2-ttystatus)))
290 (home-page "https://liw.fi/cmdtest/")
291 (synopsis "Black box Unix program tester")
293 "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
294 given a command line and input files, and the expected output, and it verifies
295 that the command line produces the expected output. If not, it reports a
296 problem, and shows the differences.")
297 (license license:gpl3+)))
299 (define-public cmocka
305 (uri (string-append "https://cmocka.org/files/"
306 (version-major+minor version) "/cmocka-"
310 "1dm8pdvkyfa8dsbz9bpq7wwgixjij4sii9bbn5sgvqjm5ljdik7h"))))
311 (build-system cmake-build-system)
313 `(#:tests? #f)) ; no test target
314 (home-page "https://cmocka.org/")
315 (synopsis "Unit testing framework for C")
316 (description "Cmocka is a unit testing framework for C with support for
317 mock objects. It only requires the standard C library, and works with
318 different compilers. Cmocka supports several different message output formats
319 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
321 (license license:asl2.0)))
323 (define-public cppcheck
330 (url "https://github.com/danmar/cppcheck")
332 (file-name (git-file-name name version))
334 (base32 "0h7ir2x0k005fm586dxmaphgv5cyz25k3k4sh02p7zb78gzx398h"))))
335 (build-system cmake-build-system)
337 '(#:configure-flags '("-DBUILD_TESTS=ON")))
338 (home-page "http://cppcheck.sourceforge.net")
339 (synopsis "Static C/C++ code analyzer")
340 (description "Cppcheck is a static code analyzer for C and C++. Unlike
341 C/C++ compilers and many other analysis tools it does not detect syntax errors
342 in the code. Cppcheck primarily detects the types of bugs that the compilers
343 normally do not detect. The goal is to detect only real errors in the code
344 (i.e. have zero false positives).")
345 (license license:gpl3+)))
347 (define-public cxxtest
353 (uri (string-append "mirror://sourceforge/cxxtest/cxxtest/"
354 version "/cxxtest-" version ".tar.gz"))
357 "1n7pbj4z9ivx005hqvivj9ddhq8awynzg6jishfbypf6j7ply58w"))))
358 (build-system python-build-system)
361 (modify-phases %standard-phases
362 (add-after 'unpack 'chdir-to-source
366 (add-after 'install 'install-headers
367 (lambda* (#:key outputs #:allow-other-keys)
368 (let* ((out (assoc-ref outputs "out"))
369 (include-dir (string-append out "/include/cxxtest")))
370 (for-each (lambda (header-file)
371 (install-file header-file include-dir))
372 (find-files "../cxxtest"))
374 (add-after 'install 'install-doc
375 (lambda* (#:key outputs #:allow-other-keys)
376 (let* ((out (assoc-ref outputs "out"))
377 (doc-dir (string-append out "/share/doc/cxxtest")))
378 (install-file "../README" doc-dir)
379 (install-file "../doc/guide.txt" doc-dir)
380 (copy-recursively "../sample" (string-append doc-dir "/sample"))
383 `(("python-ply" ,python-ply)))
384 (home-page "https://cxxtest.com/")
385 (synopsis "Unit testing framework for C++")
386 (description "CxxTest is a unit testing framework for C++ that is similar
387 in spirit to JUnit, CppUnit, and xUnit. CxxTest does not require precompiling
388 a CxxTest testing library, it employs no advanced features of C++ (e.g. RTTI)
389 and it supports a very flexible form of test discovery.")
390 (license license:lgpl3+)))
392 (define-public doctest
396 (home-page "https://github.com/onqtam/doctest")
399 (uri (git-reference (url home-page) (commit version)))
400 (file-name (git-file-name name version))
403 "134lx7pjnglrl4wdmyr9dz3rjb6d4ir6rvapg00gp52n44dbhnrq"))))
404 (build-system cmake-build-system)
405 (synopsis "C++ test framework")
407 "doctest is a single-header testing framework for C++11 and later. It
408 has been designed to be fast, light and unintrusive.")
409 (license license:expat)))
411 (define-public go-gopkg.in-check.v1
412 (let ((commit "788fd78401277ebd861206a03c884797c6ec5541")
415 (name "go-gopkg.in-check.v1")
416 (version (git-version "0.0.0" revision commit))
420 (url "https://github.com/go-check/check.git")
422 (file-name (git-file-name name version))
425 "0v3bim0j375z81zrpr5qv42knqs0y2qv2vkjiqi5axvb78slki1a"))))
426 (build-system go-build-system)
428 '(#:import-path "gopkg.in/check.v1"))
430 `(("go-github-com-kr-pretty" ,go-github-com-kr-pretty)))
431 (synopsis "Rich testing extension for Go's testing package")
433 "@code{check} is a rich testing extension for Go's testing package.")
434 (home-page "https://github.com/go-check/check")
435 (license license:bsd-2))))
437 (define-public go-github.com-smartystreets-gunit
439 (name "go-github.com-smartystreets-gunit")
444 (url "https://github.com/smartystreets/gunit")
446 (file-name (git-file-name name version))
449 "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
450 (build-system go-build-system)
452 '(;; TODO: This package depends on go-github.com-smartystreets-assertions
453 ;; for running the tests, but go-github.com-smartystreets-assertions
454 ;; depends on this package, so break this loop by not running the tests
457 #:import-path "github.com/smartystreets/gunit"))
458 (synopsis "Testing tool for Go, in the style of xUnit")
460 "@code{gunit} allows the test author to use a struct as the scope for a
461 group of related test cases, in the style of xUnit fixtures. This makes
462 extraction of setup/teardown behavior (as well as invoking the system under
463 test) much simpler.")
464 (home-page "https://github.com/smartystreets/gunit")
465 (license license:expat)))
467 (define-public go-github.com-smartystreets-assertions
469 (name "go-github.com-smartystreets-assertions")
474 (url "https://github.com/smartystreets/assertions")
476 (file-name (git-file-name name version))
479 "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
480 (build-system go-build-system)
482 '(#:import-path "github.com/smartystreets/assertions"))
484 `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
485 (synopsis "Assertions for testing with Go")
487 "The @code{assertions} package provides convenient assertion functions
488 for writing tests in Go.")
489 (home-page "https://github.com/smartystreets/assertions")
490 (license license:expat)))
492 (define-public go-github.com-smartystreets-goconvey
494 (name "go-github.com-smartystreets-goconvey")
499 (url "https://github.com/smartystreets/goconvey")
501 (file-name (git-file-name name version))
504 "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
505 (build-system go-build-system)
507 '(#:import-path "github.com/smartystreets/goconvey"))
509 `(("go-github.com-jtolds-gls" ,go-github.com-jtolds-gls)
510 ("go-github.com-smartystreets-assertions" ,go-github.com-smartystreets-assertions)))
511 (synopsis "Go testing tool with both a web and terminal user interface")
513 "GoConvey is a testing tool for Go. It integrates with go test, can show
514 test coverage and has a web user interface that will refresh automatically.")
515 (home-page "https://github.com/smartystreets/goconvey")
516 (license license:expat)))
518 (define-public googletest
526 (url "https://github.com/google/googletest.git")
527 (commit (string-append "release-" version))))
528 (file-name (git-file-name name version))
530 (base32 "1zbmab9295scgg4z2vclgfgjchfjailjnvzc6f5x9jvlsdi3dpwz"))))
531 (build-system cmake-build-system)
533 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
535 `(("python" ,python-wrapper)))
536 (home-page "https://github.com/google/googletest/")
537 (synopsis "Test discovery and XUnit test framework")
538 (description "Google Test features an XUnit test framework, automated test
539 discovery, death tests, assertions, parameterized tests and XML test report
541 (license license:bsd-3)))
543 (define-public googletest-1.8
550 (url "https://github.com/google/googletest.git")
551 (commit (string-append "release-" version))))
552 (file-name (git-file-name "googletest" version))
555 "0270msj6n7mggh4xqqjp54kswbl7mkcc8px1p5dqdpmw5ngh9fzk"))))))
557 (define-public cpputest
564 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
565 version "/cpputest-" version ".tar.gz"))
568 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
569 (build-system gnu-build-system)
571 `(("googletest" ,googletest)))
572 (home-page "https://cpputest.github.io/")
573 (synopsis "Unit testing and mocking framework for C/C++")
575 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
576 C++ but is used in C and C++ projects and frequently used in embedded systems
577 but it works for any C/C++ project.")
578 (license license:bsd-3)))
580 (define-public python-parameterized
582 (name "python-parameterized")
587 (uri (pypi-uri "parameterized" version))
590 "1vapry9lyfb2mlpgk2wh9079hzxzq5120bsczncxxay663mdp53a"))))
591 (build-system python-build-system)
593 '(#:phases (modify-phases %standard-phases
595 (lambda* (#:key tests? #:allow-other-keys)
597 (invoke "nosetests" "-v")
598 (format #t "test suite not run~%"))
601 `(("python-mock" ,python-mock)
602 ("python-nose" ,python-nose)))
603 (home-page "https://github.com/wolever/parameterized")
604 (synopsis "Parameterized testing with any Python test framework")
606 "Parameterized is a Python library that aims to fix parameterized testing
607 for every Python test framework. It supports nose, py.test, and unittest.")
608 (properties `((python2-variant . ,(delay python2-parameterized))))
609 (license license:bsd-2)))
611 (define-public python2-parameterized
612 (let ((base (package-with-python2 (strip-python2-variant
613 python-parameterized))))
618 (inherit (package-source base))
619 (patches (search-patches "python2-parameterized-docstring-test.patch")))))))
621 (define-public python-minimock
623 (name "python-minimock")
628 (uri (pypi-uri "MiniMock" version))
631 "0k2sxb1ibnyg05iblz7zhbv825f1zk9906rab7883iqgvzmdzpsz"))))
632 (build-system python-build-system)
633 (home-page "https://pypi.org/project/MiniMock")
634 (synopsis "Simple Python library for using mock objects")
635 (description "MiniMock is a simple library for building mock objects with
637 (license license:expat)))
639 (define-public python2-minimock
640 (package-with-python2 python-minimock))
642 (define-public python-mock
649 (uri (pypi-uri "mock" version))
652 "1flbpksir5sqrvq2z0dp8sl4bzbadg21sj4d42w3klpdfvgvcn5i"))))
654 `(("python-pbr" ,python-pbr-minimal)
655 ("python-six" ,python-six)))
656 (build-system python-build-system)
658 `(("python-unittest2" ,python-unittest2)))
661 (modify-phases %standard-phases
664 (zero? (system* "unit2")))))))
665 (home-page "https://github.com/testing-cabal/mock")
666 (synopsis "Python mocking and patching library for testing")
668 "Mock is a library for testing in Python. It allows you to replace parts
669 of your system under test with mock objects and make assertions about how they
671 (properties `((python2-variant . ,(delay python2-mock))))
672 (license license:expat)))
674 (define-public python2-mock
675 (let ((base (package-with-python2
676 (strip-python2-variant python-mock))))
677 (package (inherit base)
679 `(("python2-functools32" ,python2-functools32)
680 ("python2-funcsigs" ,python2-funcsigs)
681 ,@(package-propagated-inputs base))))))
683 (define-public python-nose
690 (uri (pypi-uri "nose" version))
693 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
694 (build-system python-build-system)
696 '(#:tests? #f)) ; FIXME: test suite fails
697 (home-page "http://readthedocs.org/docs/nose/")
698 (synopsis "Python testing library")
700 "Nose extends the unittest library to make testing easier.")
701 (license license:lgpl2.0+)))
703 (define-public python2-nose
704 (package-with-python2 python-nose))
706 (define-public python-nose2
708 (name "python-nose2")
713 (uri (pypi-uri "nose2" version))
716 "0pmbb6nk31yhgh4zkcblzxsznml7f7pf5q1ihgrwvbxv4mwzfql7"))))
717 (build-system python-build-system)
718 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
720 `(("python-cov-core" ,python-cov-core)
721 ("python-pytest-cov" ,python-pytest-cov)
722 ("python-six" ,python-six)))
723 (home-page "https://github.com/nose-devs/nose2")
724 (synopsis "Next generation of nicer testing for Python")
726 "Nose2 is the next generation of nicer testing for Python, based on the
727 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
728 better plugin api, being easier for users to configure, and simplifying internal
729 interfaces and processes.")
730 (license license:bsd-2)))
732 (define-public python2-nose2
733 (package-with-python2 python-nose2))
735 (define-public python-unittest2
737 (name "python-unittest2")
742 (uri (pypi-uri "unittest2" version))
744 (search-patches "python-unittest2-python3-compat.patch"
745 "python-unittest2-remove-argparse.patch"))
748 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
749 (build-system python-build-system)
752 (modify-phases %standard-phases
755 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
757 `(("python-six" ,python-six)
758 ("python-traceback2" ,python-traceback2)))
759 (home-page "https://pypi.org/project/unittest2/")
760 (synopsis "Python unit testing library")
762 "Unittest2 is a replacement for the unittest module in the Python
764 (license license:psfl)))
766 (define-public python2-unittest2
767 (package-with-python2 python-unittest2))
769 (define-public python-pytest
771 (name "python-pytest")
776 (uri (pypi-uri "pytest" version))
779 "18w38kjnffdcrlbw6ny6dksgxai6x9bxpjs2m6klqmb8hfzjkcb2"))))
780 (build-system python-build-system)
783 (modify-phases %standard-phases
786 (invoke "pytest" "-vv" "-k"
788 ;; These tests involve the /usr directory, and fails.
789 "not test_remove_dir_prefix"
790 " and not test_argcomplete"
791 ;; This test tries to override PYTHONPATH, and
792 ;; subsequently fails to locate the test libraries.
793 " and not test_collection")))))))
795 `(("python-atomicwrites" ,python-atomicwrites)
796 ("python-attrs" ,python-attrs-bootstrap)
797 ("python-more-itertools" ,python-more-itertools)
798 ("python-pluggy" ,python-pluggy)
799 ("python-py" ,python-py)
800 ("python-six" ,python-six-bootstrap)))
802 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
804 ("python-hypothesis" ,python-hypothesis)
805 ("python-nose" ,python-nose)
806 ("python-mock" ,python-mock)
807 ("python-pytest" ,python-pytest-bootstrap)
808 ("python-setuptools-scm" ,python-setuptools-scm)))
809 (home-page "https://docs.pytest.org/en/latest/")
810 (synopsis "Python testing library")
812 "Pytest is a testing tool that provides auto-discovery of test modules
813 and functions, detailed info on failing assert statements, modular fixtures,
814 and many external plugins.")
815 (license license:expat)
816 (properties `((python2-variant . ,(delay python2-pytest))))))
818 (define-public python2-pytest
819 (let ((pytest (package-with-python2
820 (strip-python2-variant python-pytest))))
824 `(("python2-funcsigs" ,python2-funcsigs)
825 ("python2-pathlib2" ,python2-pathlib2)
826 ,@(package-propagated-inputs pytest))))))
828 (define-public python-pytest-bootstrap
830 (inherit (strip-python2-variant python-pytest))
831 (name "python-pytest-bootstrap")
832 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
833 (arguments `(#:tests? #f))
834 (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
836 (define-public python2-pytest-bootstrap
837 (let ((pytest (package-with-python2
838 (strip-python2-variant python-pytest-bootstrap))))
839 (package (inherit pytest)
841 `(("python2-funcsigs" ,python2-funcsigs-bootstrap)
842 ("python2-pathlib2" ,python2-pathlib2-bootstrap)
843 ,@(package-propagated-inputs pytest))))))
845 (define-public python-pytest-cov
847 (name "python-pytest-cov")
852 (uri (pypi-uri "pytest-cov" version))
854 (base32 "0cyxbbghx2l4p60w10k00j1j74q1ngfiffr0pxn73ababjr69dha"))))
855 (build-system python-build-system)
858 (modify-phases %standard-phases
861 ;; Options taken from tox.ini.
862 ;; TODO: make "--restructuredtext" tests pass. They currently fail
863 ;; with "Duplicate implicit target name".
864 (invoke "python" "./setup.py" "check"
865 "--strict" "--metadata"))))))
867 `(("python-coverage" ,python-coverage)
868 ("python-pytest" ,python-pytest)))
869 (home-page "https://github.com/pytest-dev/pytest-cov")
870 (synopsis "Pytest plugin for measuring coverage")
872 "Pytest-cov produces coverage reports. It supports centralised testing and
873 distributed testing in both @code{load} and @code{each} modes. It also
874 supports coverage of subprocesses.")
875 (license license:expat)))
877 (define-public python2-pytest-cov
878 (package-with-python2 python-pytest-cov))
880 (define-public python-pytest-runner
882 (name "python-pytest-runner")
887 (uri (pypi-uri "pytest-runner" version))
890 "1x0d9n40lsiphblbs61rdc0d5r31f6vh0vcahqdv0mffakbnrb80"))))
891 (build-system python-build-system)
893 `(("python-pytest" ,python-pytest-bootstrap)
894 ("python-setuptools-scm" ,python-setuptools-scm)))
895 (home-page "https://github.com/pytest-dev/pytest-runner")
896 (synopsis "Invoke py.test as a distutils command")
898 "This package provides a @command{pytest-runner} command that
899 @file{setup.py} files can use to run tests.")
900 (license license:expat)))
902 (define-public python2-pytest-runner
903 (package-with-python2 python-pytest-runner))
905 ;; python-bleach 3.1.0 requires this ancient version of pytest-runner.
906 ;; Remove once no longer needed.
907 (define-public python-pytest-runner-2
913 (uri (pypi-uri "pytest-runner" version))
916 "11ivjj9hfphkv4yfb2g74av4yy86y8gcbf7gbif0p1hcdfnxg3w6"))))))
918 (define-public python2-pytest-runner-2
919 (package-with-python2 python-pytest-runner-2))
921 (define-public python-pytest-mock
923 (name "python-pytest-mock")
928 (uri (pypi-uri "pytest-mock" version))
931 "1i5mg3ff1qk0wqfcxfz60hwy3q5dskdp36i10ckigkzffg8hc3ad"))))
932 (build-system python-build-system)
934 `(("python-setuptools-scm" ,python-setuptools-scm)))
936 `(("python-pytest" ,python-pytest)))
937 (home-page "https://github.com/pytest-dev/pytest-mock/")
938 (synopsis "Thin-wrapper around the mock package for easier use with py.test")
940 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
941 around the patching API provided by the @code{mock} package, but with the
942 benefit of not having to worry about undoing patches at the end of a test.
943 The mocker fixture has the same API as @code{mock.patch}, supporting the
945 (properties `((python2-variant . ,(delay python2-pytest-mock))))
946 (license license:expat)))
948 (define-public python2-pytest-mock
949 (let ((base (package-with-python2
950 (strip-python2-variant python-pytest-mock))))
951 (package (inherit base)
953 `(("python2-mock" ,python2-mock)
954 ,@(package-propagated-inputs base))))))
956 (define-public python-pytest-xdist
958 (name "python-pytest-xdist")
963 (uri (pypi-uri "pytest-xdist" version))
966 "1d812apvcmshh2l8f38spqwb3bpp0x43yy7lyfpxxzc99h4r7y4n"))
967 (modules '((guix build utils)))
970 ;; Remove pre-compiled .pyc files from source.
971 (for-each delete-file-recursively
972 (find-files "." "__pycache__" #:directories? #t))
973 (for-each delete-file (find-files "." "\\.pyc$"))
975 (build-system python-build-system)
977 '(#:tests? #f)) ;FIXME: Some tests are failing.
979 ;; (modify-phases %standard-phases
981 ;; (add-after 'install 'check
982 ;; (lambda* (#:key inputs outputs #:allow-other-keys)
983 ;; (add-installed-pythonpath inputs outputs)
984 ;; (zero? (system* "py.test" "-v")))))
986 `(("python-setuptools-scm" ,python-setuptools-scm)))
988 `(("python-execnet" ,python-execnet)
989 ("python-pytest" ,python-pytest)
990 ("python-py" ,python-py)))
992 "https://github.com/pytest-dev/pytest-xdist")
994 "Plugin for py.test with distributed testing and loop-on-failing modes")
996 "The pytest-xdist plugin extends py.test with some unique test execution
997 modes: parallelization, running tests in boxed subprocesses, the ability
998 to run tests repeatedly when failed, and the ability to run tests on multiple
999 Python interpreters or platforms. It uses rsync to copy the existing
1000 program code to a remote location, executes there, and then syncs the
1002 (license license:expat)))
1004 (define-public python2-pytest-xdist
1005 (package-with-python2 python-pytest-xdist))
1007 (define-public python-pytest-timeout
1009 (name "python-pytest-timeout")
1014 (uri (pypi-uri "pytest-timeout" version))
1017 "1cczcjhw4xx5sjkhxlhc5c1bkr7x6fcyx12wrnvwfckshdvblc2a"))))
1018 (build-system python-build-system)
1020 `(("python-pytest" ,python-pytest)))
1021 (home-page "http://bitbucket.org/pytest-dev/pytest-timeout/")
1022 (synopsis "Plugin for py.test to abort hanging tests")
1024 "This package provides a py.test plugin that aborts hanging tests after a
1025 timeout has been exceeded.")
1026 (license license:expat)))
1028 (define-public python-scripttest
1030 (name "python-scripttest")
1035 (uri (pypi-uri "scripttest" version))
1038 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
1039 (build-system python-build-system)
1041 `(("python-pytest" ,python-pytest)))
1042 (home-page (string-append "https://web.archive.org/web/20161029233413/"
1043 "http://pythonpaste.org/scripttest/"))
1044 (synopsis "Python library to test command-line scripts")
1045 (description "Scripttest is a Python helper library for testing
1046 interactive command-line applications. With it you can run a script in a
1047 subprocess and see the output as well as any file modifications.")
1048 (license license:expat)))
1050 (define-public python2-scripttest
1051 (package-with-python2 python-scripttest))
1053 (define-public python-testtools-bootstrap
1055 (name "python-testtools-bootstrap")
1060 (uri (pypi-uri "testtools" version))
1063 "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
1064 (patches (search-patches "python-testtools.patch"))))
1065 (build-system python-build-system)
1066 (arguments '(#:tests? #f))
1068 `(("python-extras" ,python-extras)
1069 ("python-fixtures" ,python-fixtures-bootstrap)
1070 ("python-mimeparse" ,python-mimeparse)
1071 ("python-pbr" ,python-pbr-minimal)
1072 ("python-six" ,python-six)
1073 ("python-traceback2" ,python-traceback2)
1074 ("python-unittest2" ,python-unittest2)))
1075 (home-page "https://github.com/testing-cabal/testtools")
1077 "Extensions to the Python standard library unit testing framework")
1079 "This package is only for bootstrapping. Do not use this.")
1080 (license license:psfl)))
1082 (define-public python2-testtools-bootstrap
1083 (package-with-python2 python-testtools-bootstrap))
1085 (define-public python-testtools
1087 (inherit python-testtools-bootstrap)
1088 (name "python-testtools")
1090 `(#:phases (modify-phases %standard-phases
1093 (invoke "python" "-m" "testtools.run"
1094 "testtools.tests.test_suite"))))))
1096 `(("python-extras" ,python-extras)
1097 ("python-fixtures" ,python-fixtures)
1098 ("python-mimeparse" ,python-mimeparse)
1099 ("python-pbr" ,python-pbr)
1100 ("python-six" ,python-six)
1101 ("python-traceback2" ,python-traceback2)
1102 ("python-unittest2" ,python-unittest2)))
1104 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
1106 "Testtools extends the Python standard library unit testing framework to
1107 provide matchers, more debugging information, and cross-Python
1110 (define-public python2-testtools
1111 (package-with-python2 python-testtools))
1113 (define-public python-testscenarios-bootstrap
1115 (name "python-testscenarios-bootstrap")
1120 (uri (pypi-uri "testscenarios" version))
1123 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
1124 (build-system python-build-system)
1126 `(#:phases (modify-phases %standard-phases
1129 (invoke "python" "-m" "testtools.run"
1130 "testscenarios.test_suite"))))))
1132 `(("python-pbr" ,python-pbr-minimal)
1133 ("python-testtools" ,python-testtools-bootstrap)))
1134 (home-page "https://launchpad.net/testscenarios")
1135 (synopsis "Pyunit extension for dependency injection")
1137 "This package is only for bootstrapping. Don't use this.")
1138 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1140 (define-public python2-testscenarios-bootstrap
1141 (package-with-python2 python-testscenarios-bootstrap))
1143 (define-public python-testscenarios
1145 (inherit python-testscenarios-bootstrap)
1146 (name "python-testscenarios")
1148 `(("python-pbr" ,python-pbr)
1149 ("python-testtools" ,python-testtools)))
1151 "Testscenarios provides clean dependency injection for Python unittest
1154 (define-public python2-testscenarios
1155 (package-with-python2 python-testscenarios))
1157 ;; Testresources requires python-pbr at runtime, but pbr needs it for its
1158 ;; own tests. Hence this bootstrap variant.
1159 (define-public python-testresources-bootstrap
1161 (name "python-testresources-bootstrap")
1165 (uri (pypi-uri "testresources" version))
1168 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
1169 (build-system python-build-system)
1170 (arguments '(#:tests? #f))
1172 `(("python-pbr" ,python-pbr-minimal)))
1173 (home-page "https://launchpad.net/testresources")
1175 "Pyunit extension for managing test resources")
1177 "This package is only here for bootstrapping purposes. Use the regular
1178 testresources package instead.")
1179 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1181 (define-public python2-testresources-bootstrap
1182 (package-with-python2 python-testresources-bootstrap))
1184 (define-public python-testresources
1186 (inherit python-testresources-bootstrap)
1187 (name "python-testresources")
1189 `(("python-pbr" ,python-pbr)))
1192 `(("python-fixtures" ,python-fixtures)
1193 ("python-testtols" ,python-testtools)))
1195 "Testresources is an extension to Python's unittest to allow declarative
1196 use of resources by test cases.")))
1198 (define-public python2-testresources
1199 (package-with-python2 python-testresources))
1201 (define-public python-subunit-bootstrap
1203 (name "python-subunit-bootstrap")
1208 (uri (pypi-uri "python-subunit" version))
1211 "1fsw8rsn1s3nklx06mayrg5rn2zbky6wwjc5z07s7rf1wjzfs1wn"))))
1212 (build-system python-build-system)
1214 `(("python-extras" ,python-extras)
1215 ("python-testtools" ,python-testtools-bootstrap)))
1217 `(("python-fixtures" ,python-fixtures-bootstrap)
1218 ("python-hypothesis" ,python-hypothesis)
1219 ("python-testscenarios" ,python-testscenarios-bootstrap)))
1220 (home-page "https://launchpad.net/subunit")
1221 (synopsis "Python implementation of the subunit protocol")
1223 "This package is here for bootstrapping purposes only. Use the regular
1224 python-subunit package instead.")
1225 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1227 (define-public python2-subunit-bootstrap
1228 (package-with-python2 python-subunit-bootstrap))
1230 (define-public python-subunit
1232 (inherit python-subunit-bootstrap)
1233 (name "python-subunit")
1235 `(("python-extras" ,python-extras)
1236 ("python-testtools" ,python-testtools)))
1238 `(("python-fixtures" ,python-fixtures)
1239 ("python-hypothesis" ,python-hypothesis)
1240 ("python-testscenarios" ,python-testscenarios)))
1242 "Python-subunit is a Python implementation of the subunit test streaming
1245 (define-public python2-subunit
1246 (package-with-python2 python-subunit))
1248 ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
1249 ;; own tests. Hence this bootstrap variant.
1250 (define-public python-fixtures-bootstrap
1252 (name "python-fixtures-bootstrap")
1256 (uri (pypi-uri "fixtures" version))
1259 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
1260 (build-system python-build-system)
1261 (arguments `(#:tests? #f))
1263 `(("python-pbr-minimal" ,python-pbr-minimal)
1264 ("python-six" ,python-six)))
1265 (home-page "https://launchpad.net/python-fixtures")
1266 (synopsis "Python test fixture library")
1268 "This package is only used for bootstrapping. Use the regular
1269 python-fixtures package instead.")
1270 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1272 (define-public python2-fixtures-bootstrap
1273 (package-with-python2 python-fixtures-bootstrap))
1275 (define-public python-fixtures
1277 (inherit python-fixtures-bootstrap)
1278 (name "python-fixtures")
1281 (modify-phases %standard-phases
1284 (invoke "python" "-m" "testtools.run"
1285 "fixtures.test_suite"))))))
1287 ;; Fixtures uses pbr at runtime to check versions, etc.
1288 `(("python-pbr" ,python-pbr)
1289 ("python-six" ,python-six)))
1291 `(("python-mock" ,python-mock)
1292 ("python-testtools" ,python-testtools-bootstrap)))
1294 "Fixtures provides a way to create reusable state, useful when writing
1297 (define-public python2-fixtures
1298 (package-with-python2 python-fixtures))
1300 (define-public python-testrepository-bootstrap
1302 (name "python-testrepository-bootstrap")
1307 (uri (pypi-uri "testrepository" version))
1310 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1311 (build-system python-build-system)
1312 (arguments '(#:tests? #f))
1314 `(("python-fixtures" ,python-fixtures-bootstrap)
1315 ("python-subunit" ,python-subunit-bootstrap)
1316 ("python-testtools" ,python-testtools-bootstrap)))
1318 `(("python-mimeparse" ,python-mimeparse)))
1319 (home-page "https://launchpad.net/testrepository")
1320 (synopsis "Database for Python test results")
1322 "Bootstrap package for python-testrepository. Don't use this.")
1323 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1325 (define-public python2-testrepository-bootstrap
1326 (package-with-python2 python-testrepository-bootstrap))
1328 (define-public python-testrepository
1330 (inherit python-testrepository-bootstrap)
1331 (name "python-testrepository")
1333 ;; FIXME: Many tests are failing.
1336 `(("python-fixtures" ,python-fixtures)
1337 ("python-subunit" ,python-subunit)
1338 ("python-testtools" ,python-testtools)))
1340 `(("python-mimeparse" ,python-mimeparse)))
1341 (description "Testrepository provides a database of test results which can
1342 be used as part of a developer's workflow to check things such as what tests
1343 have failed since the last commit or what tests are currently failing.")))
1345 (define-public python2-testrepository
1346 (package-with-python2 python-testrepository))
1348 (define-public python-coverage
1350 (name "python-coverage")
1355 (uri (pypi-uri "coverage" version))
1358 "02f6m073qdispn96rc616hg0rnmw1pgqzw3bgxwiwza4zf9hirlx"))))
1359 (build-system python-build-system)
1361 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1363 (home-page "http://nedbatchelder.com/code/coverage")
1364 (synopsis "Code coverage measurement for Python")
1366 "Coverage measures code coverage, typically during test execution. It
1367 uses the code analysis tools and tracing hooks provided in the Python standard
1368 library to determine which lines are executable, and which have been
1370 (license license:bsd-3)))
1372 (define-public python2-coverage
1373 (package-with-python2 python-coverage))
1375 (define-public python-cov-core
1377 (name "python-cov-core")
1382 (uri (pypi-uri "cov-core" version))
1385 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1386 (build-system python-build-system)
1388 `(("python-coverage" ,python-coverage)))
1389 (home-page "https://github.com/schlamar/cov-core")
1390 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
1392 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1393 and @code{nose2-cov}. It is useful for developing coverage plugins for these
1394 testing frameworks.")
1395 (license license:expat)))
1397 (define-public python2-cov-core
1398 (package-with-python2 python-cov-core))
1400 (define-public python-codecov
1402 (name "python-codecov")
1407 (uri (pypi-uri "codecov" version))
1410 "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1411 (build-system python-build-system)
1413 `(("python-unittest2" ,python-unittest2)))
1415 `(("python-coverage" ,python-coverage)
1416 ("python-requests" ,python-requests)))
1417 (home-page "http://github.com/codecov/codecov-python")
1418 (synopsis "Upload code coverage reports to @code{codecov.io}")
1420 "Codecov collects code coverage reports from code written in Python, Java,
1421 C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
1422 (license license:asl2.0)))
1424 (define-public python-testpath
1426 (name "python-testpath")
1432 (url "https://github.com/jupyter/testpath")
1434 (file-name (git-file-name name version))
1437 "0r4iiizjql6ny1ln7ciw7rrbjadz1s9zrf2hl0xkgnh3ypd8936f"))))
1438 (build-system python-build-system)
1440 `(#:tests? #f ; this package does not even have a setup.py
1441 #:modules ((guix build python-build-system)
1445 (modify-phases %standard-phases
1448 (lambda* (#:key inputs outputs #:allow-other-keys)
1449 (let* ((version (last
1450 (string-split (assoc-ref inputs "python") #\-)))
1451 (x.y (string-join (take (string-split version #\.) 2)
1454 (assoc-ref outputs "out")
1455 "/lib/python" x.y "/site-packages/testpath")))
1457 (copy-recursively "testpath" dir))
1459 (home-page "https://github.com/takluyver/testpath")
1460 (synopsis "Test utilities for code working with files and commands")
1462 "Testpath is a collection of utilities for Python code working with files
1463 and commands. It contains functions to check things on the file system, and
1464 tools for mocking system commands and recording calls to those.")
1465 (license license:expat)))
1467 (define-public python2-testpath
1468 (package-with-python2 python-testpath))
1470 (define-public python-testlib
1472 (name "python-testlib")
1477 (uri (pypi-uri "testlib" version ".zip"))
1479 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1480 (build-system python-build-system)
1482 `(("unzip" ,unzip))) ; for unpacking the source
1483 (synopsis "Python micro test suite harness")
1484 (description "A micro unittest suite harness for Python.")
1485 (home-page "https://github.com/trentm/testlib")
1486 (license license:expat)))
1488 (define-public python2-testlib
1489 (package-with-python2 python-testlib))
1491 ;;; The software provided by this package was integrated into pytest 2.8.
1492 (define-public python-pytest-cache
1494 (name "python-pytest-cache")
1498 (uri (pypi-uri "pytest-cache" version))
1501 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1502 (build-system python-build-system)
1504 `(("python-apipkg" ,python-apipkg)
1505 ("python-execnet" ,python-execnet)
1506 ("python-py" ,python-py)
1507 ("python-pytest" ,python-pytest)))
1508 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1509 (description "The pytest-cache plugin provides tools to rerun failures from
1510 the last py.test invocation.")
1511 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1512 (license license:expat)))
1514 (define-public python2-pytest-cache
1515 (package-with-python2 python-pytest-cache))
1517 (define-public python-pytest-localserver
1519 (name "python-pytest-localserver")
1523 (uri (pypi-uri "pytest-localserver" version))
1526 "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
1527 (build-system python-build-system)
1530 (modify-phases %standard-phases
1533 (invoke "py.test" "-v"))))))
1535 `(("python-pytest" ,python-pytest)
1536 ("python-requests" ,python-requests)
1537 ("python-six" ,python-six)))
1539 `(("python-werkzeug" ,python-werkzeug)))
1540 (synopsis "Py.test plugin to test server connections locally")
1541 (description "Pytest-localserver is a plugin for the pytest testing
1542 framework which enables you to test server connections locally.")
1543 (home-page "https://pypi.org/project/pytest-localserver/")
1544 (license license:expat)))
1546 (define-public python-pytest-xprocess
1548 (name "python-pytest-xprocess")
1552 (uri (pypi-uri "pytest-xprocess" version))
1555 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1556 (build-system python-build-system)
1558 `(("python-pytest" ,python-pytest)
1559 ("python-pytest-cache" ,python-pytest-cache)
1560 ("python-psutil" ,python-psutil)))
1561 (synopsis "Pytest plugin to manage external processes across test runs")
1562 (description "Pytest-xprocess is an experimental py.test plugin for managing
1563 processes across test runs.")
1564 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1565 (license license:expat)))
1567 (define-public python-pytest-subtesthack
1569 (name "python-pytest-subtesthack")
1573 (uri (pypi-uri "pytest-subtesthack" version))
1576 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1577 (build-system python-build-system)
1579 `(("python-pytest" ,python-pytest)))
1580 (synopsis "Set-up and tear-down fixtures for unit tests")
1581 (description "This plugin allows you to set up and tear down fixtures within
1582 unit test functions that use @code{py.test}. This is useful for using
1583 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1584 function multiple times, without setting up or tearing down fixture state as is
1585 normally the case.")
1586 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1587 (license license:unlicense)))
1589 (define-public python2-pytest-subtesthack
1590 (package-with-python2 python-pytest-subtesthack))
1592 (define-public python-pytest-sugar
1594 (name "python-pytest-sugar")
1599 (uri (pypi-uri "pytest-sugar" version))
1602 "1asq7yc4g8bx2sn7yy974mhc9ywvaihasjab4inkirdwn9s7mn7w"))))
1603 (build-system python-build-system)
1605 `(("python-packaging" ,python-packaging)
1606 ("python-pytest" ,python-pytest)
1607 ("python-termcolor" ,python-termcolor)))
1608 (home-page "https://pivotfinland.com/pytest-sugar/")
1609 (synopsis "Plugin for pytest that changes the default look and feel")
1611 "@code{pytest-sugar} is a plugin for py.test that changes the default
1612 look and feel of py.test, using a progress bar and showing failures and errors
1614 (license license:bsd-3)))
1616 (define-public python-hypothesis
1618 (name "python-hypothesis")
1622 (uri (pypi-uri "hypothesis" version))
1625 "0a35nwqyjnm4cphi43xracqpkws0ip61mndvqb1iqq7gkva83lb1"))))
1626 (build-system python-build-system)
1628 `(("python-flake8" ,python-flake8)
1629 ("python-pytest" ,python-pytest-bootstrap)))
1631 `(("python-attrs" ,python-attrs-bootstrap)
1632 ("python-coverage" ,python-coverage)))
1633 (synopsis "Library for property based testing")
1634 (description "Hypothesis is a library for testing your Python code against a
1635 much larger range of examples than you would ever want to write by hand. It’s
1636 based on the Haskell library, Quickcheck, and is designed to integrate
1637 seamlessly into your existing Python unit testing work flow.")
1638 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
1639 (license license:mpl2.0)
1640 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1642 (define-public python2-hypothesis
1643 (let ((hypothesis (package-with-python2
1644 (strip-python2-variant python-hypothesis))))
1645 (package (inherit hypothesis)
1647 `(("python2-enum34" ,python2-enum34)
1648 ,@(package-propagated-inputs hypothesis))))))
1650 (define-public python-lit
1657 (uri (pypi-uri "lit" version))
1660 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
1661 (build-system python-build-system)
1664 (modify-phases %standard-phases
1667 (invoke "python" "lit.py" "tests"))))))
1670 (home-page "https://llvm.org/")
1671 (synopsis "LLVM Software Testing Tool")
1672 (description "@code{lit} is a portable tool for executing LLVM and Clang
1673 style test suites, summarizing their results, and providing indication of
1675 (license license:ncsa)))
1677 (define-public python2-lit
1678 (package-with-python2 python-lit))
1680 (define-public python-pytest-pep8
1682 (name "python-pytest-pep8")
1686 (uri (pypi-uri "pytest-pep8" version))
1689 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
1690 (build-system python-build-system)
1692 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
1694 `(("python-pytest" ,python-pytest)))
1696 `(("python-pep8" ,python-pep8)))
1697 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
1698 (synopsis "Py.test plugin to check PEP8 requirements")
1699 (description "Pytest plugin for checking PEP8 compliance.")
1700 (license license:expat)))
1702 (define-public python2-pytest-pep8
1703 (package-with-python2 python-pytest-pep8))
1705 (define-public python-pytest-flakes
1707 (name "python-pytest-flakes")
1711 (uri (pypi-uri "pytest-flakes" version))
1714 "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
1715 (build-system python-build-system)
1718 (modify-phases %standard-phases
1720 (add-after 'install 'check
1721 (lambda* (#:key outputs inputs #:allow-other-keys)
1722 ;; It's easier to run tests after install.
1723 ;; Make installed package available for running the tests
1724 (add-installed-pythonpath inputs outputs)
1725 (invoke "py.test" "-vv"))))))
1727 `(("python-coverage" ,python-coverage)
1728 ("python-pytest" ,python-pytest)
1729 ("python-pytest-cache" ,python-pytest-cache)
1730 ("python-pytest-pep8" ,python-pytest-pep8)))
1732 `(("python-pyflakes" ,python-pyflakes)))
1733 (home-page "https://github.com/fschulze/pytest-flakes")
1734 (synopsis "Py.test plugin to check source code with pyflakes")
1735 (description "Pytest plugin for checking Python source code with pyflakes.")
1736 (license license:expat)))
1738 (define-public python2-pytest-flakes
1739 (package-with-python2 python-pytest-flakes))
1741 (define-public python2-coverage-test-runner
1743 (name "python2-coverage-test-runner")
1749 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
1750 "coverage-test-runner/snapshot/coverage-test-runner-"
1754 "1kjjb9llckycnfxag8zcvqsn4z1s3dwyw6b1n0avxydihgf30rny"))))
1755 (build-system python-build-system)
1757 `(#:python ,python-2
1759 (modify-phases %standard-phases
1762 (invoke "./testrun"))))))
1764 `(("python2-coverage" ,python2-coverage)))
1765 (home-page "https://liw.fi/coverage-test-runner/")
1766 (synopsis "Python module for running unit tests")
1767 (description "@code{CoverageTestRunner} is a python module for running
1768 unit tests and failing them if the unit test module does not exercise all
1769 statements in the module it tests.")
1770 (license license:gpl3+)))
1772 ;; Further releases, up to 2.4.3, have failing unit tests. See:
1773 ;; https://github.com/PyCQA/pylint/issues/3198.
1774 (define-public python-pylint
1776 (name "python-pylint")
1782 (url "https://github.com/PyCQA/pylint")
1783 (commit (string-append "pylint-" version))))
1784 (file-name (git-file-name name version))
1787 "17vvzbcqmkhr4icq5p3737nbiiyj1y3g1pa08n9mb1bsnvxmqq0z"))))
1788 (build-system python-build-system)
1790 `(("python-pytest" ,python-pytest)
1791 ("python-pytest-runner" ,python-pytest-runner)
1792 ("python-tox" ,python-tox)))
1794 `(("python-astroid" ,python-astroid)
1795 ("python-isort" ,python-isort)
1796 ("python-mccabe" ,python-mccabe)
1797 ("python-six" ,python-six)))
1798 (home-page "https://github.com/PyCQA/pylint")
1799 (synopsis "Python source code analyzer which looks for coding standard
1801 (description "Pylint is a Python source code analyzer which looks
1802 for programming errors, helps enforcing a coding standard and sniffs
1803 for some code smells (as defined in Martin Fowler's Refactoring book).
1805 Pylint has many rules enabled by default, way too much to silence them
1806 all on a minimally sized program. It's highly configurable and handle
1807 pragmas to control it from within your code. Additionally, it is
1808 possible to write plugins to add your own checks.")
1809 (properties `((python2-variant . ,(delay python2-pylint))))
1810 (license license:gpl2+)))
1812 ;; Python2 is not supported anymore by Pylint. See:
1813 ;; https://github.com/PyCQA/pylint/issues/1763.
1814 (define-public python2-pylint
1815 (let ((pylint (package-with-python2
1816 (strip-python2-variant python-pylint))))
1817 (package (inherit pylint)
1823 (url "https://github.com/PyCQA/pylint")
1824 (commit (string-append "pylint-" version))))
1825 (file-name (git-file-name (package-name pylint) version))
1828 "02a89d8a47s7nfiv1ady3j0sg2sbyja3np145brarfp5x9qxz9x2"))))
1830 `(,@(package-arguments pylint)
1832 (modify-phases %standard-phases
1835 ;; Somehow, tests fail if run from the build directory.
1836 (let ((work "/tmp/work"))
1838 (setenv "PYTHONPATH"
1839 (string-append (getenv "PYTHONPATH") ":" work))
1840 (copy-recursively "." work)
1841 (with-directory-excursion "/tmp"
1842 (invoke "python" "-m" "unittest" "discover"
1843 "-s" (string-append work "/pylint/test")
1844 "-p" "*test_*.py"))))))))
1846 `(("python2-futures" ,python2-futures)
1847 ,@(package-native-inputs pylint)))
1849 `(("python2-backports-functools-lru-cache"
1850 ,python2-backports-functools-lru-cache)
1851 ("python2-configparser" ,python2-configparser)
1852 ,@(package-propagated-inputs pylint))))))
1854 (define-public python-paramunittest
1856 (name "python-paramunittest")
1861 (uri (pypi-uri "ParamUnittest" version))
1864 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
1865 (build-system python-build-system)
1867 "https://github.com/rik0/ParamUnittest")
1869 "Simple extension to have parametrized unit tests")
1871 "This package allows to create parametrized unit-tests that work with the standard
1872 unittest package. A parametrized test case is automatically converted to multiple test
1873 cases. Since they are TestCase subclasses, they work with other test suites that
1874 recognize TestCases.")
1875 (license license:bsd-2)))
1877 (define-public python2-python-paramunittest
1878 (package-with-python2 python-paramunittest))
1880 (define-public python-pytest-warnings
1882 (name "python-pytest-warnings")
1887 (uri (pypi-uri "pytest-warnings" version))
1890 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
1891 (build-system python-build-system)
1893 `(("pytest" ,python-pytest)))
1894 (home-page "https://github.com/fschulze/pytest-warnings")
1895 (synopsis "Pytest plugin to list Python warnings in pytest report")
1897 "Python-pytest-warnings is a pytest plugin to list Python warnings in
1899 (license license:expat)
1900 (properties `((python2-variant . ,(delay python2-pytest-warnings))
1901 ;; This package is part of pytest as of version 3.1.0.
1902 (superseded . ,python-pytest)))))
1904 (define-public python2-pytest-warnings
1905 (package (inherit (package-with-python2
1906 (strip-python2-variant python-pytest-warnings)))
1907 (properties `((superseded . ,python2-pytest)))))
1909 (define-public python-pytest-capturelog
1911 (name "python-pytest-capturelog")
1916 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
1919 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
1920 (build-system python-build-system)
1922 `(("pytest" ,python-pytest)))
1923 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
1924 (synopsis "Pytest plugin to catch log messages")
1926 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
1927 (license license:expat)))
1929 (define-public python2-pytest-capturelog
1930 (package-with-python2 python-pytest-capturelog))
1932 (define-public python-pytest-catchlog
1934 (name "python-pytest-catchlog")
1939 (uri (pypi-uri "pytest-catchlog" version ".zip"))
1942 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
1943 (build-system python-build-system)
1945 `(("unzip" ,unzip)))
1947 `(("pytest" ,python-pytest)))
1948 (home-page "https://github.com/eisensheng/pytest-catchlog")
1949 (synopsis "Pytest plugin to catch log messages")
1951 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
1952 a fork of pytest-capturelog.")
1953 (license license:expat)))
1955 (define-public python2-pytest-catchlog
1956 (package-with-python2 python-pytest-catchlog))
1958 (define-public python-nosexcover
1960 (name "python-nosexcover")
1964 (uri (pypi-uri "nosexcover" version))
1967 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
1968 (build-system python-build-system)
1970 `(("python-coverage" ,python-coverage)
1971 ("python-nose" ,python-nose)))
1972 (home-page "http://github.com/cmheisel/nose-xcover")
1973 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
1974 (description "Nose-xcover is a companion to the built-in
1975 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
1976 to a file named coverage.xml.
1978 It will honor all the options you pass to the Nose coverage plugin,
1979 especially -cover-package.")
1980 (license license:expat)))
1982 (define-public python2-nosexcover
1983 (package-with-python2 python-nosexcover))
1985 (define-public python-discover
1987 (name "python-discover")
1992 (uri (pypi-uri "discover" version))
1995 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
1996 (build-system python-build-system)
1997 (home-page "https://pypi.org/project/discover/")
1999 "Python test discovery for unittest")
2001 "Discover provides test discovery for unittest, a feature that has been
2002 backported from Python 2.7 for Python 2.4+.")
2003 (license license:bsd-3)))
2005 (define-public python2-discover
2006 (package-with-python2 python-discover))
2008 (define-public behave
2014 (uri (pypi-uri "behave" version))
2017 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))))
2018 (build-system python-build-system)
2020 `(("python-mock" ,python-mock)
2021 ("python-nose" ,python-nose)
2022 ("python-pathpy" ,python-pathpy)
2023 ("python-pyhamcrest" ,python-pyhamcrest)
2024 ("python-pytest" ,python-pytest)))
2026 `(("python-importlib-metadata" ,python-importlib-metadata)
2027 ("python-six" ,python-six)
2028 ("python-parse" ,python-parse)
2029 ("python-parse-type" ,python-parse-type)))
2031 '(#:test-target "behave_test"
2033 (modify-phases %standard-phases
2034 (add-before 'check 'fix-library-loading
2036 ;; Otherwise, tests fail with no module named 'path'
2037 (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH") ":"
2038 (getcwd) "/tasks/_vendor"))
2040 (home-page "https://github.com/behave/behave")
2041 (synopsis "Python behavior-driven development")
2043 "Behave is a tool for behavior-driven development in python.
2044 Behavior-driven development (or BDD) is an agile software development
2045 technique that encourages collaboration between developers, QA and
2046 non-technical or business participants in a software project. Behave uses
2047 tests written in a natural language style, backed up by Python code.")
2048 (license license:x11)))
2050 (define-public python-behave-web-api
2052 (name "python-behave-web-api")
2057 (uri (pypi-uri "behave-web-api" version))
2060 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
2061 (build-system python-build-system)
2064 (modify-phases %standard-phases
2065 (add-after 'unpack 'fix-dependencies
2067 (substitute* "setup.py"
2068 (("'wheel'") "") ; We don't use it.
2069 (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
2072 `(("behave" ,behave)
2073 ("python-requests" ,python-requests)))
2074 (home-page "https://github.com/jefersondaniel/behave-web-api")
2075 (synopsis "Provides testing for JSON APIs with Behave for Python")
2076 (description "This package provides testing utility modules for testing
2077 JSON APIs with Behave.")
2078 (license license:expat)))
2080 (define-public python2-behave-web-api
2081 (package-with-python2 python-behave-web-api))
2083 (define-public python-rednose
2085 (name "python-rednose")
2090 (uri (pypi-uri "rednose" version))
2093 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
2094 (build-system python-build-system)
2096 `(#:phases (modify-phases %standard-phases
2097 (add-after 'unpack 'patch-setup.py
2099 ;; Six is only required for tests and later versions
2101 (substitute* "setup.py"
2102 (("six==1.10.0") "six"))
2105 `(("python-colorama" ,python-colorama)
2106 ("python-termstyle" ,python-termstyle)))
2108 `(("python-six" ,python-six)
2109 ("python-nose" ,python-nose)))
2110 (home-page "https://github.com/JBKahn/rednose")
2111 (synopsis "Colored output for Python nosetests")
2112 (description "This package provides colored output for the
2113 @command{nosetests} command of the Python Nose unit test framework.")
2114 (license license:bsd-3)))
2116 (define-public python2-rednose
2117 (package-with-python2 python-rednose))
2119 (define-public python-nose-random
2121 (name "python-nose-random")
2127 (url "https://github.com/fzumstein/nose-random")
2129 (file-name (git-file-name name version))
2132 "1dvip61r2frjv35mv6mmfjc07402z73pjbndfp3mhxyjn2zhksw2"))))
2133 (build-system python-build-system)
2135 `(("python-nose" ,python-nose)))
2136 (home-page "https://github.com/fzumstein/nose-random")
2137 (synopsis "Nose plugin to facilitate randomized unit testing with
2139 (description "Python nose-random is designed to facilitate
2140 Monte-Carlo style unit testing. The idea is to improve testing by
2141 running your code against a large number of randomly generated input
2143 (license license:expat)))
2145 (define-public python-nose-randomly
2147 (name "python-nose-randomly")
2152 (uri (pypi-uri "nose-randomly" version))
2154 (base32 "0z662rqhfk4bjmg806mn4frb8nz4gbh7mrddsrhfffp1g4yklj3y"))))
2155 (build-system python-build-system)
2157 `(("python-nose" ,python-nose)
2158 ("python-numpy" ,python-numpy)))
2159 (home-page "https://github.com/adamchainz/nose-randomly")
2161 "Nose plugin to randomly order tests and control random.seed")
2163 "This is a @code{Nose} plugin to randomly order tests which can be quite
2164 powerful in discovering hidden flaws in the tests themselves, while helping to
2165 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
2166 by resetting it to a repeatable number for each test, enabling the tests to
2167 create data based on random numbers and yet remain repeatable.")
2168 (license license:bsd-3)))
2170 (define-public python2-nose-randomly
2171 (package-with-python2 python-nose-randomly))
2173 (define-public python-nose-timer
2175 (name "python-nose-timer")
2180 (uri (pypi-uri "nose-timer" version))
2182 (base32 "05wzkc88vbzw62pqkvhl33211b90kns0lny70b7qw62rcg4flzk4"))))
2183 (build-system python-build-system)
2185 `(("python-nose" ,python-nose)
2186 ("python-termcolor" ,python-termcolor)))
2187 (home-page "https://github.com/mahmoudimus/nose-timer")
2188 (synopsis "Timer plugin for nosetests")
2189 (description "Shows how much time was needed to run individual tests.")
2190 (license license:expat)))
2192 (define-public python2-nose-timer
2193 (package-with-python2 python-nose-timer))
2195 (define-public python-freezegun
2197 (name "python-freezegun")
2202 (uri (pypi-uri "freezegun" version))
2204 (base32 "1rx57v8ryjncjimg8hys9kx1r3rknvwcl4y340g20jn0sf69qk9a"))))
2205 (build-system python-build-system)
2207 `(("python-mock" ,python-mock)
2208 ("python-pytest" ,python-pytest)))
2210 `(("python-six" ,python-six)
2211 ("python-dateutil" ,python-dateutil)))
2214 (modify-phases %standard-phases
2215 ;; The tests are normally executed via `make test`, but the PyPi
2216 ;; package does not include the Makefile.
2219 (invoke "pytest" "-vv"))))))
2220 (home-page "https://github.com/spulec/freezegun")
2221 (synopsis "Test utility for mocking the datetime module")
2223 "FreezeGun is a library that allows your python tests to travel through
2224 time by mocking the datetime module.")
2225 (license license:asl2.0)))
2227 (define-public python2-freezegun
2228 (package-with-python2 python-freezegun))
2230 (define-public python-flexmock
2232 (name "python-flexmock")
2236 (uri (pypi-uri "flexmock" version))
2239 "0b6qw3grhgx58kxlkj7mdma7xdvlj02zabvcf7w2qifnfjwwwcsh"))))
2240 (build-system python-build-system)
2241 (home-page "https://flexmock.readthedocs.org")
2242 (synopsis "Testing library for Python")
2244 "flexmock is a testing library for Python that makes it easy to create
2245 mocks, stubs and fakes.")
2246 (license license:bsd-3)))
2248 (define-public python2-flexmock
2249 (package-with-python2 python-flexmock))
2251 (define-public python-flaky
2253 (name "python-flaky")
2257 (uri (pypi-uri "flaky" version))
2260 "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j"))))
2261 (build-system python-build-system)
2263 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2265 (home-page "https://github.com/box/flaky")
2266 (synopsis "Automatically rerun flaky tests")
2268 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2271 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2272 on components that aren't 100% reliable. With flaky, instead of removing
2273 those tests or marking them to @code{@@skip}, they can be automatically
2275 (license license:asl2.0)))
2277 (define-public python2-flaky
2278 (package-with-python2 python-flaky))
2280 (define-public python-pyhamcrest
2281 ;; The latest release was in 2016 and its test suite does not work with recent
2282 ;; versions of Pytest. Just take the master branch for now, which seems stable.
2283 (let ((commit "25fdc5f00bdf3084335353bc9247253098ec4cf2")
2286 (name "python-pyhamcrest")
2287 (version (git-version "1.9.0" revision commit))
2289 ;; Tests not distributed from pypi release.
2292 (url "https://github.com/hamcrest/PyHamcrest")
2294 (file-name (git-file-name name version))
2297 "1miqmhhi68vaix8sqc1lvpvbm27bacffxh5anm5cbfsvk7g9n6f3"))))
2298 (native-inputs ;all native inputs are for tests
2299 `(("python-pytest-cov" ,python-pytest-cov)
2300 ("python-mock" ,python-mock)
2301 ("python-pytest" ,python-pytest)
2302 ("python-hypothesis" ,python-hypothesis)))
2304 `(("python-six" ,python-six)))
2305 (build-system python-build-system)
2307 `(#:phases (modify-phases %standard-phases
2310 (setenv "PYTHONPATH"
2311 (string-append "build/lib:"
2312 (getenv "PYTHONPATH")))
2313 (invoke "pytest" "-vv"))))))
2314 (home-page "http://hamcrest.org/")
2315 (synopsis "Hamcrest matchers for Python")
2317 "PyHamcrest is a framework for writing matcher objects,
2318 allowing you to declaratively define \"match\" rules.")
2319 (license license:bsd-3))))
2321 (define-public python2-pyhamcrest
2322 (package-with-python2 python-pyhamcrest))
2324 (define-public unittest-cpp
2326 (name "unittest-cpp")
2331 (url "https://github.com/unittest-cpp/unittest-cpp")
2332 (commit (string-append "v" version))))
2333 (file-name (git-file-name name version))
2335 (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
2337 `(#:tests? #f)) ; It's run after build automatically.
2338 (build-system cmake-build-system)
2339 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2340 (synopsis "Lightweight unit testing framework for C++")
2341 (description "UnitTest++ is a lightweight unit testing framework for C++.
2342 It was designed to do test-driven development on a wide variety of platforms.
2343 Simplicity, portability, speed, and small footprint are all very important
2344 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2345 of advanced library and language features, which means it should be easily
2346 portable to just about any platform.")
2347 (license license:expat)))
2349 (define-public libfaketime
2351 (name "libfaketime")
2353 (home-page "https://github.com/wolfcw/libfaketime")
2358 (commit (string-append "v" version))))
2361 "1mfdl82ppgbdvy1ny8mb7xii7p0g7awvn4bn36jb8v4r545slmjc"))
2362 (file-name (git-file-name name version))))
2363 (build-system gnu-build-system)
2365 '(#:phases (modify-phases %standard-phases
2367 (lambda* (#:key outputs #:allow-other-keys)
2368 (let ((out (assoc-ref outputs "out")))
2370 (setenv "PREFIX" out)
2372 (add-before 'check 'pre-check
2374 (substitute* "test/functests/test_exclude_mono.sh"
2375 (("/bin/bash") (which "bash")))
2377 #:test-target "test"))
2379 `(("perl" ,perl))) ;for tests
2380 (synopsis "Fake the system time for single applications")
2382 "The libfaketime library allows users to modify the system time that an
2383 application \"sees\". It is meant to be loaded using the dynamic linker's
2384 @code{LD_PRELOAD} environment variable. The @command{faketime} command
2385 provides a simple way to achieve this.")
2386 (license license:gpl2)))
2388 (define-public umockdev
2394 (uri (string-append "https://github.com/martinpitt/umockdev/"
2395 "releases/download/" version "/"
2396 "umockdev-" version ".tar.xz"))
2399 "095v3abc321s584sga04y16lcmdzsdi88h24wcrm78v7vq484g74"))))
2400 (build-system gnu-build-system)
2403 (modify-phases %standard-phases
2404 (add-after 'unpack 'skip-broken-test
2406 (substitute* "tests/test-umockdev.c"
2407 (("/\\* sys/ in other dir")
2408 (string-append "return; // ")))
2412 ("gtk-doc" ,gtk-doc)
2413 ("pkg-config" ,pkg-config)
2421 ("libgudev" ,libgudev)
2422 ("gobject-introspection" ,gobject-introspection)))
2423 (home-page "https://github.com/martinpitt/umockdev/")
2424 (synopsis "Mock hardware devices for creating unit tests")
2425 (description "umockdev mocks hardware devices for creating integration
2426 tests for hardware related libraries and programs. It also provides tools to
2427 record the properties and behaviour of particular devices, and to run a
2428 program or test suite under a test bed with the previously recorded devices
2430 (license license:lgpl2.1+)))
2432 (define-public virtest
2433 ;; No releases yet, so we take the commit that "vc" expects.
2434 (let ((commit "f7d03ef39fceba168745bd29e1b20af6e7971e04")
2438 (version (git-version "0.0" revision commit))
2439 (home-page "https://github.com/mattkretz/virtest")
2442 (uri (git-reference (url home-page) (commit commit)))
2443 (file-name (git-file-name name version))
2446 "07pjyb0mk7y2w1dg1bhl26nb7416xa1mw16ifj6mmps5y6aq054l"))))
2447 (build-system cmake-build-system)
2449 `(#:phases (modify-phases %standard-phases
2450 (add-after 'unpack 'adjust-install-directory
2452 ;; Vc is the only consumer of this library, and expects
2453 ;; to find it in "virtest/vir/" instead of "vir/vir/".
2454 (substitute* "CMakeLists.txt"
2455 (("DESTINATION include/vir")
2456 "DESTINATION include/virtest"))
2458 (synopsis "Header-only test framework")
2460 "@code{virtest} is a small header-only test framework for C++. It
2461 grew out of the @dfn{Vc} project.")
2462 (license license:bsd-3))))
2464 (define-public python-pyfakefs
2466 (name "python-pyfakefs")
2470 ;; We use the PyPI URL because there is no proper release
2471 ;; available from GitHub. The GitHub project only provides
2472 ;; autogenerated tarballs, which are known to change in place.
2473 (uri (pypi-uri "pyfakefs" version))
2476 "1cp2yw96fa2qkgi39xa3nlr3inf8wb5rgh9kdq53256ca2r8pdhy"))
2477 (patches (search-patches
2478 "python-pyfakefs-remove-bad-test.patch"))
2479 (file-name (string-append name "-" version ".tar.gz"))))
2482 (modify-phases %standard-phases
2483 ;; The default test suite does not run these extra tests.
2484 (add-after 'check 'check-pytest-plugin
2487 "python" "-m" "pytest"
2488 "pyfakefs/pytest_tests/pytest_plugin_test.py")
2491 `(("python-pytest" ,python-pytest)))
2492 (build-system python-build-system)
2493 ;; Guix lint doesn't like that this is a permanent redirect to the GitHub
2494 ;; page, but the pyfakefs documentation asks us to use this specific URL
2495 ;; when linking to the project. Honor their request.
2496 (home-page "http://pyfakefs.org/")
2497 ;; TRANSLATORS: In the synopsis, "Mock" is a verb.
2498 (synopsis "Mock file system interactions in tests")
2500 "This package provides a Python library intended for use in automated
2501 tests. One difficulty when testing software is that the code under test might
2502 need to read or write to files in the local file system. If the file system
2503 is not set up in just the right way, it might cause a spurious error during
2504 the test. The pyfakefs library provides a solution to problems like this by
2505 mocking file system interactions. In other words, it arranges for the code
2506 under test to interact with a fake file system instead of the real file
2507 system. The code under test requires no modification to work with pyfakefs.")
2508 (license license:asl2.0)))
2510 (define-public python2-pyfakefs
2511 (package-with-python2 python-pyfakefs))