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>
33 ;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org>
35 ;;; This file is part of GNU Guix.
37 ;;; GNU Guix is free software; you can redistribute it and/or modify it
38 ;;; under the terms of the GNU General Public License as published by
39 ;;; the Free Software Foundation; either version 3 of the License, or (at
40 ;;; your option) any later version.
42 ;;; GNU Guix is distributed in the hope that it will be useful, but
43 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
44 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45 ;;; GNU General Public License for more details.
47 ;;; You should have received a copy of the GNU General Public License
48 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
50 (define-module (gnu packages check)
51 #:use-module (gnu packages)
52 #:use-module (gnu packages autotools)
53 #:use-module (gnu packages base)
54 #:use-module (gnu packages bash)
55 #:use-module (gnu packages compression)
56 #:use-module (gnu packages linux)
57 #:use-module (gnu packages llvm)
58 #:use-module (gnu packages glib)
59 #:use-module (gnu packages gnome)
60 #:use-module (gnu packages golang)
61 #:use-module (gnu packages gtk)
62 #:use-module (gnu packages perl)
63 #:use-module (gnu packages pkg-config)
64 #:use-module (gnu packages python)
65 #:use-module (gnu packages python-web)
66 #:use-module (gnu packages python-xyz)
67 #:use-module (gnu packages time)
68 #:use-module (guix utils)
69 #:use-module ((guix licenses) #:prefix license:)
70 #:use-module (guix packages)
71 #:use-module (guix download)
72 #:use-module (guix git-download)
73 #:use-module (guix build-system cmake)
74 #:use-module (guix build-system gnu)
75 #:use-module (guix build-system go)
76 #:use-module (guix build-system python)
77 #:use-module (guix build-system trivial))
86 (uri (string-append "https://github.com/libcheck/check/releases/download/"
87 version "/check-" version ".tar.gz"))
90 "02zkfiyklckmivrfvdsrlzvzphkdsgjrz3igncw05dv5pshhq3xx"))))
91 (build-system gnu-build-system)
92 (home-page "https://libcheck.github.io/check/")
93 (synopsis "Unit test framework for C")
95 "Check is a unit testing framework for C. It features a simple
96 interface for defining unit tests, putting little in the way of the
97 developer. Tests are run in a separate address space, so Check can
98 catch both assertion failures and code errors that cause segmentation
99 faults or other signals. The output from unit tests can be used within
100 source code editors and IDEs.")
101 (license license:lgpl2.1+)))
103 ;; Some packages require this older version. Removed once no longer needed.
104 (define-public check-0.12
110 (uri (string-append "https://github.com/libcheck/check/releases"
111 "/download/" version "/check-" version ".tar.gz"))
114 "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6"))))))
123 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
124 version "/CUnit-" version ".tar.bz2"))
127 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
128 (build-system gnu-build-system)
129 (arguments '(#:phases
130 (modify-phases %standard-phases
131 ;; XXX: The "bootstrap" phase detects the "bootstrap"
132 ;; script, but fails to execute it, so we bootstrap
135 (lambda _ (invoke "autoreconf" "-vfi"))))))
137 `(("automake" ,automake)
138 ("autoconf" ,autoconf)
139 ("libtool" ,libtool)))
140 (home-page "http://cunit.sourceforge.net/")
141 (synopsis "Automated testing framework for C")
143 "CUnit is a lightweight system for writing, administering, and running
144 unit tests in C. It provides C programmers with basic testing functionality
145 with a flexible variety of user interfaces.")
146 (license license:gpl2+)))
148 (define-public cppunit
154 (uri (string-append "http://dev-www.libreoffice.org/src/"
155 name "-" version ".tar.gz"))
158 "1027cyfx5gsjkdkaf6c2wnjh68882grw8n672018cj3vs9lrhmix"))))
159 ;; Explicitly link with libdl. This is expected to be done by packages
160 ;; relying on cppunit for their tests. However, not all of them do.
161 ;; If we added the linker flag to such packages, we would pollute all
162 ;; binaries, not only those used for testing.
164 `(#:make-flags '("LDFLAGS=-ldl")))
165 (build-system gnu-build-system)
166 (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
167 (synopsis "Unit testing framework for C++")
168 (description "CppUnit is the C++ port of the famous JUnit framework for
169 unit testing. Test output is in XML for automatic testing and GUI based for
171 (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
173 ;; When dependent packages upgraded to use newer version of catch, this one should
175 (define-public catch-framework
178 (version "1.3.5") ;Sub-minor is the build number
182 (url "https://github.com/philsquared/Catch")
184 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
185 (file-name (string-append name "-" version))
188 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
189 (build-system trivial-build-system)
191 `(#:modules ((guix build utils))
193 (use-modules (guix build utils))
194 (let* ((source (assoc-ref %build-inputs "source"))
195 (output (assoc-ref %outputs "out"))
196 (incdir (string-append output "/include"))
197 (docdir (string-append output "/share/doc/catch-"
199 (for-each mkdir-p (list incdir docdir))
200 (install-file (string-append source
201 "/single_include/catch.hpp")
203 (copy-recursively (string-append source "/docs")
206 (home-page "http://catch-lib.net/")
207 (synopsis "Automated test framework for C++ and Objective-C")
209 "Catch stands for C++ Automated Test Cases in Headers and is a
210 multi-paradigm automated test framework for C++ and Objective-C.")
211 (license license:boost1.0)))
213 (define-public catch-framework2-1
217 (home-page "https://github.com/catchorg/Catch2")
221 (url "https://github.com/catchorg/Catch2")
222 (commit (string-append "v" version))))
223 (file-name (git-file-name name version))
226 "1gdp5wm8khn02g2miz381llw3191k7309qj8s3jd6sasj01rhf23"))))
227 (build-system cmake-build-system)
228 (synopsis "Automated test framework for C++ and Objective-C")
229 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
230 a multi-paradigm automated test framework for C++ and Objective-C.")
231 (license license:boost1.0)))
233 (define-public catch-framework2
237 (home-page "https://github.com/catchorg/Catch2")
241 (url "https://github.com/catchorg/Catch2")
242 (commit (string-append "v" version))))
243 (file-name (git-file-name name version))
246 "14vcckqmbydjsg40ngi6iv999zimysh2l7fmrqj1d7xl990qz233"))))
247 (build-system cmake-build-system)
249 `(("python" ,python-wrapper)))
250 (synopsis "Automated test framework for C++ and Objective-C")
251 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
252 a multi-paradigm automated test framework for C++ and Objective-C.")
253 (license license:boost1.0)))
255 (define-public cmdtest
261 (uri (string-append "http://git.liw.fi/cmdtest/snapshot/"
262 name "-" version ".tar.gz"))
265 "1jmfiyrrqmpvwdb273bkb8hjaf4rwx9njblx29pmr7giyahskwi5"))))
266 (build-system python-build-system)
270 (modify-phases %standard-phases
271 ;; check phase needs to be run before the build phase. If not, the
272 ;; coverage test runner looks for tests for the built source files,
275 (add-before 'build 'check
278 (("/bin/sh") (which "sh")))
279 ;; yarn uses python2-ttystatus to print messages.
280 ;; python2-ttystatus requires /dev/tty which is not present in
281 ;; the build environment. Hence assuming-failure test fails.
282 (delete-file "yarn.tests/assuming-failure.script")
283 (delete-file "yarn.tests/assuming-failure.stdout")
284 (invoke "python" "setup.py" "check"))))))
286 `(("python2-coverage-test-runner" ,python2-coverage-test-runner)))
288 `(("python2-cliapp" ,python2-cliapp)
289 ("python2-markdown" ,python2-markdown)
290 ("python2-ttystatus" ,python2-ttystatus)))
291 (home-page "https://liw.fi/cmdtest/")
292 (synopsis "Black box Unix program tester")
294 "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
295 given a command line and input files, and the expected output, and it verifies
296 that the command line produces the expected output. If not, it reports a
297 problem, and shows the differences.")
298 (license license:gpl3+)))
300 (define-public cmocka
306 (uri (string-append "https://cmocka.org/files/"
307 (version-major+minor version) "/cmocka-"
311 "1dm8pdvkyfa8dsbz9bpq7wwgixjij4sii9bbn5sgvqjm5ljdik7h"))))
312 (build-system cmake-build-system)
314 `(#:tests? #f)) ; no test target
315 (home-page "https://cmocka.org/")
316 (synopsis "Unit testing framework for C")
317 (description "Cmocka is a unit testing framework for C with support for
318 mock objects. It only requires the standard C library, and works with
319 different compilers. Cmocka supports several different message output formats
320 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
322 (license license:asl2.0)))
324 (define-public cppcheck
331 (url "https://github.com/danmar/cppcheck")
333 (file-name (git-file-name name version))
335 (base32 "0h7ir2x0k005fm586dxmaphgv5cyz25k3k4sh02p7zb78gzx398h"))))
336 (build-system cmake-build-system)
338 '(#:configure-flags '("-DBUILD_TESTS=ON")))
339 (home-page "http://cppcheck.sourceforge.net")
340 (synopsis "Static C/C++ code analyzer")
341 (description "Cppcheck is a static code analyzer for C and C++. Unlike
342 C/C++ compilers and many other analysis tools it does not detect syntax errors
343 in the code. Cppcheck primarily detects the types of bugs that the compilers
344 normally do not detect. The goal is to detect only real errors in the code
345 (i.e. have zero false positives).")
346 (license license:gpl3+)))
348 (define-public cxxtest
354 (uri (string-append "mirror://sourceforge/cxxtest/cxxtest/"
355 version "/cxxtest-" version ".tar.gz"))
358 "1n7pbj4z9ivx005hqvivj9ddhq8awynzg6jishfbypf6j7ply58w"))))
359 (build-system python-build-system)
362 (modify-phases %standard-phases
363 (add-after 'unpack 'chdir-to-source
367 (add-after 'install 'install-headers
368 (lambda* (#:key outputs #:allow-other-keys)
369 (let* ((out (assoc-ref outputs "out"))
370 (include-dir (string-append out "/include/cxxtest")))
371 (for-each (lambda (header-file)
372 (install-file header-file include-dir))
373 (find-files "../cxxtest"))
375 (add-after 'install 'install-doc
376 (lambda* (#:key outputs #:allow-other-keys)
377 (let* ((out (assoc-ref outputs "out"))
378 (doc-dir (string-append out "/share/doc/cxxtest")))
379 (install-file "../README" doc-dir)
380 (install-file "../doc/guide.txt" doc-dir)
381 (copy-recursively "../sample" (string-append doc-dir "/sample"))
384 `(("python-ply" ,python-ply)))
385 (home-page "https://cxxtest.com/")
386 (synopsis "Unit testing framework for C++")
387 (description "CxxTest is a unit testing framework for C++ that is similar
388 in spirit to JUnit, CppUnit, and xUnit. CxxTest does not require precompiling
389 a CxxTest testing library, it employs no advanced features of C++ (e.g. RTTI)
390 and it supports a very flexible form of test discovery.")
391 (license license:lgpl3+)))
393 (define-public doctest
397 (home-page "https://github.com/onqtam/doctest")
400 (uri (git-reference (url home-page) (commit version)))
401 (file-name (git-file-name name version))
404 "134lx7pjnglrl4wdmyr9dz3rjb6d4ir6rvapg00gp52n44dbhnrq"))))
405 (build-system cmake-build-system)
406 (synopsis "C++ test framework")
408 "doctest is a single-header testing framework for C++11 and later. It
409 has been designed to be fast, light and unintrusive.")
410 (license license:expat)))
412 (define-public go-gopkg.in-check.v1
413 (let ((commit "788fd78401277ebd861206a03c884797c6ec5541")
416 (name "go-gopkg.in-check.v1")
417 (version (git-version "0.0.0" revision commit))
421 (url "https://github.com/go-check/check.git")
423 (file-name (git-file-name name version))
426 "0v3bim0j375z81zrpr5qv42knqs0y2qv2vkjiqi5axvb78slki1a"))))
427 (build-system go-build-system)
429 '(#:import-path "gopkg.in/check.v1"))
431 `(("go-github-com-kr-pretty" ,go-github-com-kr-pretty)))
432 (synopsis "Rich testing extension for Go's testing package")
434 "@code{check} is a rich testing extension for Go's testing package.")
435 (home-page "https://github.com/go-check/check")
436 (license license:bsd-2))))
438 (define-public go-github.com-smartystreets-gunit
440 (name "go-github.com-smartystreets-gunit")
445 (url "https://github.com/smartystreets/gunit")
447 (file-name (git-file-name name version))
450 "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
451 (build-system go-build-system)
453 '(;; TODO: This package depends on go-github.com-smartystreets-assertions
454 ;; for running the tests, but go-github.com-smartystreets-assertions
455 ;; depends on this package, so break this loop by not running the tests
458 #:import-path "github.com/smartystreets/gunit"))
459 (synopsis "Testing tool for Go, in the style of xUnit")
461 "@code{gunit} allows the test author to use a struct as the scope for a
462 group of related test cases, in the style of xUnit fixtures. This makes
463 extraction of setup/teardown behavior (as well as invoking the system under
464 test) much simpler.")
465 (home-page "https://github.com/smartystreets/gunit")
466 (license license:expat)))
468 (define-public go-github.com-smartystreets-assertions
470 (name "go-github.com-smartystreets-assertions")
475 (url "https://github.com/smartystreets/assertions")
477 (file-name (git-file-name name version))
480 "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
481 (build-system go-build-system)
483 '(#:import-path "github.com/smartystreets/assertions"))
485 `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
486 (synopsis "Assertions for testing with Go")
488 "The @code{assertions} package provides convenient assertion functions
489 for writing tests in Go.")
490 (home-page "https://github.com/smartystreets/assertions")
491 (license license:expat)))
493 (define-public go-github.com-smartystreets-goconvey
495 (name "go-github.com-smartystreets-goconvey")
500 (url "https://github.com/smartystreets/goconvey")
502 (file-name (git-file-name name version))
505 "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
506 (build-system go-build-system)
508 '(#:import-path "github.com/smartystreets/goconvey"))
510 `(("go-github.com-jtolds-gls" ,go-github.com-jtolds-gls)
511 ("go-github.com-smartystreets-assertions" ,go-github.com-smartystreets-assertions)))
512 (synopsis "Go testing tool with both a web and terminal user interface")
514 "GoConvey is a testing tool for Go. It integrates with go test, can show
515 test coverage and has a web user interface that will refresh automatically.")
516 (home-page "https://github.com/smartystreets/goconvey")
517 (license license:expat)))
519 (define-public googletest
527 (url "https://github.com/google/googletest.git")
528 (commit (string-append "release-" version))))
529 (file-name (git-file-name name version))
531 (base32 "1zbmab9295scgg4z2vclgfgjchfjailjnvzc6f5x9jvlsdi3dpwz"))))
532 (build-system cmake-build-system)
534 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
536 `(("python" ,python-wrapper)))
537 (home-page "https://github.com/google/googletest/")
538 (synopsis "Test discovery and XUnit test framework")
539 (description "Google Test features an XUnit test framework, automated test
540 discovery, death tests, assertions, parameterized tests and XML test report
542 (license license:bsd-3)))
544 (define-public googletest-1.8
551 (url "https://github.com/google/googletest.git")
552 (commit (string-append "release-" version))))
553 (file-name (git-file-name "googletest" version))
556 "0270msj6n7mggh4xqqjp54kswbl7mkcc8px1p5dqdpmw5ngh9fzk"))))))
558 (define-public cpputest
565 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
566 version "/cpputest-" version ".tar.gz"))
569 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
570 (build-system gnu-build-system)
572 `(("googletest" ,googletest)))
573 (home-page "https://cpputest.github.io/")
574 (synopsis "Unit testing and mocking framework for C/C++")
576 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
577 C++ but is used in C and C++ projects and frequently used in embedded systems
578 but it works for any C/C++ project.")
579 (license license:bsd-3)))
581 (define-public python-parameterized
583 (name "python-parameterized")
588 (uri (pypi-uri "parameterized" version))
591 "0g1q6n7fkanjv7i1djzw62f46xf573jvza7afabh3baqjqxy7rpd"))))
592 (build-system python-build-system)
594 '(#:phases (modify-phases %standard-phases
596 (lambda* (#:key tests? #:allow-other-keys)
598 (invoke "nosetests" "-v")
599 (format #t "test suite not run~%"))
602 `(("python-mock" ,python-mock)
603 ("python-nose" ,python-nose)))
604 (home-page "https://github.com/wolever/parameterized")
605 (synopsis "Parameterized testing with any Python test framework")
607 "Parameterized is a Python library that aims to fix parameterized testing
608 for every Python test framework. It supports nose, py.test, and unittest.")
609 (properties `((python2-variant . ,(delay python2-parameterized))))
610 (license license:bsd-2)))
612 (define-public python2-parameterized
613 (let ((base (package-with-python2 (strip-python2-variant
614 python-parameterized))))
619 (inherit (package-source base))
620 (patches (search-patches "python2-parameterized-docstring-test.patch")))))))
622 (define-public python-minimock
624 (name "python-minimock")
629 (uri (pypi-uri "MiniMock" version))
632 "0k2sxb1ibnyg05iblz7zhbv825f1zk9906rab7883iqgvzmdzpsz"))))
633 (build-system python-build-system)
634 (home-page "https://pypi.org/project/MiniMock")
635 (synopsis "Simple Python library for using mock objects")
636 (description "MiniMock is a simple library for building mock objects with
638 (license license:expat)))
640 (define-public python2-minimock
641 (package-with-python2 python-minimock))
643 (define-public python-mock
650 (uri (pypi-uri "mock" version))
653 "1flbpksir5sqrvq2z0dp8sl4bzbadg21sj4d42w3klpdfvgvcn5i"))))
655 `(("python-pbr" ,python-pbr-minimal)
656 ("python-six" ,python-six)))
657 (build-system python-build-system)
659 `(("python-unittest2" ,python-unittest2)))
662 (modify-phases %standard-phases
665 (zero? (system* "unit2")))))))
666 (home-page "https://github.com/testing-cabal/mock")
667 (synopsis "Python mocking and patching library for testing")
669 "Mock is a library for testing in Python. It allows you to replace parts
670 of your system under test with mock objects and make assertions about how they
672 (properties `((python2-variant . ,(delay python2-mock))))
673 (license license:expat)))
675 (define-public python2-mock
676 (let ((base (package-with-python2
677 (strip-python2-variant python-mock))))
678 (package (inherit base)
680 `(("python2-functools32" ,python2-functools32)
681 ("python2-funcsigs" ,python2-funcsigs)
682 ,@(package-propagated-inputs base))))))
684 (define-public python-nose
691 (uri (pypi-uri "nose" version))
694 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
695 (build-system python-build-system)
697 '(#:tests? #f)) ; FIXME: test suite fails
698 (home-page "http://readthedocs.org/docs/nose/")
699 (synopsis "Python testing library")
701 "Nose extends the unittest library to make testing easier.")
702 (license license:lgpl2.0+)))
704 (define-public python2-nose
705 (package-with-python2 python-nose))
707 (define-public python-nose2
709 (name "python-nose2")
714 (uri (pypi-uri "nose2" version))
717 "0pmbb6nk31yhgh4zkcblzxsznml7f7pf5q1ihgrwvbxv4mwzfql7"))))
718 (build-system python-build-system)
719 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
721 `(("python-cov-core" ,python-cov-core)
722 ("python-pytest-cov" ,python-pytest-cov)
723 ("python-six" ,python-six)))
724 (home-page "https://github.com/nose-devs/nose2")
725 (synopsis "Next generation of nicer testing for Python")
727 "Nose2 is the next generation of nicer testing for Python, based on the
728 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
729 better plugin api, being easier for users to configure, and simplifying internal
730 interfaces and processes.")
731 (license license:bsd-2)))
733 (define-public python2-nose2
734 (package-with-python2 python-nose2))
736 (define-public python-unittest2
738 (name "python-unittest2")
743 (uri (pypi-uri "unittest2" version))
745 (search-patches "python-unittest2-python3-compat.patch"
746 "python-unittest2-remove-argparse.patch"))
749 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
750 (build-system python-build-system)
753 (modify-phases %standard-phases
756 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
758 `(("python-six" ,python-six)
759 ("python-traceback2" ,python-traceback2)))
760 (home-page "https://pypi.org/project/unittest2/")
761 (synopsis "Python unit testing library")
763 "Unittest2 is a replacement for the unittest module in the Python
765 (license license:psfl)))
767 (define-public python2-unittest2
768 (package-with-python2 python-unittest2))
770 (define-public python-pytest
772 (name "python-pytest")
777 (uri (pypi-uri "pytest" version))
780 "18w38kjnffdcrlbw6ny6dksgxai6x9bxpjs2m6klqmb8hfzjkcb2"))))
781 (build-system python-build-system)
784 (modify-phases %standard-phases
787 (invoke "pytest" "-vv" "-k"
789 ;; These tests involve the /usr directory, and fails.
790 "not test_remove_dir_prefix"
791 " and not test_argcomplete"
792 ;; This test tries to override PYTHONPATH, and
793 ;; subsequently fails to locate the test libraries.
794 " and not test_collection")))))))
796 `(("python-atomicwrites" ,python-atomicwrites)
797 ("python-attrs" ,python-attrs-bootstrap)
798 ("python-more-itertools" ,python-more-itertools)
799 ("python-pluggy" ,python-pluggy)
800 ("python-py" ,python-py)
801 ("python-six" ,python-six-bootstrap)))
803 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
805 ("python-hypothesis" ,python-hypothesis)
806 ("python-nose" ,python-nose)
807 ("python-mock" ,python-mock)
808 ("python-pytest" ,python-pytest-bootstrap)
809 ("python-setuptools-scm" ,python-setuptools-scm)))
810 (home-page "https://docs.pytest.org/en/latest/")
811 (synopsis "Python testing library")
813 "Pytest is a testing tool that provides auto-discovery of test modules
814 and functions, detailed info on failing assert statements, modular fixtures,
815 and many external plugins.")
816 (license license:expat)
817 (properties `((python2-variant . ,(delay python2-pytest))))))
819 (define-public python2-pytest
820 (let ((pytest (package-with-python2
821 (strip-python2-variant python-pytest))))
825 `(("python2-funcsigs" ,python2-funcsigs)
826 ("python2-pathlib2" ,python2-pathlib2)
827 ,@(package-propagated-inputs pytest))))))
829 (define-public python-pytest-bootstrap
831 (inherit (strip-python2-variant python-pytest))
832 (name "python-pytest-bootstrap")
833 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
834 (arguments `(#:tests? #f))
835 (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
837 (define-public python2-pytest-bootstrap
838 (let ((pytest (package-with-python2
839 (strip-python2-variant python-pytest-bootstrap))))
840 (package (inherit pytest)
842 `(("python2-funcsigs" ,python2-funcsigs-bootstrap)
843 ("python2-pathlib2" ,python2-pathlib2-bootstrap)
844 ,@(package-propagated-inputs pytest))))))
846 (define-public python-pytest-cov
848 (name "python-pytest-cov")
853 (uri (pypi-uri "pytest-cov" version))
855 (base32 "0cyxbbghx2l4p60w10k00j1j74q1ngfiffr0pxn73ababjr69dha"))))
856 (build-system python-build-system)
859 (modify-phases %standard-phases
862 ;; Options taken from tox.ini.
863 ;; TODO: make "--restructuredtext" tests pass. They currently fail
864 ;; with "Duplicate implicit target name".
865 (invoke "python" "./setup.py" "check"
866 "--strict" "--metadata"))))))
868 `(("python-coverage" ,python-coverage)
869 ("python-pytest" ,python-pytest)))
870 (home-page "https://github.com/pytest-dev/pytest-cov")
871 (synopsis "Pytest plugin for measuring coverage")
873 "Pytest-cov produces coverage reports. It supports centralised testing and
874 distributed testing in both @code{load} and @code{each} modes. It also
875 supports coverage of subprocesses.")
876 (license license:expat)))
878 (define-public python2-pytest-cov
879 (package-with-python2 python-pytest-cov))
881 (define-public python-pytest-runner
883 (name "python-pytest-runner")
888 (uri (pypi-uri "pytest-runner" version))
891 "1x0d9n40lsiphblbs61rdc0d5r31f6vh0vcahqdv0mffakbnrb80"))))
892 (build-system python-build-system)
894 `(("python-pytest" ,python-pytest-bootstrap)
895 ("python-setuptools-scm" ,python-setuptools-scm)))
896 (home-page "https://github.com/pytest-dev/pytest-runner")
897 (synopsis "Invoke py.test as a distutils command")
899 "This package provides a @command{pytest-runner} command that
900 @file{setup.py} files can use to run tests.")
901 (license license:expat)))
903 (define-public python2-pytest-runner
904 (package-with-python2 python-pytest-runner))
906 ;; python-bleach 3.1.0 requires this ancient version of pytest-runner.
907 ;; Remove once no longer needed.
908 (define-public python-pytest-runner-2
914 (uri (pypi-uri "pytest-runner" version))
917 "11ivjj9hfphkv4yfb2g74av4yy86y8gcbf7gbif0p1hcdfnxg3w6"))))))
919 (define-public python2-pytest-runner-2
920 (package-with-python2 python-pytest-runner-2))
922 (define-public python-pytest-mock
924 (name "python-pytest-mock")
929 (uri (pypi-uri "pytest-mock" version))
932 "1i5mg3ff1qk0wqfcxfz60hwy3q5dskdp36i10ckigkzffg8hc3ad"))))
933 (build-system python-build-system)
935 `(("python-setuptools-scm" ,python-setuptools-scm)))
937 `(("python-pytest" ,python-pytest)))
938 (home-page "https://github.com/pytest-dev/pytest-mock/")
939 (synopsis "Thin-wrapper around the mock package for easier use with py.test")
941 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
942 around the patching API provided by the @code{mock} package, but with the
943 benefit of not having to worry about undoing patches at the end of a test.
944 The mocker fixture has the same API as @code{mock.patch}, supporting the
946 (properties `((python2-variant . ,(delay python2-pytest-mock))))
947 (license license:expat)))
949 (define-public python2-pytest-mock
950 (let ((base (package-with-python2
951 (strip-python2-variant python-pytest-mock))))
952 (package (inherit base)
954 `(("python2-mock" ,python2-mock)
955 ,@(package-propagated-inputs base))))))
957 (define-public python-pytest-xdist
959 (name "python-pytest-xdist")
964 (uri (pypi-uri "pytest-xdist" version))
967 "1d812apvcmshh2l8f38spqwb3bpp0x43yy7lyfpxxzc99h4r7y4n"))
968 (modules '((guix build utils)))
971 ;; Remove pre-compiled .pyc files from source.
972 (for-each delete-file-recursively
973 (find-files "." "__pycache__" #:directories? #t))
974 (for-each delete-file (find-files "." "\\.pyc$"))
976 (build-system python-build-system)
978 '(#:tests? #f)) ;FIXME: Some tests are failing.
980 ;; (modify-phases %standard-phases
982 ;; (add-after 'install 'check
983 ;; (lambda* (#:key inputs outputs #:allow-other-keys)
984 ;; (add-installed-pythonpath inputs outputs)
985 ;; (zero? (system* "py.test" "-v")))))
987 `(("python-setuptools-scm" ,python-setuptools-scm)))
989 `(("python-execnet" ,python-execnet)
990 ("python-pytest" ,python-pytest)
991 ("python-py" ,python-py)))
993 "https://github.com/pytest-dev/pytest-xdist")
995 "Plugin for py.test with distributed testing and loop-on-failing modes")
997 "The pytest-xdist plugin extends py.test with some unique test execution
998 modes: parallelization, running tests in boxed subprocesses, the ability
999 to run tests repeatedly when failed, and the ability to run tests on multiple
1000 Python interpreters or platforms. It uses rsync to copy the existing
1001 program code to a remote location, executes there, and then syncs the
1003 (license license:expat)))
1005 (define-public python2-pytest-xdist
1006 (package-with-python2 python-pytest-xdist))
1008 (define-public python-pytest-timeout
1010 (name "python-pytest-timeout")
1015 (uri (pypi-uri "pytest-timeout" version))
1018 "13n42azbvs5slvy2n1a9nw17r4qdq10dd68nln3jp925safa3yl0"))))
1019 (build-system python-build-system)
1021 '(#:phases (modify-phases %standard-phases
1023 (lambda* (#:key inputs outputs #:allow-other-keys)
1024 ;; Make the installed plugin discoverable by Pytest.
1025 (add-installed-pythonpath inputs outputs)
1026 (invoke "pytest" "-vv"))))))
1028 `(("python-pytest" ,python-pytest)))
1030 `(("python-pexpect" ,python-pexpect)))
1031 (home-page "http://bitbucket.org/pytest-dev/pytest-timeout/")
1032 (synopsis "Plugin for py.test to abort hanging tests")
1034 "This package provides a py.test plugin that aborts hanging tests after a
1035 timeout has been exceeded.")
1036 (license license:expat)))
1038 (define-public python-pytest-forked
1040 (name "python-pytest-forked")
1045 (uri (pypi-uri "pytest-forked" version))
1048 "000i4q7my2fq4l49n8idx2c812dql97qv6qpm2vhrrn9v6g6j18q"))))
1049 (build-system python-build-system)
1051 `(("python-pytest" ,python-pytest)))
1053 `(("python-setuptools-scm" ,python-setuptools-scm)))
1055 "https://github.com/pytest-dev/pytest-forked")
1057 "Run tests in isolated forked subprocesses")
1059 "Pytest plugin which will run each test in a subprocess and will report if
1060 a test crashed the process.")
1061 (license license:expat)))
1063 (define-public python-scripttest
1065 (name "python-scripttest")
1070 (uri (pypi-uri "scripttest" version))
1073 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
1074 (build-system python-build-system)
1076 `(("python-pytest" ,python-pytest)))
1077 (home-page (string-append "https://web.archive.org/web/20161029233413/"
1078 "http://pythonpaste.org/scripttest/"))
1079 (synopsis "Python library to test command-line scripts")
1080 (description "Scripttest is a Python helper library for testing
1081 interactive command-line applications. With it you can run a script in a
1082 subprocess and see the output as well as any file modifications.")
1083 (license license:expat)))
1085 (define-public python2-scripttest
1086 (package-with-python2 python-scripttest))
1088 (define-public python-testtools-bootstrap
1090 (name "python-testtools-bootstrap")
1095 (uri (pypi-uri "testtools" version))
1098 "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
1099 (patches (search-patches "python-testtools.patch"))))
1100 (build-system python-build-system)
1101 (arguments '(#:tests? #f))
1103 `(("python-extras" ,python-extras)
1104 ("python-fixtures" ,python-fixtures-bootstrap)
1105 ("python-mimeparse" ,python-mimeparse)
1106 ("python-pbr" ,python-pbr-minimal)
1107 ("python-six" ,python-six)
1108 ("python-traceback2" ,python-traceback2)
1109 ("python-unittest2" ,python-unittest2)))
1110 (home-page "https://github.com/testing-cabal/testtools")
1112 "Extensions to the Python standard library unit testing framework")
1114 "This package is only for bootstrapping. Do not use this.")
1115 (license license:psfl)))
1117 (define-public python2-testtools-bootstrap
1118 (package-with-python2 python-testtools-bootstrap))
1120 (define-public python-testtools
1122 (inherit python-testtools-bootstrap)
1123 (name "python-testtools")
1125 `(#:phases (modify-phases %standard-phases
1128 (invoke "python" "-m" "testtools.run"
1129 "testtools.tests.test_suite"))))))
1131 `(("python-extras" ,python-extras)
1132 ("python-fixtures" ,python-fixtures)
1133 ("python-mimeparse" ,python-mimeparse)
1134 ("python-pbr" ,python-pbr)
1135 ("python-six" ,python-six)
1136 ("python-traceback2" ,python-traceback2)
1137 ("python-unittest2" ,python-unittest2)))
1139 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
1141 "Testtools extends the Python standard library unit testing framework to
1142 provide matchers, more debugging information, and cross-Python
1145 (define-public python2-testtools
1146 (package-with-python2 python-testtools))
1148 (define-public python-testscenarios-bootstrap
1150 (name "python-testscenarios-bootstrap")
1155 (uri (pypi-uri "testscenarios" version))
1158 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
1159 (build-system python-build-system)
1161 `(#:phases (modify-phases %standard-phases
1164 (invoke "python" "-m" "testtools.run"
1165 "testscenarios.test_suite"))))))
1167 `(("python-pbr" ,python-pbr-minimal)
1168 ("python-testtools" ,python-testtools-bootstrap)))
1169 (home-page "https://launchpad.net/testscenarios")
1170 (synopsis "Pyunit extension for dependency injection")
1172 "This package is only for bootstrapping. Don't use this.")
1173 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1175 (define-public python2-testscenarios-bootstrap
1176 (package-with-python2 python-testscenarios-bootstrap))
1178 (define-public python-testscenarios
1180 (inherit python-testscenarios-bootstrap)
1181 (name "python-testscenarios")
1183 `(("python-pbr" ,python-pbr)
1184 ("python-testtools" ,python-testtools)))
1186 "Testscenarios provides clean dependency injection for Python unittest
1189 (define-public python2-testscenarios
1190 (package-with-python2 python-testscenarios))
1192 ;; Testresources requires python-pbr at runtime, but pbr needs it for its
1193 ;; own tests. Hence this bootstrap variant.
1194 (define-public python-testresources-bootstrap
1196 (name "python-testresources-bootstrap")
1200 (uri (pypi-uri "testresources" version))
1203 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
1204 (build-system python-build-system)
1205 (arguments '(#:tests? #f))
1207 `(("python-pbr" ,python-pbr-minimal)))
1208 (home-page "https://launchpad.net/testresources")
1210 "Pyunit extension for managing test resources")
1212 "This package is only here for bootstrapping purposes. Use the regular
1213 testresources package instead.")
1214 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1216 (define-public python2-testresources-bootstrap
1217 (package-with-python2 python-testresources-bootstrap))
1219 (define-public python-testresources
1221 (inherit python-testresources-bootstrap)
1222 (name "python-testresources")
1224 `(("python-pbr" ,python-pbr)))
1227 `(("python-fixtures" ,python-fixtures)
1228 ("python-testtols" ,python-testtools)))
1230 "Testresources is an extension to Python's unittest to allow declarative
1231 use of resources by test cases.")))
1233 (define-public python2-testresources
1234 (package-with-python2 python-testresources))
1236 (define-public python-subunit-bootstrap
1238 (name "python-subunit-bootstrap")
1243 (uri (pypi-uri "python-subunit" version))
1246 "1fsw8rsn1s3nklx06mayrg5rn2zbky6wwjc5z07s7rf1wjzfs1wn"))))
1247 (build-system python-build-system)
1249 `(("python-extras" ,python-extras)
1250 ("python-testtools" ,python-testtools-bootstrap)))
1252 `(("python-fixtures" ,python-fixtures-bootstrap)
1253 ("python-hypothesis" ,python-hypothesis)
1254 ("python-testscenarios" ,python-testscenarios-bootstrap)))
1255 (home-page "https://launchpad.net/subunit")
1256 (synopsis "Python implementation of the subunit protocol")
1258 "This package is here for bootstrapping purposes only. Use the regular
1259 python-subunit package instead.")
1260 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1262 (define-public python2-subunit-bootstrap
1263 (package-with-python2 python-subunit-bootstrap))
1265 (define-public python-subunit
1267 (inherit python-subunit-bootstrap)
1268 (name "python-subunit")
1270 `(("python-extras" ,python-extras)
1271 ("python-testtools" ,python-testtools)))
1273 `(("python-fixtures" ,python-fixtures)
1274 ("python-hypothesis" ,python-hypothesis)
1275 ("python-testscenarios" ,python-testscenarios)))
1277 "Python-subunit is a Python implementation of the subunit test streaming
1280 (define-public python2-subunit
1281 (package-with-python2 python-subunit))
1283 ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
1284 ;; own tests. Hence this bootstrap variant.
1285 (define-public python-fixtures-bootstrap
1287 (name "python-fixtures-bootstrap")
1291 (uri (pypi-uri "fixtures" version))
1294 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
1295 (build-system python-build-system)
1296 (arguments `(#:tests? #f))
1298 `(("python-pbr-minimal" ,python-pbr-minimal)
1299 ("python-six" ,python-six)))
1300 (home-page "https://launchpad.net/python-fixtures")
1301 (synopsis "Python test fixture library")
1303 "This package is only used for bootstrapping. Use the regular
1304 python-fixtures package instead.")
1305 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1307 (define-public python2-fixtures-bootstrap
1308 (package-with-python2 python-fixtures-bootstrap))
1310 (define-public python-fixtures
1312 (inherit python-fixtures-bootstrap)
1313 (name "python-fixtures")
1316 (modify-phases %standard-phases
1319 (invoke "python" "-m" "testtools.run"
1320 "fixtures.test_suite"))))))
1322 ;; Fixtures uses pbr at runtime to check versions, etc.
1323 `(("python-pbr" ,python-pbr)
1324 ("python-six" ,python-six)))
1326 `(("python-mock" ,python-mock)
1327 ("python-testtools" ,python-testtools-bootstrap)))
1329 "Fixtures provides a way to create reusable state, useful when writing
1332 (define-public python2-fixtures
1333 (package-with-python2 python-fixtures))
1335 (define-public python-testrepository-bootstrap
1337 (name "python-testrepository-bootstrap")
1342 (uri (pypi-uri "testrepository" version))
1345 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1346 (build-system python-build-system)
1347 (arguments '(#:tests? #f))
1349 `(("python-fixtures" ,python-fixtures-bootstrap)
1350 ("python-subunit" ,python-subunit-bootstrap)
1351 ("python-testtools" ,python-testtools-bootstrap)))
1353 `(("python-mimeparse" ,python-mimeparse)))
1354 (home-page "https://launchpad.net/testrepository")
1355 (synopsis "Database for Python test results")
1357 "Bootstrap package for python-testrepository. Don't use this.")
1358 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1360 (define-public python2-testrepository-bootstrap
1361 (package-with-python2 python-testrepository-bootstrap))
1363 (define-public python-testrepository
1365 (inherit python-testrepository-bootstrap)
1366 (name "python-testrepository")
1368 ;; FIXME: Many tests are failing.
1371 `(("python-fixtures" ,python-fixtures)
1372 ("python-subunit" ,python-subunit)
1373 ("python-testtools" ,python-testtools)))
1375 `(("python-mimeparse" ,python-mimeparse)))
1376 (description "Testrepository provides a database of test results which can
1377 be used as part of a developer's workflow to check things such as what tests
1378 have failed since the last commit or what tests are currently failing.")))
1380 (define-public python2-testrepository
1381 (package-with-python2 python-testrepository))
1383 (define-public python-coverage
1385 (name "python-coverage")
1390 (uri (pypi-uri "coverage" version))
1393 "02f6m073qdispn96rc616hg0rnmw1pgqzw3bgxwiwza4zf9hirlx"))))
1394 (build-system python-build-system)
1396 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1398 (home-page "http://nedbatchelder.com/code/coverage")
1399 (synopsis "Code coverage measurement for Python")
1401 "Coverage measures code coverage, typically during test execution. It
1402 uses the code analysis tools and tracing hooks provided in the Python standard
1403 library to determine which lines are executable, and which have been
1405 (license license:bsd-3)))
1407 (define-public python2-coverage
1408 (package-with-python2 python-coverage))
1410 (define-public python-cov-core
1412 (name "python-cov-core")
1417 (uri (pypi-uri "cov-core" version))
1420 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1421 (build-system python-build-system)
1423 `(("python-coverage" ,python-coverage)))
1424 (home-page "https://github.com/schlamar/cov-core")
1425 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
1427 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1428 and @code{nose2-cov}. It is useful for developing coverage plugins for these
1429 testing frameworks.")
1430 (license license:expat)))
1432 (define-public python2-cov-core
1433 (package-with-python2 python-cov-core))
1435 (define-public python-codecov
1437 (name "python-codecov")
1442 (uri (pypi-uri "codecov" version))
1445 "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1446 (build-system python-build-system)
1448 `(("python-unittest2" ,python-unittest2)))
1450 `(("python-coverage" ,python-coverage)
1451 ("python-requests" ,python-requests)))
1452 (home-page "http://github.com/codecov/codecov-python")
1453 (synopsis "Upload code coverage reports to @code{codecov.io}")
1455 "Codecov collects code coverage reports from code written in Python, Java,
1456 C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
1457 (license license:asl2.0)))
1459 (define-public python-testpath
1461 (name "python-testpath")
1467 (url "https://github.com/jupyter/testpath")
1469 (file-name (git-file-name name version))
1472 "0r4iiizjql6ny1ln7ciw7rrbjadz1s9zrf2hl0xkgnh3ypd8936f"))))
1473 (build-system python-build-system)
1475 `(#:tests? #f ; this package does not even have a setup.py
1476 #:modules ((guix build python-build-system)
1480 (modify-phases %standard-phases
1483 (lambda* (#:key inputs outputs #:allow-other-keys)
1484 (let* ((version (last
1485 (string-split (assoc-ref inputs "python") #\-)))
1486 (x.y (string-join (take (string-split version #\.) 2)
1489 (assoc-ref outputs "out")
1490 "/lib/python" x.y "/site-packages/testpath")))
1492 (copy-recursively "testpath" dir))
1494 (home-page "https://github.com/takluyver/testpath")
1495 (synopsis "Test utilities for code working with files and commands")
1497 "Testpath is a collection of utilities for Python code working with files
1498 and commands. It contains functions to check things on the file system, and
1499 tools for mocking system commands and recording calls to those.")
1500 (license license:expat)))
1502 (define-public python2-testpath
1503 (package-with-python2 python-testpath))
1505 (define-public python-testlib
1507 (name "python-testlib")
1512 (uri (pypi-uri "testlib" version ".zip"))
1514 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1515 (build-system python-build-system)
1517 `(("unzip" ,unzip))) ; for unpacking the source
1518 (synopsis "Python micro test suite harness")
1519 (description "A micro unittest suite harness for Python.")
1520 (home-page "https://github.com/trentm/testlib")
1521 (license license:expat)))
1523 (define-public python2-testlib
1524 (package-with-python2 python-testlib))
1526 ;;; The software provided by this package was integrated into pytest 2.8.
1527 (define-public python-pytest-cache
1529 (name "python-pytest-cache")
1533 (uri (pypi-uri "pytest-cache" version))
1536 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1537 (build-system python-build-system)
1539 `(("python-apipkg" ,python-apipkg)
1540 ("python-execnet" ,python-execnet)
1541 ("python-py" ,python-py)
1542 ("python-pytest" ,python-pytest)))
1543 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1544 (description "The pytest-cache plugin provides tools to rerun failures from
1545 the last py.test invocation.")
1546 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1547 (license license:expat)))
1549 (define-public python2-pytest-cache
1550 (package-with-python2 python-pytest-cache))
1552 (define-public python-pytest-localserver
1554 (name "python-pytest-localserver")
1558 (uri (pypi-uri "pytest-localserver" version))
1561 "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
1562 (build-system python-build-system)
1565 (modify-phases %standard-phases
1568 (invoke "py.test" "-v"))))))
1570 `(("python-pytest" ,python-pytest)
1571 ("python-requests" ,python-requests)
1572 ("python-six" ,python-six)))
1574 `(("python-werkzeug" ,python-werkzeug)))
1575 (synopsis "Py.test plugin to test server connections locally")
1576 (description "Pytest-localserver is a plugin for the pytest testing
1577 framework which enables you to test server connections locally.")
1578 (home-page "https://pypi.org/project/pytest-localserver/")
1579 (license license:expat)))
1581 (define-public python-pytest-xprocess
1583 (name "python-pytest-xprocess")
1587 (uri (pypi-uri "pytest-xprocess" version))
1590 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1591 (build-system python-build-system)
1593 `(("python-pytest" ,python-pytest)
1594 ("python-pytest-cache" ,python-pytest-cache)
1595 ("python-psutil" ,python-psutil)))
1596 (synopsis "Pytest plugin to manage external processes across test runs")
1597 (description "Pytest-xprocess is an experimental py.test plugin for managing
1598 processes across test runs.")
1599 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1600 (license license:expat)))
1602 (define-public python-pytest-subtesthack
1604 (name "python-pytest-subtesthack")
1608 (uri (pypi-uri "pytest-subtesthack" version))
1611 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1612 (build-system python-build-system)
1614 `(("python-pytest" ,python-pytest)))
1615 (synopsis "Set-up and tear-down fixtures for unit tests")
1616 (description "This plugin allows you to set up and tear down fixtures within
1617 unit test functions that use @code{py.test}. This is useful for using
1618 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1619 function multiple times, without setting up or tearing down fixture state as is
1620 normally the case.")
1621 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1622 (license license:unlicense)))
1624 (define-public python2-pytest-subtesthack
1625 (package-with-python2 python-pytest-subtesthack))
1627 (define-public python-pytest-sugar
1629 (name "python-pytest-sugar")
1634 (uri (pypi-uri "pytest-sugar" version))
1637 "1asq7yc4g8bx2sn7yy974mhc9ywvaihasjab4inkirdwn9s7mn7w"))))
1638 (build-system python-build-system)
1640 `(("python-packaging" ,python-packaging)
1641 ("python-pytest" ,python-pytest)
1642 ("python-termcolor" ,python-termcolor)))
1643 (home-page "https://pivotfinland.com/pytest-sugar/")
1644 (synopsis "Plugin for pytest that changes the default look and feel")
1646 "@code{pytest-sugar} is a plugin for py.test that changes the default
1647 look and feel of py.test, using a progress bar and showing failures and errors
1649 (license license:bsd-3)))
1651 (define-public python-hypothesis
1653 (name "python-hypothesis")
1657 (uri (pypi-uri "hypothesis" version))
1660 "0a35nwqyjnm4cphi43xracqpkws0ip61mndvqb1iqq7gkva83lb1"))))
1661 (build-system python-build-system)
1663 `(("python-flake8" ,python-flake8)
1664 ("python-pytest" ,python-pytest-bootstrap)))
1666 `(("python-attrs" ,python-attrs-bootstrap)
1667 ("python-coverage" ,python-coverage)))
1668 (synopsis "Library for property based testing")
1669 (description "Hypothesis is a library for testing your Python code against a
1670 much larger range of examples than you would ever want to write by hand. It’s
1671 based on the Haskell library, Quickcheck, and is designed to integrate
1672 seamlessly into your existing Python unit testing work flow.")
1673 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
1674 (license license:mpl2.0)
1675 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1677 (define-public python2-hypothesis
1678 (let ((hypothesis (package-with-python2
1679 (strip-python2-variant python-hypothesis))))
1680 (package (inherit hypothesis)
1682 `(("python2-enum34" ,python2-enum34)
1683 ,@(package-propagated-inputs hypothesis))))))
1685 (define-public python-lit
1692 (uri (pypi-uri "lit" version))
1695 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
1696 (build-system python-build-system)
1699 (modify-phases %standard-phases
1702 (invoke "python" "lit.py" "tests"))))))
1705 (home-page "https://llvm.org/")
1706 (synopsis "LLVM Software Testing Tool")
1707 (description "@code{lit} is a portable tool for executing LLVM and Clang
1708 style test suites, summarizing their results, and providing indication of
1710 (license license:ncsa)))
1712 (define-public python2-lit
1713 (package-with-python2 python-lit))
1715 (define-public python-pytest-pep8
1717 (name "python-pytest-pep8")
1721 (uri (pypi-uri "pytest-pep8" version))
1724 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
1725 (build-system python-build-system)
1727 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
1729 `(("python-pytest" ,python-pytest)))
1731 `(("python-pep8" ,python-pep8)))
1732 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
1733 (synopsis "Py.test plugin to check PEP8 requirements")
1734 (description "Pytest plugin for checking PEP8 compliance.")
1735 (license license:expat)))
1737 (define-public python2-pytest-pep8
1738 (package-with-python2 python-pytest-pep8))
1740 (define-public python-pytest-flakes
1742 (name "python-pytest-flakes")
1746 (uri (pypi-uri "pytest-flakes" version))
1749 "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
1750 (build-system python-build-system)
1753 (modify-phases %standard-phases
1755 (add-after 'install 'check
1756 (lambda* (#:key outputs inputs #:allow-other-keys)
1757 ;; It's easier to run tests after install.
1758 ;; Make installed package available for running the tests
1759 (add-installed-pythonpath inputs outputs)
1760 (invoke "py.test" "-vv"))))))
1762 `(("python-coverage" ,python-coverage)
1763 ("python-pytest" ,python-pytest)
1764 ("python-pytest-cache" ,python-pytest-cache)
1765 ("python-pytest-pep8" ,python-pytest-pep8)))
1767 `(("python-pyflakes" ,python-pyflakes)))
1768 (home-page "https://github.com/fschulze/pytest-flakes")
1769 (synopsis "Py.test plugin to check source code with pyflakes")
1770 (description "Pytest plugin for checking Python source code with pyflakes.")
1771 (license license:expat)))
1773 (define-public python2-pytest-flakes
1774 (package-with-python2 python-pytest-flakes))
1776 (define-public python2-coverage-test-runner
1778 (name "python2-coverage-test-runner")
1784 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
1785 "coverage-test-runner/snapshot/coverage-test-runner-"
1789 "1kjjb9llckycnfxag8zcvqsn4z1s3dwyw6b1n0avxydihgf30rny"))))
1790 (build-system python-build-system)
1792 `(#:python ,python-2
1794 (modify-phases %standard-phases
1797 (invoke "./testrun"))))))
1799 `(("python2-coverage" ,python2-coverage)))
1800 (home-page "https://liw.fi/coverage-test-runner/")
1801 (synopsis "Python module for running unit tests")
1802 (description "@code{CoverageTestRunner} is a python module for running
1803 unit tests and failing them if the unit test module does not exercise all
1804 statements in the module it tests.")
1805 (license license:gpl3+)))
1807 ;; Further releases, up to 2.4.3, have failing unit tests. See:
1808 ;; https://github.com/PyCQA/pylint/issues/3198.
1809 (define-public python-pylint
1811 (name "python-pylint")
1817 (url "https://github.com/PyCQA/pylint")
1818 (commit (string-append "pylint-" version))))
1819 (file-name (git-file-name name version))
1822 "17vvzbcqmkhr4icq5p3737nbiiyj1y3g1pa08n9mb1bsnvxmqq0z"))))
1823 (build-system python-build-system)
1825 `(("python-pytest" ,python-pytest)
1826 ("python-pytest-runner" ,python-pytest-runner)
1827 ("python-tox" ,python-tox)))
1829 `(("python-astroid" ,python-astroid)
1830 ("python-isort" ,python-isort)
1831 ("python-mccabe" ,python-mccabe)
1832 ("python-six" ,python-six)))
1833 (home-page "https://github.com/PyCQA/pylint")
1834 (synopsis "Python source code analyzer which looks for coding standard
1836 (description "Pylint is a Python source code analyzer which looks
1837 for programming errors, helps enforcing a coding standard and sniffs
1838 for some code smells (as defined in Martin Fowler's Refactoring book).
1840 Pylint has many rules enabled by default, way too much to silence them
1841 all on a minimally sized program. It's highly configurable and handle
1842 pragmas to control it from within your code. Additionally, it is
1843 possible to write plugins to add your own checks.")
1844 (properties `((python2-variant . ,(delay python2-pylint))))
1845 (license license:gpl2+)))
1847 ;; Python2 is not supported anymore by Pylint. See:
1848 ;; https://github.com/PyCQA/pylint/issues/1763.
1849 (define-public python2-pylint
1850 (let ((pylint (package-with-python2
1851 (strip-python2-variant python-pylint))))
1852 (package (inherit pylint)
1858 (url "https://github.com/PyCQA/pylint")
1859 (commit (string-append "pylint-" version))))
1860 (file-name (git-file-name (package-name pylint) version))
1863 "02a89d8a47s7nfiv1ady3j0sg2sbyja3np145brarfp5x9qxz9x2"))))
1865 `(,@(package-arguments pylint)
1867 (modify-phases %standard-phases
1870 ;; Somehow, tests fail if run from the build directory.
1871 (let ((work "/tmp/work"))
1873 (setenv "PYTHONPATH"
1874 (string-append (getenv "PYTHONPATH") ":" work))
1875 (copy-recursively "." work)
1876 (with-directory-excursion "/tmp"
1877 (invoke "python" "-m" "unittest" "discover"
1878 "-s" (string-append work "/pylint/test")
1879 "-p" "*test_*.py"))))))))
1881 `(("python2-futures" ,python2-futures)
1882 ,@(package-native-inputs pylint)))
1884 `(("python2-backports-functools-lru-cache"
1885 ,python2-backports-functools-lru-cache)
1886 ("python2-configparser" ,python2-configparser)
1887 ,@(package-propagated-inputs pylint))))))
1889 (define-public python-paramunittest
1891 (name "python-paramunittest")
1896 (uri (pypi-uri "ParamUnittest" version))
1899 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
1900 (build-system python-build-system)
1902 "https://github.com/rik0/ParamUnittest")
1904 "Simple extension to have parametrized unit tests")
1906 "This package creates parameterized unit-tests that work with the standard
1907 unittest package. A parameterized test case is automatically converted to multiple test
1908 cases. Since they are TestCase subclasses, they work with other test suites that
1909 recognize TestCases.")
1910 (license license:bsd-2)))
1912 (define-public python2-python-paramunittest
1913 (package-with-python2 python-paramunittest))
1915 (define-public python-pytest-warnings
1917 (name "python-pytest-warnings")
1922 (uri (pypi-uri "pytest-warnings" version))
1925 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
1926 (build-system python-build-system)
1928 `(("pytest" ,python-pytest)))
1929 (home-page "https://github.com/fschulze/pytest-warnings")
1930 (synopsis "Pytest plugin to list Python warnings in pytest report")
1932 "Python-pytest-warnings is a pytest plugin to list Python warnings in
1934 (license license:expat)
1935 (properties `((python2-variant . ,(delay python2-pytest-warnings))
1936 ;; This package is part of pytest as of version 3.1.0.
1937 (superseded . ,python-pytest)))))
1939 (define-public python2-pytest-warnings
1940 (package (inherit (package-with-python2
1941 (strip-python2-variant python-pytest-warnings)))
1942 (properties `((superseded . ,python2-pytest)))))
1944 (define-public python-pytest-capturelog
1946 (name "python-pytest-capturelog")
1951 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
1954 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
1955 (build-system python-build-system)
1957 `(("pytest" ,python-pytest)))
1958 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
1959 (synopsis "Pytest plugin to catch log messages")
1961 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
1962 (license license:expat)))
1964 (define-public python2-pytest-capturelog
1965 (package-with-python2 python-pytest-capturelog))
1967 (define-public python-pytest-catchlog
1969 (name "python-pytest-catchlog")
1974 (uri (pypi-uri "pytest-catchlog" version ".zip"))
1977 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
1978 (build-system python-build-system)
1980 `(("unzip" ,unzip)))
1982 `(("pytest" ,python-pytest)))
1983 (home-page "https://github.com/eisensheng/pytest-catchlog")
1984 (synopsis "Pytest plugin to catch log messages")
1986 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
1987 a fork of pytest-capturelog.")
1988 (license license:expat)))
1990 (define-public python2-pytest-catchlog
1991 (package-with-python2 python-pytest-catchlog))
1993 (define-public python-nosexcover
1995 (name "python-nosexcover")
1999 (uri (pypi-uri "nosexcover" version))
2002 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
2003 (build-system python-build-system)
2005 `(("python-coverage" ,python-coverage)
2006 ("python-nose" ,python-nose)))
2007 (home-page "http://github.com/cmheisel/nose-xcover")
2008 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
2009 (description "Nose-xcover is a companion to the built-in
2010 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
2011 to a file named coverage.xml.
2013 It will honor all the options you pass to the Nose coverage plugin,
2014 especially -cover-package.")
2015 (license license:expat)))
2017 (define-public python2-nosexcover
2018 (package-with-python2 python-nosexcover))
2020 (define-public python-discover
2022 (name "python-discover")
2027 (uri (pypi-uri "discover" version))
2030 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
2031 (build-system python-build-system)
2032 (home-page "https://pypi.org/project/discover/")
2034 "Python test discovery for unittest")
2036 "Discover provides test discovery for unittest, a feature that has been
2037 backported from Python 2.7 for Python 2.4+.")
2038 (license license:bsd-3)))
2040 (define-public python2-discover
2041 (package-with-python2 python-discover))
2043 (define-public behave
2049 (uri (pypi-uri "behave" version))
2052 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))))
2053 (build-system python-build-system)
2055 `(("python-mock" ,python-mock)
2056 ("python-nose" ,python-nose)
2057 ("python-pathpy" ,python-pathpy)
2058 ("python-pyhamcrest" ,python-pyhamcrest)
2059 ("python-pytest" ,python-pytest)))
2061 `(("python-importlib-metadata" ,python-importlib-metadata)
2062 ("python-six" ,python-six)
2063 ("python-parse" ,python-parse)
2064 ("python-parse-type" ,python-parse-type)))
2066 '(#:test-target "behave_test"
2068 (modify-phases %standard-phases
2069 (add-before 'check 'fix-library-loading
2071 ;; Otherwise, tests fail with no module named 'path'
2072 (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH") ":"
2073 (getcwd) "/tasks/_vendor"))
2075 (home-page "https://github.com/behave/behave")
2076 (synopsis "Python behavior-driven development")
2078 "Behave is a tool for behavior-driven development in python.
2079 Behavior-driven development (or BDD) is an agile software development
2080 technique that encourages collaboration between developers, QA and
2081 non-technical or business participants in a software project. Behave uses
2082 tests written in a natural language style, backed up by Python code.")
2083 (license license:x11)))
2085 (define-public python-behave-web-api
2087 (name "python-behave-web-api")
2092 (uri (pypi-uri "behave-web-api" version))
2095 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
2096 (build-system python-build-system)
2099 (modify-phases %standard-phases
2100 (add-after 'unpack 'fix-dependencies
2102 (substitute* "setup.py"
2103 (("'wheel'") "") ; We don't use it.
2104 (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
2107 `(("behave" ,behave)
2108 ("python-requests" ,python-requests)))
2109 (home-page "https://github.com/jefersondaniel/behave-web-api")
2110 (synopsis "Provides testing for JSON APIs with Behave for Python")
2111 (description "This package provides testing utility modules for testing
2112 JSON APIs with Behave.")
2113 (license license:expat)))
2115 (define-public python2-behave-web-api
2116 (package-with-python2 python-behave-web-api))
2118 (define-public python-rednose
2120 (name "python-rednose")
2125 (uri (pypi-uri "rednose" version))
2128 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
2129 (build-system python-build-system)
2131 `(#:phases (modify-phases %standard-phases
2132 (add-after 'unpack 'patch-setup.py
2134 ;; Six is only required for tests and later versions
2136 (substitute* "setup.py"
2137 (("six==1.10.0") "six"))
2140 `(("python-colorama" ,python-colorama)
2141 ("python-termstyle" ,python-termstyle)))
2143 `(("python-six" ,python-six)
2144 ("python-nose" ,python-nose)))
2145 (home-page "https://github.com/JBKahn/rednose")
2146 (synopsis "Colored output for Python nosetests")
2147 (description "This package provides colored output for the
2148 @command{nosetests} command of the Python Nose unit test framework.")
2149 (license license:bsd-3)))
2151 (define-public python2-rednose
2152 (package-with-python2 python-rednose))
2154 (define-public python-nose-random
2156 (name "python-nose-random")
2162 (url "https://github.com/fzumstein/nose-random")
2164 (file-name (git-file-name name version))
2167 "1dvip61r2frjv35mv6mmfjc07402z73pjbndfp3mhxyjn2zhksw2"))))
2168 (build-system python-build-system)
2170 `(("python-nose" ,python-nose)))
2171 (home-page "https://github.com/fzumstein/nose-random")
2172 (synopsis "Nose plugin to facilitate randomized unit testing with
2174 (description "Python nose-random is designed to facilitate
2175 Monte-Carlo style unit testing. The idea is to improve testing by
2176 running your code against a large number of randomly generated input
2178 (license license:expat)))
2180 (define-public python-nose-randomly
2182 (name "python-nose-randomly")
2187 (uri (pypi-uri "nose-randomly" version))
2189 (base32 "0z662rqhfk4bjmg806mn4frb8nz4gbh7mrddsrhfffp1g4yklj3y"))))
2190 (build-system python-build-system)
2192 `(("python-nose" ,python-nose)
2193 ("python-numpy" ,python-numpy)))
2194 (home-page "https://github.com/adamchainz/nose-randomly")
2196 "Nose plugin to randomly order tests and control random.seed")
2198 "This is a @code{Nose} plugin to randomly order tests which can be quite
2199 powerful in discovering hidden flaws in the tests themselves, while helping to
2200 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
2201 by resetting it to a repeatable number for each test, enabling the tests to
2202 create data based on random numbers and yet remain repeatable.")
2203 (license license:bsd-3)))
2205 (define-public python2-nose-randomly
2206 (package-with-python2 python-nose-randomly))
2208 (define-public python-nose-timer
2210 (name "python-nose-timer")
2215 (uri (pypi-uri "nose-timer" version))
2217 (base32 "05wzkc88vbzw62pqkvhl33211b90kns0lny70b7qw62rcg4flzk4"))))
2218 (build-system python-build-system)
2220 `(("python-nose" ,python-nose)
2221 ("python-termcolor" ,python-termcolor)))
2222 (home-page "https://github.com/mahmoudimus/nose-timer")
2223 (synopsis "Timer plugin for nosetests")
2224 (description "Shows how much time was needed to run individual tests.")
2225 (license license:expat)))
2227 (define-public python2-nose-timer
2228 (package-with-python2 python-nose-timer))
2230 (define-public python-freezegun
2232 (name "python-freezegun")
2237 (uri (pypi-uri "freezegun" version))
2239 (base32 "1rx57v8ryjncjimg8hys9kx1r3rknvwcl4y340g20jn0sf69qk9a"))))
2240 (build-system python-build-system)
2242 `(("python-mock" ,python-mock)
2243 ("python-pytest" ,python-pytest)))
2245 `(("python-six" ,python-six)
2246 ("python-dateutil" ,python-dateutil)))
2249 (modify-phases %standard-phases
2250 ;; The tests are normally executed via `make test`, but the PyPi
2251 ;; package does not include the Makefile.
2254 (invoke "pytest" "-vv"))))))
2255 (home-page "https://github.com/spulec/freezegun")
2256 (synopsis "Test utility for mocking the datetime module")
2258 "FreezeGun is a library that allows your python tests to travel through
2259 time by mocking the datetime module.")
2260 (license license:asl2.0)))
2262 (define-public python2-freezegun
2263 (package-with-python2 python-freezegun))
2265 (define-public python-flexmock
2267 (name "python-flexmock")
2271 (uri (pypi-uri "flexmock" version))
2274 "0b6qw3grhgx58kxlkj7mdma7xdvlj02zabvcf7w2qifnfjwwwcsh"))))
2275 (build-system python-build-system)
2276 (home-page "https://flexmock.readthedocs.org")
2277 (synopsis "Testing library for Python")
2279 "flexmock is a testing library for Python that makes it easy to create
2280 mocks, stubs and fakes.")
2281 (license license:bsd-3)))
2283 (define-public python2-flexmock
2284 (package-with-python2 python-flexmock))
2286 (define-public python-flaky
2288 (name "python-flaky")
2292 (uri (pypi-uri "flaky" version))
2295 "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j"))))
2296 (build-system python-build-system)
2298 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2300 (home-page "https://github.com/box/flaky")
2301 (synopsis "Automatically rerun flaky tests")
2303 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2306 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2307 on components that aren't 100% reliable. With flaky, instead of removing
2308 those tests or marking them to @code{@@skip}, they can be automatically
2310 (license license:asl2.0)))
2312 (define-public python2-flaky
2313 (package-with-python2 python-flaky))
2315 (define-public python-pyhamcrest
2316 ;; The latest release was in 2016 and its test suite does not work with recent
2317 ;; versions of Pytest. Just take the master branch for now, which seems stable.
2318 (let ((commit "25fdc5f00bdf3084335353bc9247253098ec4cf2")
2321 (name "python-pyhamcrest")
2322 (version (git-version "1.9.0" revision commit))
2324 ;; Tests not distributed from pypi release.
2327 (url "https://github.com/hamcrest/PyHamcrest")
2329 (file-name (git-file-name name version))
2332 "1miqmhhi68vaix8sqc1lvpvbm27bacffxh5anm5cbfsvk7g9n6f3"))))
2333 (native-inputs ;all native inputs are for tests
2334 `(("python-pytest-cov" ,python-pytest-cov)
2335 ("python-mock" ,python-mock)
2336 ("python-pytest" ,python-pytest)
2337 ("python-hypothesis" ,python-hypothesis)))
2339 `(("python-six" ,python-six)))
2340 (build-system python-build-system)
2342 `(#:phases (modify-phases %standard-phases
2345 (setenv "PYTHONPATH"
2346 (string-append "build/lib:"
2347 (getenv "PYTHONPATH")))
2348 (invoke "pytest" "-vv"))))))
2349 (home-page "http://hamcrest.org/")
2350 (synopsis "Hamcrest matchers for Python")
2352 "PyHamcrest is a framework for writing matcher objects,
2353 allowing you to declaratively define \"match\" rules.")
2354 (license license:bsd-3))))
2356 (define-public python2-pyhamcrest
2357 (package-with-python2 python-pyhamcrest))
2359 (define-public unittest-cpp
2361 (name "unittest-cpp")
2366 (url "https://github.com/unittest-cpp/unittest-cpp")
2367 (commit (string-append "v" version))))
2368 (file-name (git-file-name name version))
2370 (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
2372 `(#:tests? #f)) ; It's run after build automatically.
2373 (build-system cmake-build-system)
2374 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2375 (synopsis "Lightweight unit testing framework for C++")
2376 (description "UnitTest++ is a lightweight unit testing framework for C++.
2377 It was designed to do test-driven development on a wide variety of platforms.
2378 Simplicity, portability, speed, and small footprint are all very important
2379 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2380 of advanced library and language features, which means it should be easily
2381 portable to just about any platform.")
2382 (license license:expat)))
2384 (define-public libfaketime
2386 (name "libfaketime")
2388 (home-page "https://github.com/wolfcw/libfaketime")
2393 (commit (string-append "v" version))))
2396 "1mfdl82ppgbdvy1ny8mb7xii7p0g7awvn4bn36jb8v4r545slmjc"))
2397 (file-name (git-file-name name version))))
2398 (build-system gnu-build-system)
2400 '(#:phases (modify-phases %standard-phases
2402 (lambda* (#:key outputs #:allow-other-keys)
2403 (let ((out (assoc-ref outputs "out")))
2405 (setenv "PREFIX" out)
2407 (add-before 'check 'pre-check
2409 (substitute* "test/functests/test_exclude_mono.sh"
2410 (("/bin/bash") (which "bash")))
2412 #:test-target "test"))
2414 `(("perl" ,perl))) ;for tests
2415 (synopsis "Fake the system time for single applications")
2417 "The libfaketime library allows users to modify the system time that an
2418 application \"sees\". It is meant to be loaded using the dynamic linker's
2419 @code{LD_PRELOAD} environment variable. The @command{faketime} command
2420 provides a simple way to achieve this.")
2421 (license license:gpl2)))
2423 (define-public umockdev
2429 (uri (string-append "https://github.com/martinpitt/umockdev/"
2430 "releases/download/" version "/"
2431 "umockdev-" version ".tar.xz"))
2434 "095v3abc321s584sga04y16lcmdzsdi88h24wcrm78v7vq484g74"))))
2435 (build-system gnu-build-system)
2438 (modify-phases %standard-phases
2439 (add-after 'unpack 'skip-broken-test
2441 (substitute* "tests/test-umockdev.c"
2442 (("/\\* sys/ in other dir")
2443 (string-append "return; // ")))
2447 ("gtk-doc" ,gtk-doc)
2448 ("pkg-config" ,pkg-config)
2456 ("libgudev" ,libgudev)
2457 ("gobject-introspection" ,gobject-introspection)))
2458 (home-page "https://github.com/martinpitt/umockdev/")
2459 (synopsis "Mock hardware devices for creating unit tests")
2460 (description "umockdev mocks hardware devices for creating integration
2461 tests for hardware related libraries and programs. It also provides tools to
2462 record the properties and behaviour of particular devices, and to run a
2463 program or test suite under a test bed with the previously recorded devices
2465 (license license:lgpl2.1+)))
2467 (define-public virtest
2468 ;; No releases yet, so we take the commit that "vc" expects.
2469 (let ((commit "f7d03ef39fceba168745bd29e1b20af6e7971e04")
2473 (version (git-version "0.0" revision commit))
2474 (home-page "https://github.com/mattkretz/virtest")
2477 (uri (git-reference (url home-page) (commit commit)))
2478 (file-name (git-file-name name version))
2481 "07pjyb0mk7y2w1dg1bhl26nb7416xa1mw16ifj6mmps5y6aq054l"))))
2482 (build-system cmake-build-system)
2484 `(#:phases (modify-phases %standard-phases
2485 (add-after 'unpack 'adjust-install-directory
2487 ;; Vc is the only consumer of this library, and expects
2488 ;; to find it in "virtest/vir/" instead of "vir/vir/".
2489 (substitute* "CMakeLists.txt"
2490 (("DESTINATION include/vir")
2491 "DESTINATION include/virtest"))
2493 (synopsis "Header-only test framework")
2495 "@code{virtest} is a small header-only test framework for C++. It
2496 grew out of the @dfn{Vc} project.")
2497 (license license:bsd-3))))
2499 (define-public python-pyfakefs
2501 (name "python-pyfakefs")
2505 ;; We use the PyPI URL because there is no proper release
2506 ;; available from GitHub. The GitHub project only provides
2507 ;; autogenerated tarballs, which are known to change in place.
2508 (uri (pypi-uri "pyfakefs" version))
2511 "1cp2yw96fa2qkgi39xa3nlr3inf8wb5rgh9kdq53256ca2r8pdhy"))
2512 (patches (search-patches
2513 "python-pyfakefs-remove-bad-test.patch"))
2514 (file-name (string-append name "-" version ".tar.gz"))))
2517 (modify-phases %standard-phases
2518 ;; The default test suite does not run these extra tests.
2519 (add-after 'check 'check-pytest-plugin
2522 "python" "-m" "pytest"
2523 "pyfakefs/pytest_tests/pytest_plugin_test.py")
2526 `(("python-pytest" ,python-pytest)))
2527 (build-system python-build-system)
2528 ;; Guix lint doesn't like that this is a permanent redirect to the GitHub
2529 ;; page, but the pyfakefs documentation asks us to use this specific URL
2530 ;; when linking to the project. Honor their request.
2531 (home-page "http://pyfakefs.org/")
2532 ;; TRANSLATORS: In the synopsis, "Mock" is a verb.
2533 (synopsis "Mock file system interactions in tests")
2535 "This package provides a Python library intended for use in automated
2536 tests. One difficulty when testing software is that the code under test might
2537 need to read or write to files in the local file system. If the file system
2538 is not set up in just the right way, it might cause a spurious error during
2539 the test. The pyfakefs library provides a solution to problems like this by
2540 mocking file system interactions. In other words, it arranges for the code
2541 under test to interact with a fake file system instead of the real file
2542 system. The code under test requires no modification to work with pyfakefs.")
2543 (license license:asl2.0)))
2545 (define-public python2-pyfakefs
2546 (package-with-python2 python-pyfakefs))
2548 (define-public python-aiounittest
2550 (name "python-aiounittest")
2555 (uri (pypi-uri "aiounittest" version))
2558 "1q4bhmi80smaa1lknvdna0sx3915naczlfna1fp435nf6cjyrjl1"))))
2559 (build-system python-build-system)
2561 `(("python-coverage" ,python-coverage)
2562 ("python-nose" ,python-nose)))
2564 "https://github.com/kwarunek/aiounittest")
2565 (synopsis "Test asyncio code more easily")
2566 (description "Aiounittest is a library that helps write tests using
2567 asynchronous code in Python (asyncio).")
2568 (license license:expat)))