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 Nikita <nikita@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>
33 ;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org>
34 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
35 ;;; Copyright © 2020 Josh Marshall <joshua.r.marshall.1991@gmail.com>
37 ;;; This file is part of GNU Guix.
39 ;;; GNU Guix is free software; you can redistribute it and/or modify it
40 ;;; under the terms of the GNU General Public License as published by
41 ;;; the Free Software Foundation; either version 3 of the License, or (at
42 ;;; your option) any later version.
44 ;;; GNU Guix is distributed in the hope that it will be useful, but
45 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
46 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
47 ;;; GNU General Public License for more details.
49 ;;; You should have received a copy of the GNU General Public License
50 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
52 (define-module (gnu packages check)
53 #:use-module (gnu packages)
54 #:use-module (gnu packages autotools)
55 #:use-module (gnu packages base)
56 #:use-module (gnu packages bash)
57 #:use-module (gnu packages compression)
58 #:use-module (gnu packages linux)
59 #:use-module (gnu packages llvm)
60 #:use-module (gnu packages glib)
61 #:use-module (gnu packages gnome)
62 #:use-module (gnu packages golang)
63 #:use-module (gnu packages gtk)
64 #:use-module (gnu packages perl)
65 #:use-module (gnu packages pkg-config)
66 #:use-module (gnu packages python)
67 #:use-module (gnu packages python-web)
68 #:use-module (gnu packages python-xyz)
69 #:use-module (gnu packages time)
70 #:use-module (gnu packages xml)
71 #:use-module (guix utils)
72 #:use-module ((guix licenses) #:prefix license:)
73 #:use-module (guix packages)
74 #:use-module (guix download)
75 #:use-module (guix git-download)
76 #:use-module (guix build-system cmake)
77 #:use-module (guix build-system gnu)
78 #:use-module (guix build-system go)
79 #:use-module (guix build-system python)
80 #:use-module (guix build-system trivial))
89 (uri (string-append "https://github.com/libcheck/check/releases/download/"
90 version "/check-" version ".tar.gz"))
93 "02zkfiyklckmivrfvdsrlzvzphkdsgjrz3igncw05dv5pshhq3xx"))))
94 (build-system gnu-build-system)
95 (home-page "https://libcheck.github.io/check/")
96 (synopsis "Unit test framework for C")
98 "Check is a unit testing framework for C. It features a simple
99 interface for defining unit tests, putting little in the way of the
100 developer. Tests are run in a separate address space, so Check can
101 catch both assertion failures and code errors that cause segmentation
102 faults or other signals. The output from unit tests can be used within
103 source code editors and IDEs.")
104 (license license:lgpl2.1+)))
106 ;; Some packages require this older version. Removed once no longer needed.
107 (define-public check-0.12
113 (uri (string-append "https://github.com/libcheck/check/releases"
114 "/download/" version "/check-" version ".tar.gz"))
117 "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6"))))))
126 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
127 version "/CUnit-" version ".tar.bz2"))
130 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
131 (build-system gnu-build-system)
132 (arguments '(#:phases
133 (modify-phases %standard-phases
134 ;; XXX: The "bootstrap" phase detects the "bootstrap"
135 ;; script, but fails to execute it, so we bootstrap
138 (lambda _ (invoke "autoreconf" "-vfi"))))))
140 `(("automake" ,automake)
141 ("autoconf" ,autoconf)
142 ("libtool" ,libtool)))
143 (home-page "http://cunit.sourceforge.net/")
144 (synopsis "Automated testing framework for C")
146 "CUnit is a lightweight system for writing, administering, and running
147 unit tests in C. It provides C programmers with basic testing functionality
148 with a flexible variety of user interfaces.")
149 (license license:gpl2+)))
151 (define-public cppunit
157 (uri (string-append "http://dev-www.libreoffice.org/src/"
158 name "-" version ".tar.gz"))
161 "1027cyfx5gsjkdkaf6c2wnjh68882grw8n672018cj3vs9lrhmix"))))
162 ;; Explicitly link with libdl. This is expected to be done by packages
163 ;; relying on cppunit for their tests. However, not all of them do.
164 ;; If we added the linker flag to such packages, we would pollute all
165 ;; binaries, not only those used for testing.
167 `(#:make-flags '("LDFLAGS=-ldl")))
168 (build-system gnu-build-system)
169 (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
170 (synopsis "Unit testing framework for C++")
171 (description "CppUnit is the C++ port of the famous JUnit framework for
172 unit testing. Test output is in XML for automatic testing and GUI based for
174 (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
176 ;; When dependent packages upgraded to use newer version of catch, this one should
178 (define-public catch-framework
181 (version "1.3.5") ;Sub-minor is the build number
185 (url "https://github.com/philsquared/Catch")
187 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
188 (file-name (string-append name "-" version))
191 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
192 (build-system trivial-build-system)
194 `(#:modules ((guix build utils))
196 (use-modules (guix build utils))
197 (let* ((source (assoc-ref %build-inputs "source"))
198 (output (assoc-ref %outputs "out"))
199 (incdir (string-append output "/include"))
200 (docdir (string-append output "/share/doc/catch-"
202 (for-each mkdir-p (list incdir docdir))
203 (install-file (string-append source
204 "/single_include/catch.hpp")
206 (copy-recursively (string-append source "/docs")
209 (home-page "http://catch-lib.net/")
210 (synopsis "Automated test framework for C++ and Objective-C")
212 "Catch stands for C++ Automated Test Cases in Headers and is a
213 multi-paradigm automated test framework for C++ and Objective-C.")
214 (license license:boost1.0)))
216 (define-public catch-framework2-1
220 (home-page "https://github.com/catchorg/Catch2")
224 (url "https://github.com/catchorg/Catch2")
225 (commit (string-append "v" version))))
226 (file-name (git-file-name name version))
229 "1gdp5wm8khn02g2miz381llw3191k7309qj8s3jd6sasj01rhf23"))))
230 (build-system cmake-build-system)
231 (synopsis "Automated test framework for C++ and Objective-C")
232 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
233 a multi-paradigm automated test framework for C++ and Objective-C.")
234 (license license:boost1.0)))
236 (define-public catch-framework2
240 (home-page "https://github.com/catchorg/Catch2")
244 (url "https://github.com/catchorg/Catch2")
245 (commit (string-append "v" version))))
246 (file-name (git-file-name name version))
249 "14vcckqmbydjsg40ngi6iv999zimysh2l7fmrqj1d7xl990qz233"))))
250 (build-system cmake-build-system)
252 `(("python" ,python-wrapper)))
253 (synopsis "Automated test framework for C++ and Objective-C")
254 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
255 a multi-paradigm automated test framework for C++ and Objective-C.")
256 (license license:boost1.0)))
258 (define-public cmdtest
264 (uri (string-append "http://git.liw.fi/cmdtest/snapshot/"
265 name "-" version ".tar.gz"))
268 "1jmfiyrrqmpvwdb273bkb8hjaf4rwx9njblx29pmr7giyahskwi5"))))
269 (build-system python-build-system)
273 (modify-phases %standard-phases
274 ;; check phase needs to be run before the build phase. If not, the
275 ;; coverage test runner looks for tests for the built source files,
278 (add-before 'build 'check
281 (("/bin/sh") (which "sh")))
282 ;; yarn uses python2-ttystatus to print messages.
283 ;; python2-ttystatus requires /dev/tty which is not present in
284 ;; the build environment. Hence assuming-failure test fails.
285 (delete-file "yarn.tests/assuming-failure.script")
286 (delete-file "yarn.tests/assuming-failure.stdout")
287 (invoke "python" "setup.py" "check"))))))
289 `(("python2-coverage-test-runner" ,python2-coverage-test-runner)))
291 `(("python2-cliapp" ,python2-cliapp)
292 ("python2-markdown" ,python2-markdown)
293 ("python2-ttystatus" ,python2-ttystatus)))
294 (home-page "https://liw.fi/cmdtest/")
295 (synopsis "Black box Unix program tester")
297 "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
298 given a command line and input files, and the expected output, and it verifies
299 that the command line produces the expected output. If not, it reports a
300 problem, and shows the differences.")
301 (license license:gpl3+)))
303 (define-public cmocka
309 (uri (string-append "https://cmocka.org/files/"
310 (version-major+minor version) "/cmocka-"
314 "1dm8pdvkyfa8dsbz9bpq7wwgixjij4sii9bbn5sgvqjm5ljdik7h"))))
315 (build-system cmake-build-system)
317 `(#:tests? #f)) ; no test target
318 (home-page "https://cmocka.org/")
319 (synopsis "Unit testing framework for C")
320 (description "Cmocka is a unit testing framework for C with support for
321 mock objects. It only requires the standard C library, and works with
322 different compilers. Cmocka supports several different message output formats
323 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
325 (license license:asl2.0)))
327 (define-public cppcheck
334 (url "https://github.com/danmar/cppcheck")
336 (file-name (git-file-name name version))
338 (base32 "0h7ir2x0k005fm586dxmaphgv5cyz25k3k4sh02p7zb78gzx398h"))))
339 (build-system cmake-build-system)
341 '(#:configure-flags '("-DBUILD_TESTS=ON")))
342 (home-page "http://cppcheck.sourceforge.net")
343 (synopsis "Static C/C++ code analyzer")
344 (description "Cppcheck is a static code analyzer for C and C++. Unlike
345 C/C++ compilers and many other analysis tools it does not detect syntax errors
346 in the code. Cppcheck primarily detects the types of bugs that the compilers
347 normally do not detect. The goal is to detect only real errors in the code
348 (i.e. have zero false positives).")
349 (license license:gpl3+)))
351 (define-public cxxtest
357 (uri (string-append "mirror://sourceforge/cxxtest/cxxtest/"
358 version "/cxxtest-" version ".tar.gz"))
361 "1n7pbj4z9ivx005hqvivj9ddhq8awynzg6jishfbypf6j7ply58w"))))
362 (build-system python-build-system)
365 (modify-phases %standard-phases
366 (add-after 'unpack 'chdir-to-source
370 (add-after 'install 'install-headers
371 (lambda* (#:key outputs #:allow-other-keys)
372 (let* ((out (assoc-ref outputs "out"))
373 (include-dir (string-append out "/include/cxxtest")))
374 (for-each (lambda (header-file)
375 (install-file header-file include-dir))
376 (find-files "../cxxtest"))
378 (add-after 'install 'install-doc
379 (lambda* (#:key outputs #:allow-other-keys)
380 (let* ((out (assoc-ref outputs "out"))
381 (doc-dir (string-append out "/share/doc/cxxtest")))
382 (install-file "../README" doc-dir)
383 (install-file "../doc/guide.txt" doc-dir)
384 (copy-recursively "../sample" (string-append doc-dir "/sample"))
387 `(("python-ply" ,python-ply)))
388 (home-page "https://cxxtest.com/")
389 (synopsis "Unit testing framework for C++")
390 (description "CxxTest is a unit testing framework for C++ that is similar
391 in spirit to JUnit, CppUnit, and xUnit. CxxTest does not require precompiling
392 a CxxTest testing library, it employs no advanced features of C++ (e.g. RTTI)
393 and it supports a very flexible form of test discovery.")
394 (license license:lgpl3+)))
396 (define-public doctest
400 (home-page "https://github.com/onqtam/doctest")
403 (uri (git-reference (url home-page) (commit version)))
404 (file-name (git-file-name name version))
407 "134lx7pjnglrl4wdmyr9dz3rjb6d4ir6rvapg00gp52n44dbhnrq"))))
408 (build-system cmake-build-system)
409 (synopsis "C++ test framework")
411 "doctest is a single-header testing framework for C++11 and later. It
412 has been designed to be fast, light and unintrusive.")
413 (license license:expat)))
415 (define-public go-gopkg.in-check.v1
416 (let ((commit "788fd78401277ebd861206a03c884797c6ec5541")
419 (name "go-gopkg.in-check.v1")
420 (version (git-version "0.0.0" revision commit))
424 (url "https://github.com/go-check/check.git")
426 (file-name (git-file-name name version))
429 "0v3bim0j375z81zrpr5qv42knqs0y2qv2vkjiqi5axvb78slki1a"))))
430 (build-system go-build-system)
432 '(#:import-path "gopkg.in/check.v1"))
434 `(("go-github-com-kr-pretty" ,go-github-com-kr-pretty)))
435 (synopsis "Rich testing extension for Go's testing package")
437 "@code{check} is a rich testing extension for Go's testing package.")
438 (home-page "https://github.com/go-check/check")
439 (license license:bsd-2))))
441 (define-public go-github.com-smartystreets-gunit
443 (name "go-github.com-smartystreets-gunit")
448 (url "https://github.com/smartystreets/gunit")
450 (file-name (git-file-name name version))
453 "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
454 (build-system go-build-system)
456 '(;; TODO: This package depends on go-github.com-smartystreets-assertions
457 ;; for running the tests, but go-github.com-smartystreets-assertions
458 ;; depends on this package, so break this loop by not running the tests
461 #:import-path "github.com/smartystreets/gunit"))
462 (synopsis "Testing tool for Go, in the style of xUnit")
464 "@code{gunit} allows the test author to use a struct as the scope for a
465 group of related test cases, in the style of xUnit fixtures. This makes
466 extraction of setup/teardown behavior (as well as invoking the system under
467 test) much simpler.")
468 (home-page "https://github.com/smartystreets/gunit")
469 (license license:expat)))
471 (define-public go-github.com-smartystreets-assertions
473 (name "go-github.com-smartystreets-assertions")
478 (url "https://github.com/smartystreets/assertions")
480 (file-name (git-file-name name version))
483 "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
484 (build-system go-build-system)
486 '(#:import-path "github.com/smartystreets/assertions"))
488 `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
489 (synopsis "Assertions for testing with Go")
491 "The @code{assertions} package provides convenient assertion functions
492 for writing tests in Go.")
493 (home-page "https://github.com/smartystreets/assertions")
494 (license license:expat)))
496 (define-public go-github.com-smartystreets-goconvey
498 (name "go-github.com-smartystreets-goconvey")
503 (url "https://github.com/smartystreets/goconvey")
505 (file-name (git-file-name name version))
508 "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
509 (build-system go-build-system)
511 '(#:import-path "github.com/smartystreets/goconvey"))
513 `(("go-github.com-jtolds-gls" ,go-github.com-jtolds-gls)
514 ("go-github.com-smartystreets-assertions" ,go-github.com-smartystreets-assertions)))
515 (synopsis "Go testing tool with both a web and terminal user interface")
517 "GoConvey is a testing tool for Go. It integrates with go test, can show
518 test coverage and has a web user interface that will refresh automatically.")
519 (home-page "https://github.com/smartystreets/goconvey")
520 (license license:expat)))
522 (define-public googletest
530 (url "https://github.com/google/googletest.git")
531 (commit (string-append "release-" version))))
532 (file-name (git-file-name name version))
534 (base32 "1zbmab9295scgg4z2vclgfgjchfjailjnvzc6f5x9jvlsdi3dpwz"))))
535 (build-system cmake-build-system)
537 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
539 `(("python" ,python-wrapper)))
540 (home-page "https://github.com/google/googletest/")
541 (synopsis "Test discovery and XUnit test framework")
542 (description "Google Test features an XUnit test framework, automated test
543 discovery, death tests, assertions, parameterized tests and XML test report
545 (license license:bsd-3)))
547 (define-public googletest-1.8
554 (url "https://github.com/google/googletest.git")
555 (commit (string-append "release-" version))))
556 (file-name (git-file-name "googletest" version))
559 "0270msj6n7mggh4xqqjp54kswbl7mkcc8px1p5dqdpmw5ngh9fzk"))))))
561 (define-public cpputest
568 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
569 version "/cpputest-" version ".tar.gz"))
572 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
573 (build-system gnu-build-system)
575 `(("googletest" ,googletest)))
576 (home-page "https://cpputest.github.io/")
577 (synopsis "Unit testing and mocking framework for C/C++")
579 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
580 C++ but is used in C and C++ projects and frequently used in embedded systems
581 but it works for any C/C++ project.")
582 (license license:bsd-3)))
584 (define-public python-parameterized
586 (name "python-parameterized")
591 (uri (pypi-uri "parameterized" version))
594 "0g1q6n7fkanjv7i1djzw62f46xf573jvza7afabh3baqjqxy7rpd"))))
595 (build-system python-build-system)
597 '(#:phases (modify-phases %standard-phases
599 (lambda* (#:key tests? #:allow-other-keys)
601 (invoke "nosetests" "-v")
602 (format #t "test suite not run~%"))
605 `(("python-mock" ,python-mock)
606 ("python-nose" ,python-nose)))
607 (home-page "https://github.com/wolever/parameterized")
608 (synopsis "Parameterized testing with any Python test framework")
610 "Parameterized is a Python library that aims to fix parameterized testing
611 for every Python test framework. It supports nose, py.test, and unittest.")
612 (properties `((python2-variant . ,(delay python2-parameterized))))
613 (license license:bsd-2)))
615 (define-public python2-parameterized
616 (let ((base (package-with-python2 (strip-python2-variant
617 python-parameterized))))
622 (inherit (package-source base))
623 (patches (search-patches "python2-parameterized-docstring-test.patch")))))))
625 (define-public python-minimock
627 (name "python-minimock")
632 (uri (pypi-uri "MiniMock" version))
635 "0k2sxb1ibnyg05iblz7zhbv825f1zk9906rab7883iqgvzmdzpsz"))))
636 (build-system python-build-system)
637 (home-page "https://pypi.org/project/MiniMock")
638 (synopsis "Simple Python library for using mock objects")
639 (description "MiniMock is a simple library for building mock objects with
641 (license license:expat)))
643 (define-public python2-minimock
644 (package-with-python2 python-minimock))
646 (define-public python-mock
653 (uri (pypi-uri "mock" version))
656 "1hrp6j0yrx2xzylfv02qa8kph661m6yq4p0mc8fnimch9j4psrc3"))))
658 `(("python-six" ,python-six)))
659 (build-system python-build-system)
661 ;; FIXME: Tests require "pytest", which depends on this package.
663 (home-page "https://github.com/testing-cabal/mock")
664 (synopsis "Python mocking and patching library for testing")
666 "Mock is a library for testing in Python. It allows you to replace parts
667 of your system under test with mock objects and make assertions about how they
669 (properties `((python2-variant . ,(delay python2-mock))))
670 (license license:expat)))
672 (define-public python2-mock
673 (let ((base (package-with-python2
674 (strip-python2-variant python-mock))))
675 (package (inherit base)
677 `(("python2-functools32" ,python2-functools32)
678 ("python2-funcsigs" ,python2-funcsigs)
679 ,@(package-propagated-inputs base))))))
681 (define-public python-nose
688 (uri (pypi-uri "nose" version))
691 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
692 (build-system python-build-system)
694 '(#:tests? #f)) ; FIXME: test suite fails
695 (home-page "http://readthedocs.org/docs/nose/")
696 (synopsis "Python testing library")
698 "Nose extends the unittest library to make testing easier.")
699 (license license:lgpl2.0+)))
701 (define-public python2-nose
702 (package-with-python2 python-nose))
704 (define-public python-nose2
706 (name "python-nose2")
711 (uri (pypi-uri "nose2" version))
714 "0pmbb6nk31yhgh4zkcblzxsznml7f7pf5q1ihgrwvbxv4mwzfql7"))))
715 (build-system python-build-system)
716 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
718 `(("python-cov-core" ,python-cov-core)
719 ("python-pytest-cov" ,python-pytest-cov)
720 ("python-six" ,python-six)))
721 (home-page "https://github.com/nose-devs/nose2")
722 (synopsis "Next generation of nicer testing for Python")
724 "Nose2 is the next generation of nicer testing for Python, based on the
725 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
726 better plugin api, being easier for users to configure, and simplifying internal
727 interfaces and processes.")
728 (license license:bsd-2)))
730 (define-public python2-nose2
731 (package-with-python2 python-nose2))
733 (define-public python-unittest2
735 (name "python-unittest2")
740 (uri (pypi-uri "unittest2" version))
742 (search-patches "python-unittest2-python3-compat.patch"
743 "python-unittest2-remove-argparse.patch"))
746 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
747 (build-system python-build-system)
750 (modify-phases %standard-phases
753 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
755 `(("python-six" ,python-six)
756 ("python-traceback2" ,python-traceback2)))
757 (home-page "https://pypi.org/project/unittest2/")
758 (synopsis "Python unit testing library")
760 "Unittest2 is a replacement for the unittest module in the Python
762 (license license:psfl)))
764 (define-public python2-unittest2
765 (package-with-python2 python-unittest2))
767 (define-public python-pytest
769 (name "python-pytest")
774 (uri (pypi-uri "pytest" version))
777 "139i9cjhrv5aici3skq8iihvfb3lq0d8xb5j7qycr2hlk8cfjpqd"))))
778 (build-system python-build-system)
781 (modify-phases %standard-phases
783 (lambda* (#:key (tests? #t) #:allow-other-keys)
785 (invoke "pytest" "-vv" "-k"
787 ;; These tests involve the /usr directory, and fails.
788 "not test_remove_dir_prefix"
789 " and not test_argcomplete"
790 ;; This test tries to override PYTHONPATH, and
791 ;; subsequently fails to locate the test libraries.
792 " and not test_collection"))
793 (format #t "test suite not run~%"))
796 `(("python-atomicwrites" ,python-atomicwrites)
797 ("python-attrs" ,python-attrs-bootstrap)
798 ("python-more-itertools" ,python-more-itertools)
799 ("python-packaging" ,python-packaging-bootstrap)
800 ("python-pluggy" ,python-pluggy)
801 ("python-py" ,python-py)
802 ("python-six" ,python-six-bootstrap)
803 ("python-wcwidth" ,python-wcwidth)))
805 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
807 ("python-hypothesis" ,python-hypothesis)
808 ("python-nose" ,python-nose)
809 ("python-mock" ,python-mock)
810 ("python-pytest" ,python-pytest-bootstrap)
811 ("python-setuptools-scm" ,python-setuptools-scm)
812 ("python-xmlschema" ,python-xmlschema)))
813 (home-page "https://docs.pytest.org/en/latest/")
814 (synopsis "Python testing library")
816 "Pytest is a testing tool that provides auto-discovery of test modules
817 and functions, detailed info on failing assert statements, modular fixtures,
818 and many external plugins.")
819 (license license:expat)
820 (properties `((python2-variant . ,(delay python2-pytest))))))
822 ;; Pytest 4.x are the last versions that support Python 2.
823 (define-public python2-pytest
825 (inherit (strip-python2-variant python-pytest))
826 (name "python2-pytest")
830 (uri (pypi-uri "pytest" version))
833 "0fgkmpc31nzy97fxfrkqbzycigdwxwwmninx3qhkzp81migggs0r"))))
834 (build-system python-build-system)
837 ,@(package-arguments python-pytest)))
839 `(("python-atomicwrites" ,python2-atomicwrites)
840 ("python-attrs" ,python2-attrs-bootstrap)
841 ("python-funcsigs" ,python2-funcsigs)
842 ("python-importlib-metadata" ,python2-importlib-metadata-bootstrap)
843 ("python-more-itertools" ,python2-more-itertools)
844 ("python-packaging" ,python2-packaging-bootstrap)
845 ("python-pathlib2" ,python2-pathlib2)
846 ("python-pluggy" ,python2-pluggy)
847 ("python-py" ,python2-py)
848 ("python-six" ,python2-six-bootstrap)
849 ("python-wcwidth" ,python2-wcwidth)))
851 `(("bash" ,bash) ;tests require 'compgen'
852 ("python-hypothesis" ,python2-hypothesis)
853 ("python-nose" ,python2-nose)
854 ("python-mock" ,python2-mock)
855 ("python-pytest" ,python2-pytest-bootstrap)
856 ("python-setuptools-scm" ,python2-setuptools-scm)))))
858 (define-public python-pytest-bootstrap
860 (inherit (strip-python2-variant python-pytest))
861 (name "python-pytest-bootstrap")
862 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
863 (arguments `(#:tests? #f))
864 (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
866 (define-public python2-pytest-bootstrap
870 (name "python2-pytest-bootstrap")
872 (substitute-keyword-arguments (package-arguments python2-pytest)
873 ((#:tests? _ #f) #f)))
875 `(("python-setuptools-scm" ,python2-setuptools-scm)))
877 `(("python-atomicwrites" ,python2-atomicwrites)
878 ("python-attrs" ,python2-attrs-bootstrap)
879 ("python-funcsigs" ,python2-funcsigs-bootstrap)
880 ("python-importlib-metadata" ,python2-importlib-metadata-bootstrap)
881 ("python-more-itertools" ,python2-more-itertools)
882 ("python-packaging" ,python2-packaging-bootstrap)
883 ("python-pathlib2" ,python2-pathlib2-bootstrap)
884 ("python-pluggy" ,python2-pluggy-bootstrap)
885 ("python-py" ,python2-py)
886 ("python-wcwidth" ,python2-wcwidth))))))
888 (define-public python-pytest-cov
890 (name "python-pytest-cov")
895 (uri (pypi-uri "pytest-cov" version))
897 (base32 "0avzlk9p4nc44k7lpx9109dybq71xqnggxb9f4hp0l64pbc44ryc"))))
898 (build-system python-build-system)
901 (modify-phases %standard-phases
904 ;; Options taken from tox.ini.
905 ;; TODO: make "--restructuredtext" tests pass. They currently fail
906 ;; with "Duplicate implicit target name".
907 (invoke "python" "./setup.py" "check"
908 "--strict" "--metadata"))))))
910 `(("python-coverage" ,python-coverage)
911 ("python-pytest" ,python-pytest)))
912 (home-page "https://github.com/pytest-dev/pytest-cov")
913 (synopsis "Pytest plugin for measuring coverage")
915 "Pytest-cov produces coverage reports. It supports centralised testing and
916 distributed testing in both @code{load} and @code{each} modes. It also
917 supports coverage of subprocesses.")
918 (license license:expat)))
920 (define-public python2-pytest-cov
921 (package-with-python2 python-pytest-cov))
923 (define-public python-pytest-runner
925 (name "python-pytest-runner")
930 (uri (pypi-uri "pytest-runner" version))
933 "0awll1bva5zy8cspsxcpv7pjcrdf5c6pf56nqn4f74vvmlzfgiwn"))))
934 (build-system python-build-system)
936 '(;; FIXME: The test suite requires 'python-flake8' and 'python-black',
937 ;; but that introduces a circular dependency.
939 #:phases (modify-phases %standard-phases
941 (lambda* (#:key tests? #:allow-other-keys)
943 (invoke "pytest" "-vv")
944 (format #t "test suite not run~%"))
947 `(("python-setuptools-scm" ,python-setuptools-scm)))
948 (home-page "https://github.com/pytest-dev/pytest-runner")
949 (synopsis "Invoke py.test as a distutils command")
951 "This package provides a @command{pytest-runner} command that
952 @file{setup.py} files can use to run tests.")
953 (license license:expat)))
955 (define-public python2-pytest-runner
956 (package-with-python2 python-pytest-runner))
958 ;; python-bleach 3.1.0 requires this ancient version of pytest-runner.
959 ;; Remove once no longer needed.
960 (define-public python-pytest-runner-2
966 (uri (pypi-uri "pytest-runner" version))
969 "11ivjj9hfphkv4yfb2g74av4yy86y8gcbf7gbif0p1hcdfnxg3w6"))))))
971 (define-public python2-pytest-runner-2
972 (package-with-python2 python-pytest-runner-2))
974 (define-public python-pytest-mock
976 (name "python-pytest-mock")
981 (uri (pypi-uri "pytest-mock" version))
984 "1i5mg3ff1qk0wqfcxfz60hwy3q5dskdp36i10ckigkzffg8hc3ad"))))
985 (build-system python-build-system)
987 `(("python-setuptools-scm" ,python-setuptools-scm)))
989 `(("python-pytest" ,python-pytest)))
990 (home-page "https://github.com/pytest-dev/pytest-mock/")
991 (synopsis "Thin-wrapper around the mock package for easier use with py.test")
993 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
994 around the patching API provided by the @code{mock} package, but with the
995 benefit of not having to worry about undoing patches at the end of a test.
996 The mocker fixture has the same API as @code{mock.patch}, supporting the
998 (properties `((python2-variant . ,(delay python2-pytest-mock))))
999 (license license:expat)))
1001 (define-public python2-pytest-mock
1002 (let ((base (package-with-python2
1003 (strip-python2-variant python-pytest-mock))))
1004 (package (inherit base)
1006 `(("python2-mock" ,python2-mock)
1007 ,@(package-propagated-inputs base))))))
1009 (define-public python-pytest-xdist
1011 (name "python-pytest-xdist")
1016 (uri (pypi-uri "pytest-xdist" version))
1019 "1d812apvcmshh2l8f38spqwb3bpp0x43yy7lyfpxxzc99h4r7y4n"))
1020 (modules '((guix build utils)))
1023 ;; Remove pre-compiled .pyc files from source.
1024 (for-each delete-file-recursively
1025 (find-files "." "__pycache__" #:directories? #t))
1026 (for-each delete-file (find-files "." "\\.pyc$"))
1028 (build-system python-build-system)
1030 '(#:tests? #f)) ;FIXME: Some tests are failing.
1032 ;; (modify-phases %standard-phases
1034 ;; (add-after 'install 'check
1035 ;; (lambda* (#:key inputs outputs #:allow-other-keys)
1036 ;; (add-installed-pythonpath inputs outputs)
1037 ;; (zero? (system* "py.test" "-v")))))
1039 `(("python-setuptools-scm" ,python-setuptools-scm)))
1041 `(("python-execnet" ,python-execnet)
1042 ("python-pytest" ,python-pytest)
1043 ("python-py" ,python-py)))
1045 "https://github.com/pytest-dev/pytest-xdist")
1047 "Plugin for py.test with distributed testing and loop-on-failing modes")
1049 "The pytest-xdist plugin extends py.test with some unique test execution
1050 modes: parallelization, running tests in boxed subprocesses, the ability
1051 to run tests repeatedly when failed, and the ability to run tests on multiple
1052 Python interpreters or platforms. It uses rsync to copy the existing
1053 program code to a remote location, executes there, and then syncs the
1055 (license license:expat)))
1057 (define-public python2-pytest-xdist
1058 (package-with-python2 python-pytest-xdist))
1060 (define-public python-pytest-timeout
1062 (name "python-pytest-timeout")
1067 (uri (pypi-uri "pytest-timeout" version))
1070 "13n42azbvs5slvy2n1a9nw17r4qdq10dd68nln3jp925safa3yl0"))))
1071 (build-system python-build-system)
1073 '(#:phases (modify-phases %standard-phases
1075 (lambda* (#:key inputs outputs #:allow-other-keys)
1076 ;; Make the installed plugin discoverable by Pytest.
1077 (add-installed-pythonpath inputs outputs)
1078 (invoke "pytest" "-vv"))))))
1080 `(("python-pytest" ,python-pytest)))
1082 `(("python-pexpect" ,python-pexpect)))
1083 (home-page "http://bitbucket.org/pytest-dev/pytest-timeout/")
1084 (synopsis "Plugin for py.test to abort hanging tests")
1086 "This package provides a py.test plugin that aborts hanging tests after a
1087 timeout has been exceeded.")
1088 (license license:expat)))
1090 (define-public python-pytest-forked
1092 (name "python-pytest-forked")
1097 (uri (pypi-uri "pytest-forked" version))
1100 "000i4q7my2fq4l49n8idx2c812dql97qv6qpm2vhrrn9v6g6j18q"))))
1101 (build-system python-build-system)
1103 `(("python-pytest" ,python-pytest)))
1105 `(("python-setuptools-scm" ,python-setuptools-scm)))
1107 "https://github.com/pytest-dev/pytest-forked")
1109 "Run tests in isolated forked subprocesses")
1111 "Pytest plugin which will run each test in a subprocess and will report if
1112 a test crashed the process.")
1113 (license license:expat)))
1115 (define-public python-scripttest
1117 (name "python-scripttest")
1122 (uri (pypi-uri "scripttest" version))
1125 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
1126 (build-system python-build-system)
1128 `(("python-pytest" ,python-pytest)))
1129 (home-page (string-append "https://web.archive.org/web/20161029233413/"
1130 "http://pythonpaste.org/scripttest/"))
1131 (synopsis "Python library to test command-line scripts")
1132 (description "Scripttest is a Python helper library for testing
1133 interactive command-line applications. With it you can run a script in a
1134 subprocess and see the output as well as any file modifications.")
1135 (license license:expat)))
1137 (define-public python2-scripttest
1138 (package-with-python2 python-scripttest))
1140 (define-public python-testtools-bootstrap
1142 (name "python-testtools-bootstrap")
1147 (uri (pypi-uri "testtools" version))
1150 "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
1151 (patches (search-patches "python-testtools.patch"))))
1152 (build-system python-build-system)
1153 (arguments '(#:tests? #f))
1155 `(("python-extras" ,python-extras)
1156 ("python-fixtures" ,python-fixtures-bootstrap)
1157 ("python-mimeparse" ,python-mimeparse)
1158 ("python-pbr" ,python-pbr-minimal)
1159 ("python-six" ,python-six)
1160 ("python-traceback2" ,python-traceback2)
1161 ("python-unittest2" ,python-unittest2)))
1162 (home-page "https://github.com/testing-cabal/testtools")
1164 "Extensions to the Python standard library unit testing framework")
1166 "This package is only for bootstrapping. Do not use this.")
1167 (license license:psfl)))
1169 (define-public python2-testtools-bootstrap
1170 (package-with-python2 python-testtools-bootstrap))
1172 (define-public python-testtools
1174 (inherit python-testtools-bootstrap)
1175 (name "python-testtools")
1177 `(#:phases (modify-phases %standard-phases
1180 (invoke "python" "-m" "testtools.run"
1181 "testtools.tests.test_suite"))))))
1183 `(("python-extras" ,python-extras)
1184 ("python-fixtures" ,python-fixtures)
1185 ("python-mimeparse" ,python-mimeparse)
1186 ("python-pbr" ,python-pbr)
1187 ("python-six" ,python-six)
1188 ("python-traceback2" ,python-traceback2)
1189 ("python-unittest2" ,python-unittest2)))
1191 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
1193 "Testtools extends the Python standard library unit testing framework to
1194 provide matchers, more debugging information, and cross-Python
1197 (define-public python2-testtools
1198 (package-with-python2 python-testtools))
1200 (define-public python-testscenarios-bootstrap
1202 (name "python-testscenarios-bootstrap")
1207 (uri (pypi-uri "testscenarios" version))
1210 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
1211 (build-system python-build-system)
1213 `(#:phases (modify-phases %standard-phases
1216 (invoke "python" "-m" "testtools.run"
1217 "testscenarios.test_suite"))))))
1219 `(("python-pbr" ,python-pbr-minimal)
1220 ("python-testtools" ,python-testtools-bootstrap)))
1221 (home-page "https://launchpad.net/testscenarios")
1222 (synopsis "Pyunit extension for dependency injection")
1224 "This package is only for bootstrapping. Don't use this.")
1225 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1227 (define-public python2-testscenarios-bootstrap
1228 (package-with-python2 python-testscenarios-bootstrap))
1230 (define-public python-testscenarios
1232 (inherit python-testscenarios-bootstrap)
1233 (name "python-testscenarios")
1235 `(("python-pbr" ,python-pbr)
1236 ("python-testtools" ,python-testtools)))
1238 "Testscenarios provides clean dependency injection for Python unittest
1241 (define-public python2-testscenarios
1242 (package-with-python2 python-testscenarios))
1244 ;; Testresources requires python-pbr at runtime, but pbr needs it for its
1245 ;; own tests. Hence this bootstrap variant.
1246 (define-public python-testresources-bootstrap
1248 (name "python-testresources-bootstrap")
1252 (uri (pypi-uri "testresources" version))
1255 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
1256 (build-system python-build-system)
1257 (arguments '(#:tests? #f))
1259 `(("python-pbr" ,python-pbr-minimal)))
1260 (home-page "https://launchpad.net/testresources")
1262 "Pyunit extension for managing test resources")
1264 "This package is only here for bootstrapping purposes. Use the regular
1265 testresources package instead.")
1266 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1268 (define-public python2-testresources-bootstrap
1269 (package-with-python2 python-testresources-bootstrap))
1271 (define-public python-testresources
1273 (inherit python-testresources-bootstrap)
1274 (name "python-testresources")
1276 `(("python-pbr" ,python-pbr)))
1279 `(("python-fixtures" ,python-fixtures)
1280 ("python-testtols" ,python-testtools)))
1282 "Testresources is an extension to Python's unittest to allow declarative
1283 use of resources by test cases.")))
1285 (define-public python2-testresources
1286 (package-with-python2 python-testresources))
1288 (define-public python-subunit-bootstrap
1290 (name "python-subunit-bootstrap")
1295 (uri (pypi-uri "python-subunit" version))
1298 "1fsw8rsn1s3nklx06mayrg5rn2zbky6wwjc5z07s7rf1wjzfs1wn"))))
1299 (build-system python-build-system)
1301 `(("python-extras" ,python-extras)
1302 ("python-testtools" ,python-testtools-bootstrap)))
1304 `(("python-fixtures" ,python-fixtures-bootstrap)
1305 ("python-hypothesis" ,python-hypothesis)
1306 ("python-testscenarios" ,python-testscenarios-bootstrap)))
1307 (home-page "https://launchpad.net/subunit")
1308 (synopsis "Python implementation of the subunit protocol")
1310 "This package is here for bootstrapping purposes only. Use the regular
1311 python-subunit package instead.")
1312 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1314 (define-public python2-subunit-bootstrap
1315 (package-with-python2 python-subunit-bootstrap))
1317 (define-public python-subunit
1319 (inherit python-subunit-bootstrap)
1320 (name "python-subunit")
1322 `(("python-extras" ,python-extras)
1323 ("python-testtools" ,python-testtools)))
1325 `(("python-fixtures" ,python-fixtures)
1326 ("python-hypothesis" ,python-hypothesis)
1327 ("python-testscenarios" ,python-testscenarios)))
1329 "Python-subunit is a Python implementation of the subunit test streaming
1332 (define-public python2-subunit
1333 (package-with-python2 python-subunit))
1335 ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
1336 ;; own tests. Hence this bootstrap variant.
1337 (define-public python-fixtures-bootstrap
1339 (name "python-fixtures-bootstrap")
1343 (uri (pypi-uri "fixtures" version))
1346 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
1347 (build-system python-build-system)
1348 (arguments `(#:tests? #f))
1350 `(("python-pbr-minimal" ,python-pbr-minimal)
1351 ("python-six" ,python-six)))
1352 (home-page "https://launchpad.net/python-fixtures")
1353 (synopsis "Python test fixture library")
1355 "This package is only used for bootstrapping. Use the regular
1356 python-fixtures package instead.")
1357 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1359 (define-public python2-fixtures-bootstrap
1360 (package-with-python2 python-fixtures-bootstrap))
1362 (define-public python-fixtures
1364 (inherit python-fixtures-bootstrap)
1365 (name "python-fixtures")
1368 (modify-phases %standard-phases
1371 (invoke "python" "-m" "testtools.run"
1372 "fixtures.test_suite"))))))
1374 ;; Fixtures uses pbr at runtime to check versions, etc.
1375 `(("python-pbr" ,python-pbr)
1376 ("python-six" ,python-six)))
1378 `(("python-mock" ,python-mock)
1379 ("python-testtools" ,python-testtools-bootstrap)))
1381 "Fixtures provides a way to create reusable state, useful when writing
1384 (define-public python2-fixtures
1385 (package-with-python2 python-fixtures))
1387 (define-public python-testrepository-bootstrap
1389 (name "python-testrepository-bootstrap")
1394 (uri (pypi-uri "testrepository" version))
1397 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1398 (build-system python-build-system)
1399 (arguments '(#:tests? #f))
1401 `(("python-fixtures" ,python-fixtures-bootstrap)
1402 ("python-subunit" ,python-subunit-bootstrap)
1403 ("python-testtools" ,python-testtools-bootstrap)))
1405 `(("python-mimeparse" ,python-mimeparse)))
1406 (home-page "https://launchpad.net/testrepository")
1407 (synopsis "Database for Python test results")
1409 "Bootstrap package for python-testrepository. Don't use this.")
1410 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1412 (define-public python2-testrepository-bootstrap
1413 (package-with-python2 python-testrepository-bootstrap))
1415 (define-public python-testrepository
1417 (inherit python-testrepository-bootstrap)
1418 (name "python-testrepository")
1420 ;; FIXME: Many tests are failing.
1423 `(("python-fixtures" ,python-fixtures)
1424 ("python-subunit" ,python-subunit)
1425 ("python-testtools" ,python-testtools)))
1427 `(("python-mimeparse" ,python-mimeparse)))
1428 (description "Testrepository provides a database of test results which can
1429 be used as part of a developer's workflow to check things such as what tests
1430 have failed since the last commit or what tests are currently failing.")))
1432 (define-public python2-testrepository
1433 (package-with-python2 python-testrepository))
1435 (define-public python-coverage
1437 (name "python-coverage")
1442 (uri (pypi-uri "coverage" version))
1445 "1vrg8panqw79pswg52ygbrff3wdnxarrd9qz6c64ah0c4h2cmbvp"))))
1446 (build-system python-build-system)
1448 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1450 (home-page "http://nedbatchelder.com/code/coverage")
1451 (synopsis "Code coverage measurement for Python")
1453 "Coverage measures code coverage, typically during test execution. It
1454 uses the code analysis tools and tracing hooks provided in the Python standard
1455 library to determine which lines are executable, and which have been
1457 (license license:bsd-3)))
1459 (define-public python2-coverage
1460 (package-with-python2 python-coverage))
1462 (define-public python-pytest-asyncio
1464 (name "python-pytest-asyncio")
1469 (uri (pypi-uri "pytest-asyncio" version))
1471 (base32 "1bysy4nii13bm7h345wxf8fxcjhab7l374pqdv7vwv3izl053b4z"))))
1472 (build-system python-build-system)
1474 `(("python-coverage" ,python-coverage)
1475 ("python-async-generator" ,python-async-generator)
1476 ("python-hypothesis" ,python-hypothesis)
1477 ("python-pytest" ,python-pytest)))
1478 (home-page "https://github.com/pytest-dev/pytest-asyncio")
1479 (synopsis "Pytest support for asyncio")
1480 (description "Python asyncio code is usually written in the form of
1481 coroutines, which makes it slightly more difficult to test using normal
1482 testing tools. @code{pytest-asyncio} provides useful fixtures and markers
1483 to make testing async code easier.")
1484 (license license:asl2.0)))
1486 (define-public python-cov-core
1488 (name "python-cov-core")
1493 (uri (pypi-uri "cov-core" version))
1496 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1497 (build-system python-build-system)
1499 `(("python-coverage" ,python-coverage)))
1500 (home-page "https://github.com/schlamar/cov-core")
1501 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
1503 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1504 and @code{nose2-cov}. It is useful for developing coverage plugins for these
1505 testing frameworks.")
1506 (license license:expat)))
1508 (define-public python2-cov-core
1509 (package-with-python2 python-cov-core))
1511 (define-public python-codecov
1513 (name "python-codecov")
1518 (uri (pypi-uri "codecov" version))
1521 "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1522 (build-system python-build-system)
1524 `(("python-unittest2" ,python-unittest2)))
1526 `(("python-coverage" ,python-coverage)
1527 ("python-requests" ,python-requests)))
1528 (home-page "http://github.com/codecov/codecov-python")
1529 (synopsis "Upload code coverage reports to @code{codecov.io}")
1531 "Codecov collects code coverage reports from code written in Python, Java,
1532 C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
1533 (license license:asl2.0)))
1535 (define-public python-testpath
1537 (name "python-testpath")
1543 (url "https://github.com/jupyter/testpath")
1545 (file-name (git-file-name name version))
1548 "0r4iiizjql6ny1ln7ciw7rrbjadz1s9zrf2hl0xkgnh3ypd8936f"))))
1549 (build-system python-build-system)
1551 `(#:tests? #f ; this package does not even have a setup.py
1552 #:modules ((guix build python-build-system)
1556 (modify-phases %standard-phases
1559 (lambda* (#:key inputs outputs #:allow-other-keys)
1560 (let* ((version (last
1561 (string-split (assoc-ref inputs "python") #\-)))
1562 (x.y (string-join (take (string-split version #\.) 2)
1565 (assoc-ref outputs "out")
1566 "/lib/python" x.y "/site-packages/testpath")))
1568 (copy-recursively "testpath" dir))
1570 (home-page "https://github.com/takluyver/testpath")
1571 (synopsis "Test utilities for code working with files and commands")
1573 "Testpath is a collection of utilities for Python code working with files
1574 and commands. It contains functions to check things on the file system, and
1575 tools for mocking system commands and recording calls to those.")
1576 (license license:expat)))
1578 (define-public python2-testpath
1579 (package-with-python2 python-testpath))
1581 (define-public python-testlib
1583 (name "python-testlib")
1588 (uri (pypi-uri "testlib" version ".zip"))
1590 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1591 (build-system python-build-system)
1593 `(("unzip" ,unzip))) ; for unpacking the source
1594 (synopsis "Python micro test suite harness")
1595 (description "A micro unittest suite harness for Python.")
1596 (home-page "https://github.com/trentm/testlib")
1597 (license license:expat)))
1599 (define-public python2-testlib
1600 (package-with-python2 python-testlib))
1602 ;;; The software provided by this package was integrated into pytest 2.8.
1603 (define-public python-pytest-cache
1605 (name "python-pytest-cache")
1609 (uri (pypi-uri "pytest-cache" version))
1612 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1613 (build-system python-build-system)
1615 `(("python-apipkg" ,python-apipkg)
1616 ("python-execnet" ,python-execnet)
1617 ("python-py" ,python-py)
1618 ("python-pytest" ,python-pytest)))
1619 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1620 (description "The pytest-cache plugin provides tools to rerun failures from
1621 the last py.test invocation.")
1622 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1623 (license license:expat)))
1625 (define-public python2-pytest-cache
1626 (package-with-python2 python-pytest-cache))
1628 (define-public python-pytest-localserver
1630 (name "python-pytest-localserver")
1634 (uri (pypi-uri "pytest-localserver" version))
1637 "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
1638 (build-system python-build-system)
1641 (modify-phases %standard-phases
1644 (invoke "py.test" "-v"))))))
1646 `(("python-pytest" ,python-pytest)
1647 ("python-requests" ,python-requests)
1648 ("python-six" ,python-six)))
1650 `(("python-werkzeug" ,python-werkzeug)))
1651 (synopsis "Py.test plugin to test server connections locally")
1652 (description "Pytest-localserver is a plugin for the pytest testing
1653 framework which enables you to test server connections locally.")
1654 (home-page "https://pypi.org/project/pytest-localserver/")
1655 (license license:expat)))
1657 (define-public python-pytest-xprocess
1659 (name "python-pytest-xprocess")
1663 (uri (pypi-uri "pytest-xprocess" version))
1666 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1667 (build-system python-build-system)
1669 `(("python-pytest" ,python-pytest)
1670 ("python-pytest-cache" ,python-pytest-cache)
1671 ("python-psutil" ,python-psutil)))
1672 (synopsis "Pytest plugin to manage external processes across test runs")
1673 (description "Pytest-xprocess is an experimental py.test plugin for managing
1674 processes across test runs.")
1675 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1676 (license license:expat)))
1678 (define-public python-pytest-subtesthack
1680 (name "python-pytest-subtesthack")
1684 (uri (pypi-uri "pytest-subtesthack" version))
1687 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1688 (build-system python-build-system)
1690 `(("python-pytest" ,python-pytest)))
1691 (synopsis "Set-up and tear-down fixtures for unit tests")
1692 (description "This plugin allows you to set up and tear down fixtures within
1693 unit test functions that use @code{py.test}. This is useful for using
1694 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1695 function multiple times, without setting up or tearing down fixture state as is
1696 normally the case.")
1697 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1698 (license license:unlicense)))
1700 (define-public python2-pytest-subtesthack
1701 (package-with-python2 python-pytest-subtesthack))
1703 (define-public python-pytest-sugar
1705 (name "python-pytest-sugar")
1710 (uri (pypi-uri "pytest-sugar" version))
1713 "1asq7yc4g8bx2sn7yy974mhc9ywvaihasjab4inkirdwn9s7mn7w"))))
1714 (build-system python-build-system)
1716 `(("python-packaging" ,python-packaging)
1717 ("python-pytest" ,python-pytest)
1718 ("python-termcolor" ,python-termcolor)))
1719 (home-page "https://pivotfinland.com/pytest-sugar/")
1720 (synopsis "Plugin for pytest that changes the default look and feel")
1722 "@code{pytest-sugar} is a plugin for py.test that changes the default
1723 look and feel of py.test, using a progress bar and showing failures and errors
1725 (license license:bsd-3)))
1727 (define-public python-hypothesis
1729 (name "python-hypothesis")
1733 (uri (pypi-uri "hypothesis" version))
1736 "0zn09bn6hadk4vxl6jy8bkjr5fz8mrhin3z46w7pq5qgbaycr89p"))))
1737 (build-system python-build-system)
1739 ;; XXX: Tests are not distributed with the PyPI archive.
1742 `(("python-attrs" ,python-attrs-bootstrap)
1743 ("python-sortedcontainers" ,python-sortedcontainers)))
1744 (synopsis "Library for property based testing")
1745 (description "Hypothesis is a library for testing your Python code against a
1746 much larger range of examples than you would ever want to write by hand. It’s
1747 based on the Haskell library, Quickcheck, and is designed to integrate
1748 seamlessly into your existing Python unit testing work flow.")
1749 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
1750 (license license:mpl2.0)
1751 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1753 ;; This is the last version of Hypothesis that supports Python 2.
1754 (define-public python2-hypothesis
1755 (let ((hypothesis (package-with-python2
1756 (strip-python2-variant python-hypothesis))))
1757 (package (inherit hypothesis)
1761 (uri (pypi-uri "hypothesis" version))
1764 "183gpxbfcdhdqzlahkji5a71n6lmvgqsbkcb0ihqad51n2j6jhrw"))))
1766 `(("python2-enum34" ,python2-enum34)
1767 ,@(package-propagated-inputs hypothesis))))))
1769 (define-public python-lit
1776 (uri (pypi-uri "lit" version))
1779 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
1780 (build-system python-build-system)
1783 (modify-phases %standard-phases
1786 (invoke "python" "lit.py" "tests"))))))
1789 (home-page "https://llvm.org/")
1790 (synopsis "LLVM Software Testing Tool")
1791 (description "@code{lit} is a portable tool for executing LLVM and Clang
1792 style test suites, summarizing their results, and providing indication of
1794 (license license:ncsa)))
1796 (define-public python2-lit
1797 (package-with-python2 python-lit))
1799 (define-public python-pytest-pep8
1801 (name "python-pytest-pep8")
1805 (uri (pypi-uri "pytest-pep8" version))
1808 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
1809 (build-system python-build-system)
1811 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
1813 `(("python-pytest" ,python-pytest)))
1815 `(("python-pep8" ,python-pep8)))
1816 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
1817 (synopsis "Py.test plugin to check PEP8 requirements")
1818 (description "Pytest plugin for checking PEP8 compliance.")
1819 (license license:expat)))
1821 (define-public python2-pytest-pep8
1822 (package-with-python2 python-pytest-pep8))
1824 (define-public python-pytest-flakes
1826 (name "python-pytest-flakes")
1830 (uri (pypi-uri "pytest-flakes" version))
1833 "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
1834 (build-system python-build-system)
1837 (modify-phases %standard-phases
1839 (add-after 'install 'check
1840 (lambda* (#:key outputs inputs #:allow-other-keys)
1841 ;; It's easier to run tests after install.
1842 ;; Make installed package available for running the tests
1843 (add-installed-pythonpath inputs outputs)
1844 (invoke "py.test" "-vv"))))))
1846 `(("python-coverage" ,python-coverage)
1847 ("python-pytest" ,python-pytest)
1848 ("python-pytest-cache" ,python-pytest-cache)
1849 ("python-pytest-pep8" ,python-pytest-pep8)))
1851 `(("python-pyflakes" ,python-pyflakes)))
1852 (home-page "https://github.com/fschulze/pytest-flakes")
1853 (synopsis "Py.test plugin to check source code with pyflakes")
1854 (description "Pytest plugin for checking Python source code with pyflakes.")
1855 (license license:expat)))
1857 (define-public python2-pytest-flakes
1858 (package-with-python2 python-pytest-flakes))
1860 (define-public python2-coverage-test-runner
1862 (name "python2-coverage-test-runner")
1868 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
1869 "coverage-test-runner/snapshot/coverage-test-runner-"
1873 "1kjjb9llckycnfxag8zcvqsn4z1s3dwyw6b1n0avxydihgf30rny"))))
1874 (build-system python-build-system)
1876 `(#:python ,python-2
1878 (modify-phases %standard-phases
1881 (invoke "./testrun"))))))
1883 `(("python2-coverage" ,python2-coverage)))
1884 (home-page "https://liw.fi/coverage-test-runner/")
1885 (synopsis "Python module for running unit tests")
1886 (description "@code{CoverageTestRunner} is a python module for running
1887 unit tests and failing them if the unit test module does not exercise all
1888 statements in the module it tests.")
1889 (license license:gpl3+)))
1891 ;; Further releases, up to 2.4.3, have failing unit tests. See:
1892 ;; https://github.com/PyCQA/pylint/issues/3198.
1893 (define-public python-pylint
1895 (name "python-pylint")
1901 (url "https://github.com/PyCQA/pylint")
1902 (commit (string-append "pylint-" version))))
1903 (file-name (git-file-name name version))
1906 "17vvzbcqmkhr4icq5p3737nbiiyj1y3g1pa08n9mb1bsnvxmqq0z"))))
1907 (build-system python-build-system)
1909 `(("python-pytest" ,python-pytest)
1910 ("python-pytest-runner" ,python-pytest-runner)
1911 ("python-tox" ,python-tox)))
1913 `(("python-astroid" ,python-astroid)
1914 ("python-isort" ,python-isort)
1915 ("python-mccabe" ,python-mccabe)
1916 ("python-six" ,python-six)))
1917 (home-page "https://github.com/PyCQA/pylint")
1918 (synopsis "Python source code analyzer which looks for coding standard
1920 (description "Pylint is a Python source code analyzer which looks
1921 for programming errors, helps enforcing a coding standard and sniffs
1922 for some code smells (as defined in Martin Fowler's Refactoring book).
1924 Pylint has many rules enabled by default, way too much to silence them
1925 all on a minimally sized program. It's highly configurable and handle
1926 pragmas to control it from within your code. Additionally, it is
1927 possible to write plugins to add your own checks.")
1928 (properties `((python2-variant . ,(delay python2-pylint))))
1929 (license license:gpl2+)))
1931 ;; Python2 is not supported anymore by Pylint. See:
1932 ;; https://github.com/PyCQA/pylint/issues/1763.
1933 (define-public python2-pylint
1934 (let ((pylint (package-with-python2
1935 (strip-python2-variant python-pylint))))
1936 (package (inherit pylint)
1942 (url "https://github.com/PyCQA/pylint")
1943 (commit (string-append "pylint-" version))))
1944 (file-name (git-file-name (package-name pylint) version))
1947 "02a89d8a47s7nfiv1ady3j0sg2sbyja3np145brarfp5x9qxz9x2"))))
1949 `(,@(package-arguments pylint)
1951 (modify-phases %standard-phases
1954 ;; Somehow, tests fail if run from the build directory.
1955 (let ((work "/tmp/work"))
1957 (setenv "PYTHONPATH"
1958 (string-append (getenv "PYTHONPATH") ":" work))
1959 (copy-recursively "." work)
1960 (with-directory-excursion "/tmp"
1961 (invoke "python" "-m" "unittest" "discover"
1962 "-s" (string-append work "/pylint/test")
1963 "-p" "*test_*.py"))))))))
1965 `(("python2-futures" ,python2-futures)
1966 ,@(package-native-inputs pylint)))
1968 `(("python2-backports-functools-lru-cache"
1969 ,python2-backports-functools-lru-cache)
1970 ("python2-configparser" ,python2-configparser)
1971 ,@(package-propagated-inputs pylint))))))
1973 (define-public python-paramunittest
1975 (name "python-paramunittest")
1980 (uri (pypi-uri "ParamUnittest" version))
1983 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
1984 (build-system python-build-system)
1986 "https://github.com/rik0/ParamUnittest")
1988 "Simple extension to have parametrized unit tests")
1990 "This package creates parameterized unit-tests that work with the standard
1991 unittest package. A parameterized test case is automatically converted to multiple test
1992 cases. Since they are TestCase subclasses, they work with other test suites that
1993 recognize TestCases.")
1994 (license license:bsd-2)))
1996 (define-public python2-python-paramunittest
1997 (package-with-python2 python-paramunittest))
1999 (define-public python-pytest-warnings
2001 (name "python-pytest-warnings")
2006 (uri (pypi-uri "pytest-warnings" version))
2009 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
2010 (build-system python-build-system)
2012 `(("pytest" ,python-pytest)))
2013 (home-page "https://github.com/fschulze/pytest-warnings")
2014 (synopsis "Pytest plugin to list Python warnings in pytest report")
2016 "Python-pytest-warnings is a pytest plugin to list Python warnings in
2018 (license license:expat)
2019 (properties `((python2-variant . ,(delay python2-pytest-warnings))
2020 ;; This package is part of pytest as of version 3.1.0.
2021 (superseded . ,python-pytest)))))
2023 (define-public python2-pytest-warnings
2024 (package (inherit (package-with-python2
2025 (strip-python2-variant python-pytest-warnings)))
2026 (properties `((superseded . ,python2-pytest)))))
2028 (define-public python-pytest-capturelog
2030 (name "python-pytest-capturelog")
2035 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
2038 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
2039 (build-system python-build-system)
2041 `(("pytest" ,python-pytest)))
2042 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
2043 (synopsis "Pytest plugin to catch log messages")
2045 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
2046 (license license:expat)))
2048 (define-public python2-pytest-capturelog
2049 (package-with-python2 python-pytest-capturelog))
2051 (define-public python-pytest-catchlog
2053 (name "python-pytest-catchlog")
2058 (uri (pypi-uri "pytest-catchlog" version ".zip"))
2061 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
2062 (build-system python-build-system)
2064 `(("unzip" ,unzip)))
2066 `(("pytest" ,python-pytest)))
2067 (home-page "https://github.com/eisensheng/pytest-catchlog")
2068 (synopsis "Pytest plugin to catch log messages")
2070 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
2071 a fork of pytest-capturelog.")
2072 (license license:expat)))
2074 (define-public python2-pytest-catchlog
2075 (package-with-python2 python-pytest-catchlog))
2077 (define-public python-nosexcover
2079 (name "python-nosexcover")
2083 (uri (pypi-uri "nosexcover" version))
2086 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
2087 (build-system python-build-system)
2089 `(("python-coverage" ,python-coverage)
2090 ("python-nose" ,python-nose)))
2091 (home-page "http://github.com/cmheisel/nose-xcover")
2092 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
2093 (description "Nose-xcover is a companion to the built-in
2094 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
2095 to a file named coverage.xml.
2097 It will honor all the options you pass to the Nose coverage plugin,
2098 especially -cover-package.")
2099 (license license:expat)))
2101 (define-public python2-nosexcover
2102 (package-with-python2 python-nosexcover))
2104 (define-public python-discover
2106 (name "python-discover")
2111 (uri (pypi-uri "discover" version))
2114 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
2115 (build-system python-build-system)
2116 (home-page "https://pypi.org/project/discover/")
2118 "Python test discovery for unittest")
2120 "Discover provides test discovery for unittest, a feature that has been
2121 backported from Python 2.7 for Python 2.4+.")
2122 (license license:bsd-3)))
2124 (define-public python2-discover
2125 (package-with-python2 python-discover))
2127 (define-public behave
2133 (uri (pypi-uri "behave" version))
2136 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))
2137 (patches (search-patches
2138 "behave-skip-a-couple-of-tests.patch"))))
2139 (build-system python-build-system)
2141 `(("python-mock" ,python-mock)
2142 ("python-nose" ,python-nose)
2143 ("python-pathpy" ,python-pathpy)
2144 ("python-pyhamcrest" ,python-pyhamcrest)
2145 ("python-pytest" ,python-pytest)))
2147 `(("python-importlib-metadata" ,python-importlib-metadata)
2148 ("python-six" ,python-six)
2149 ("python-parse" ,python-parse)
2150 ("python-parse-type" ,python-parse-type)))
2152 '(#:test-target "behave_test"
2154 (modify-phases %standard-phases
2155 (add-before 'check 'fix-library-loading
2157 ;; Otherwise, tests fail with no module named 'path'
2158 (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH") ":"
2159 (getcwd) "/tasks/_vendor"))
2161 (home-page "https://github.com/behave/behave")
2162 (synopsis "Python behavior-driven development")
2164 "Behave is a tool for behavior-driven development in python.
2165 Behavior-driven development (or BDD) is an agile software development
2166 technique that encourages collaboration between developers, QA and
2167 non-technical or business participants in a software project. Behave uses
2168 tests written in a natural language style, backed up by Python code.")
2169 (license license:x11)))
2171 (define-public python-behave-web-api
2173 (name "python-behave-web-api")
2178 (uri (pypi-uri "behave-web-api" version))
2181 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
2182 (build-system python-build-system)
2185 (modify-phases %standard-phases
2186 (add-after 'unpack 'fix-dependencies
2188 (substitute* "setup.py"
2189 (("'wheel'") "") ; We don't use it.
2190 (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
2193 `(("behave" ,behave)
2194 ("python-requests" ,python-requests)))
2195 (home-page "https://github.com/jefersondaniel/behave-web-api")
2196 (synopsis "Provides testing for JSON APIs with Behave for Python")
2197 (description "This package provides testing utility modules for testing
2198 JSON APIs with Behave.")
2199 (license license:expat)))
2201 (define-public python2-behave-web-api
2202 (package-with-python2 python-behave-web-api))
2204 (define-public python-rednose
2206 (name "python-rednose")
2211 (uri (pypi-uri "rednose" version))
2214 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
2215 (build-system python-build-system)
2217 `(#:phases (modify-phases %standard-phases
2218 (add-after 'unpack 'patch-setup.py
2220 ;; Six is only required for tests and later versions
2222 (substitute* "setup.py"
2223 (("six==1.10.0") "six"))
2226 `(("python-colorama" ,python-colorama)
2227 ("python-termstyle" ,python-termstyle)))
2229 `(("python-six" ,python-six)
2230 ("python-nose" ,python-nose)))
2231 (home-page "https://github.com/JBKahn/rednose")
2232 (synopsis "Colored output for Python nosetests")
2233 (description "This package provides colored output for the
2234 @command{nosetests} command of the Python Nose unit test framework.")
2235 (license license:bsd-3)))
2237 (define-public python2-rednose
2238 (package-with-python2 python-rednose))
2240 (define-public python-nose-random
2242 (name "python-nose-random")
2248 (url "https://github.com/fzumstein/nose-random")
2250 (file-name (git-file-name name version))
2253 "1dvip61r2frjv35mv6mmfjc07402z73pjbndfp3mhxyjn2zhksw2"))))
2254 (build-system python-build-system)
2256 `(("python-nose" ,python-nose)))
2257 (home-page "https://github.com/fzumstein/nose-random")
2258 (synopsis "Nose plugin to facilitate randomized unit testing with
2260 (description "Python nose-random is designed to facilitate
2261 Monte-Carlo style unit testing. The idea is to improve testing by
2262 running your code against a large number of randomly generated input
2264 (license license:expat)))
2266 (define-public python-nose-randomly
2268 (name "python-nose-randomly")
2273 (uri (pypi-uri "nose-randomly" version))
2275 (base32 "0z662rqhfk4bjmg806mn4frb8nz4gbh7mrddsrhfffp1g4yklj3y"))))
2276 (build-system python-build-system)
2278 `(("python-nose" ,python-nose)
2279 ("python-numpy" ,python-numpy)))
2280 (home-page "https://github.com/adamchainz/nose-randomly")
2282 "Nose plugin to randomly order tests and control random.seed")
2284 "This is a @code{Nose} plugin to randomly order tests which can be quite
2285 powerful in discovering hidden flaws in the tests themselves, while helping to
2286 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
2287 by resetting it to a repeatable number for each test, enabling the tests to
2288 create data based on random numbers and yet remain repeatable.")
2289 (license license:bsd-3)))
2291 (define-public python2-nose-randomly
2292 (package-with-python2 python-nose-randomly))
2294 (define-public python-nose-timer
2296 (name "python-nose-timer")
2301 (uri (pypi-uri "nose-timer" version))
2303 (base32 "05wzkc88vbzw62pqkvhl33211b90kns0lny70b7qw62rcg4flzk4"))))
2304 (build-system python-build-system)
2306 `(("python-nose" ,python-nose)
2307 ("python-termcolor" ,python-termcolor)))
2308 (home-page "https://github.com/mahmoudimus/nose-timer")
2309 (synopsis "Timer plugin for nosetests")
2310 (description "Shows how much time was needed to run individual tests.")
2311 (license license:expat)))
2313 (define-public python2-nose-timer
2314 (package-with-python2 python-nose-timer))
2316 (define-public python-freezegun
2318 (name "python-freezegun")
2323 (uri (pypi-uri "freezegun" version))
2325 (base32 "0al75mk829j1izxi760b7yjnknjihyfhp2mvi5qiyrxb9cpxwqk2"))))
2326 (build-system python-build-system)
2328 `(("python-mock" ,python-mock)
2329 ("python-pytest" ,python-pytest)))
2331 `(("python-six" ,python-six)
2332 ("python-dateutil" ,python-dateutil)))
2335 (modify-phases %standard-phases
2336 ;; The tests are normally executed via `make test`, but the PyPi
2337 ;; package does not include the Makefile.
2340 (invoke "pytest" "-vv"))))))
2341 (home-page "https://github.com/spulec/freezegun")
2342 (synopsis "Test utility for mocking the datetime module")
2344 "FreezeGun is a library that allows your python tests to travel through
2345 time by mocking the datetime module.")
2346 (license license:asl2.0)))
2348 (define-public python2-freezegun
2349 (package-with-python2 python-freezegun))
2351 (define-public python-flexmock
2353 (name "python-flexmock")
2357 (uri (pypi-uri "flexmock" version))
2360 "0b6qw3grhgx58kxlkj7mdma7xdvlj02zabvcf7w2qifnfjwwwcsh"))))
2361 (build-system python-build-system)
2362 (home-page "https://flexmock.readthedocs.org")
2363 (synopsis "Testing library for Python")
2365 "flexmock is a testing library for Python that makes it easy to create
2366 mocks, stubs and fakes.")
2367 (license license:bsd-3)))
2369 (define-public python2-flexmock
2370 (package-with-python2 python-flexmock))
2372 (define-public python-flaky
2374 (name "python-flaky")
2378 (uri (pypi-uri "flaky" version))
2381 "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j"))))
2382 (build-system python-build-system)
2384 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2386 (home-page "https://github.com/box/flaky")
2387 (synopsis "Automatically rerun flaky tests")
2389 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2392 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2393 on components that aren't 100% reliable. With flaky, instead of removing
2394 those tests or marking them to @code{@@skip}, they can be automatically
2396 (license license:asl2.0)))
2398 (define-public python2-flaky
2399 (package-with-python2 python-flaky))
2401 (define-public python-pyhamcrest
2402 ;; The latest release was in 2016 and its test suite does not work with recent
2403 ;; versions of Pytest. Just take the master branch for now, which seems stable.
2404 (let ((commit "25fdc5f00bdf3084335353bc9247253098ec4cf2")
2407 (name "python-pyhamcrest")
2408 (version (git-version "1.9.0" revision commit))
2410 ;; Tests not distributed from pypi release.
2413 (url "https://github.com/hamcrest/PyHamcrest")
2415 (file-name (git-file-name name version))
2418 "1miqmhhi68vaix8sqc1lvpvbm27bacffxh5anm5cbfsvk7g9n6f3"))))
2419 (native-inputs ;all native inputs are for tests
2420 `(("python-pytest-cov" ,python-pytest-cov)
2421 ("python-mock" ,python-mock)
2422 ("python-pytest" ,python-pytest)
2423 ("python-hypothesis" ,python-hypothesis)))
2425 `(("python-six" ,python-six)))
2426 (build-system python-build-system)
2428 `(#:phases (modify-phases %standard-phases
2431 (setenv "PYTHONPATH"
2432 (string-append "build/lib:"
2433 (getenv "PYTHONPATH")))
2434 (invoke "pytest" "-vv"))))))
2435 (home-page "http://hamcrest.org/")
2436 (synopsis "Hamcrest matchers for Python")
2438 "PyHamcrest is a framework for writing matcher objects,
2439 allowing you to declaratively define \"match\" rules.")
2440 (license license:bsd-3))))
2442 (define-public python2-pyhamcrest
2443 (package-with-python2 python-pyhamcrest))
2445 (define-public unittest-cpp
2447 (name "unittest-cpp")
2452 (url "https://github.com/unittest-cpp/unittest-cpp")
2453 (commit (string-append "v" version))))
2454 (file-name (git-file-name name version))
2456 (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
2458 `(#:tests? #f)) ; It's run after build automatically.
2459 (build-system cmake-build-system)
2460 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2461 (synopsis "Lightweight unit testing framework for C++")
2462 (description "UnitTest++ is a lightweight unit testing framework for C++.
2463 It was designed to do test-driven development on a wide variety of platforms.
2464 Simplicity, portability, speed, and small footprint are all very important
2465 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2466 of advanced library and language features, which means it should be easily
2467 portable to just about any platform.")
2468 (license license:expat)))
2470 (define-public libfaketime
2472 (name "libfaketime")
2474 (home-page "https://github.com/wolfcw/libfaketime")
2479 (commit (string-append "v" version))))
2482 "1mfdl82ppgbdvy1ny8mb7xii7p0g7awvn4bn36jb8v4r545slmjc"))
2483 (file-name (git-file-name name version))))
2484 (build-system gnu-build-system)
2486 '(#:phases (modify-phases %standard-phases
2488 (lambda* (#:key outputs #:allow-other-keys)
2489 (let ((out (assoc-ref outputs "out")))
2491 (setenv "PREFIX" out)
2493 ;; XXX: Without this flag, the CLOCK_REALTIME test hangs
2494 ;; indefinitely. See README.packagers for more information.
2495 ;; Try removing this for future versions of libfaketime.
2496 (setenv "FAKETIME_COMPILE_CFLAGS" "-DFORCE_MONOTONIC_FIX")
2499 (add-before 'check 'pre-check
2501 (substitute* "test/functests/test_exclude_mono.sh"
2502 (("/bin/bash") (which "bash")))
2504 ;; Do not fail due to use of 'ftime', which was deprecated in
2505 ;; glibc 2.31. Remove this for later versions of libfaketime.
2506 (setenv "FAKETIME_COMPILE_CFLAGS" "-Wno-deprecated-declarations")
2508 #:test-target "test"))
2510 `(("perl" ,perl))) ;for tests
2511 (synopsis "Fake the system time for single applications")
2513 "The libfaketime library allows users to modify the system time that an
2514 application \"sees\". It is meant to be loaded using the dynamic linker's
2515 @code{LD_PRELOAD} environment variable. The @command{faketime} command
2516 provides a simple way to achieve this.")
2517 (license license:gpl2)))
2519 (define-public umockdev
2525 (uri (string-append "https://github.com/martinpitt/umockdev/"
2526 "releases/download/" version "/"
2527 "umockdev-" version ".tar.xz"))
2530 "095v3abc321s584sga04y16lcmdzsdi88h24wcrm78v7vq484g74"))))
2531 (build-system gnu-build-system)
2534 (modify-phases %standard-phases
2535 (add-after 'unpack 'fix-test
2537 (substitute* "tests/test-umockdev.c"
2542 ("gtk-doc" ,gtk-doc)
2543 ("pkg-config" ,pkg-config)
2551 ("libgudev" ,libgudev)))
2552 (home-page "https://github.com/martinpitt/umockdev/")
2553 (synopsis "Mock hardware devices for creating unit tests")
2554 (description "umockdev mocks hardware devices for creating integration
2555 tests for hardware related libraries and programs. It also provides tools to
2556 record the properties and behaviour of particular devices, and to run a
2557 program or test suite under a test bed with the previously recorded devices
2559 (license license:lgpl2.1+)))
2561 (define-public virtest
2562 ;; No releases yet, so we take the commit that "vc" expects.
2563 (let ((commit "f7d03ef39fceba168745bd29e1b20af6e7971e04")
2567 (version (git-version "0.0" revision commit))
2568 (home-page "https://github.com/mattkretz/virtest")
2571 (uri (git-reference (url home-page) (commit commit)))
2572 (file-name (git-file-name name version))
2575 "07pjyb0mk7y2w1dg1bhl26nb7416xa1mw16ifj6mmps5y6aq054l"))))
2576 (build-system cmake-build-system)
2578 `(#:phases (modify-phases %standard-phases
2579 (add-after 'unpack 'adjust-install-directory
2581 ;; Vc is the only consumer of this library, and expects
2582 ;; to find it in "virtest/vir/" instead of "vir/vir/".
2583 (substitute* "CMakeLists.txt"
2584 (("DESTINATION include/vir")
2585 "DESTINATION include/virtest"))
2587 (synopsis "Header-only test framework")
2589 "@code{virtest} is a small header-only test framework for C++. It
2590 grew out of the @dfn{Vc} project.")
2591 (license license:bsd-3))))
2593 (define-public python-pyfakefs
2595 (name "python-pyfakefs")
2599 ;; We use the PyPI URL because there is no proper release
2600 ;; available from GitHub. The GitHub project only provides
2601 ;; autogenerated tarballs, which are known to change in place.
2602 (uri (pypi-uri "pyfakefs" version))
2605 "1cp2yw96fa2qkgi39xa3nlr3inf8wb5rgh9kdq53256ca2r8pdhy"))
2606 (patches (search-patches
2607 "python-pyfakefs-remove-bad-test.patch"))
2608 (file-name (string-append name "-" version ".tar.gz"))))
2611 (modify-phases %standard-phases
2612 ;; The default test suite does not run these extra tests.
2613 (add-after 'check 'check-pytest-plugin
2616 "python" "-m" "pytest"
2617 "pyfakefs/pytest_tests/pytest_plugin_test.py")
2620 `(("python-pytest" ,python-pytest)))
2621 (build-system python-build-system)
2622 ;; Guix lint doesn't like that this is a permanent redirect to the GitHub
2623 ;; page, but the pyfakefs documentation asks us to use this specific URL
2624 ;; when linking to the project. Honor their request.
2625 (home-page "http://pyfakefs.org/")
2626 ;; TRANSLATORS: In the synopsis, "Mock" is a verb.
2627 (synopsis "Mock file system interactions in tests")
2629 "This package provides a Python library intended for use in automated
2630 tests. One difficulty when testing software is that the code under test might
2631 need to read or write to files in the local file system. If the file system
2632 is not set up in just the right way, it might cause a spurious error during
2633 the test. The pyfakefs library provides a solution to problems like this by
2634 mocking file system interactions. In other words, it arranges for the code
2635 under test to interact with a fake file system instead of the real file
2636 system. The code under test requires no modification to work with pyfakefs.")
2637 (license license:asl2.0)))
2639 (define-public python2-pyfakefs
2640 (package-with-python2 python-pyfakefs))
2642 ;; This minimal variant is used to avoid a circular dependency between
2643 ;; python2-importlib-metadata, which requires pyfakefs for its tests, and
2644 ;; python2-pytest, which requires python2-importlib-metadata.
2645 (define-public python2-pyfakefs-bootstrap
2648 (inherit python2-pyfakefs)
2649 (name "python2-pyfakefs-bootstrap")
2652 `(#:python ,python-2
2655 (define-public python-aiounittest
2657 (name "python-aiounittest")
2662 (uri (pypi-uri "aiounittest" version))
2665 "1q4bhmi80smaa1lknvdna0sx3915naczlfna1fp435nf6cjyrjl1"))))
2666 (build-system python-build-system)
2668 `(("python-coverage" ,python-coverage)
2669 ("python-nose" ,python-nose)))
2671 "https://github.com/kwarunek/aiounittest")
2672 (synopsis "Test asyncio code more easily")
2673 (description "Aiounittest is a library that helps write tests using
2674 asynchronous code in Python (asyncio).")
2675 (license license:expat)))