1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
3 ;;; Copyright © 2014 David Thompson <davet@gnu.org>
4 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
5 ;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
6 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
7 ;;; Copyright © 2015, 2017 Cyril Roelandt <tipecaml@gmail.com>
8 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
9 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
10 ;;; Copyright © 2015, 2016, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
11 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
12 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
13 ;;; Copyright © 2016, 2017 Danny Milosavljevic <dannym+a@scratchpost.org>
14 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
15 ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
16 ;;; Copyright © 2016 Troy Sankey <sankeytms@gmail.com>
17 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
18 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
19 ;;; Copyright © 2016, 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
20 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
21 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
22 ;;; Copyright © 2017, 2018 Arun Isaac <arunisaac@systemreboot.net>
23 ;;; Copyright © 2017 Frederick M. Muriithi <fredmanglis@gmail.com>
24 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
25 ;;; Copyright © 2017, 2019 Kei Kebreau <kkebreau@posteo.net>
26 ;;; Copyright © 2017 ng0 <ng0@n0.is>
27 ;;; Copyright © 2015, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
28 ;;; Copyright © 2016, 2017, 2018 Marius Bakke <mbakke@fastmail.com>
29 ;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
30 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
31 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
32 ;;; Copyright © 2019 Chris Marusich <cmmarusich@gmail.com>
34 ;;; This file is part of GNU Guix.
36 ;;; GNU Guix is free software; you can redistribute it and/or modify it
37 ;;; under the terms of the GNU General Public License as published by
38 ;;; the Free Software Foundation; either version 3 of the License, or (at
39 ;;; your option) any later version.
41 ;;; GNU Guix is distributed in the hope that it will be useful, but
42 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
43 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44 ;;; GNU General Public License for more details.
46 ;;; You should have received a copy of the GNU General Public License
47 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
49 (define-module (gnu packages check)
50 #:use-module (gnu packages)
51 #:use-module (gnu packages autotools)
52 #:use-module (gnu packages base)
53 #:use-module (gnu packages bash)
54 #:use-module (gnu packages compression)
55 #:use-module (gnu packages linux)
56 #:use-module (gnu packages llvm)
57 #:use-module (gnu packages glib)
58 #:use-module (gnu packages gnome)
59 #:use-module (gnu packages golang)
60 #:use-module (gnu packages gtk)
61 #:use-module (gnu packages perl)
62 #:use-module (gnu packages pkg-config)
63 #:use-module (gnu packages python)
64 #:use-module (gnu packages python-web)
65 #:use-module (gnu packages python-xyz)
66 #:use-module (gnu packages time)
67 #:use-module (guix utils)
68 #:use-module ((guix licenses) #:prefix license:)
69 #:use-module (guix packages)
70 #:use-module (guix download)
71 #:use-module (guix git-download)
72 #:use-module (guix build-system cmake)
73 #:use-module (guix build-system gnu)
74 #:use-module (guix build-system go)
75 #:use-module (guix build-system python)
76 #:use-module (guix build-system trivial))
85 (uri (string-append "https://github.com/libcheck/check/releases/download/"
86 version "/check-" version ".tar.gz"))
89 "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6"))))
90 (build-system gnu-build-system)
91 (home-page "https://libcheck.github.io/check/")
92 (synopsis "Unit test framework for C")
94 "Check is a unit testing framework for C. It features a simple
95 interface for defining unit tests, putting little in the way of the
96 developer. Tests are run in a separate address space, so Check can
97 catch both assertion failures and code errors that cause segmentation
98 faults or other signals. The output from unit tests can be used within
99 source code editors and IDEs.")
100 (license license:lgpl2.1+)))
109 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
110 version "/CUnit-" version ".tar.bz2"))
113 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
114 (build-system gnu-build-system)
115 (arguments '(#:phases
116 (modify-phases %standard-phases
117 ;; XXX: The "bootstrap" phase detects the "bootstrap"
118 ;; script, but fails to execute it, so we bootstrap
121 (lambda _ (invoke "autoreconf" "-vfi"))))))
123 `(("automake" ,automake)
124 ("autoconf" ,autoconf)
125 ("libtool" ,libtool)))
126 (home-page "http://cunit.sourceforge.net/")
127 (synopsis "Automated testing framework for C")
129 "CUnit is a lightweight system for writing, administering, and running
130 unit tests in C. It provides C programmers with basic testing functionality
131 with a flexible variety of user interfaces.")
132 (license license:gpl2+)))
134 (define-public cppunit
140 (uri (string-append "http://dev-www.libreoffice.org/src/"
141 name "-" version ".tar.gz"))
144 "17s2kzmkw3kfjhpp72rfppyd7syr7bdq5s69syj2nvrlwd3d4irz"))))
145 ;; Explicitly link with libdl. This is expected to be done by packages
146 ;; relying on cppunit for their tests. However, not all of them do.
147 ;; If we added the linker flag to such packages, we would pollute all
148 ;; binaries, not only those used for testing.
150 `(#:make-flags '("LDFLAGS=-ldl")))
151 (build-system gnu-build-system)
152 (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
153 (synopsis "Unit testing framework for C++")
154 (description "CppUnit is the C++ port of the famous JUnit framework for
155 unit testing. Test output is in XML for automatic testing and GUI based for
157 (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
159 ;; Some packages require this newer version of cppunit. However, it needs
160 ;; C++11 support, which is not enabled by default in our current GCC, and
161 ;; updating in-place would require adding CXXFLAGS to many dependent packages.
162 ;; Thus, keep as a separate variable for now.
163 ;; TODO: Remove this when our default GCC is updated to 6 or higher.
164 (define-public cppunit-1.14
170 (uri (string-append "https://dev-www.libreoffice.org/src/"
171 "cppunit-" version ".tar.gz"))
174 "1027cyfx5gsjkdkaf6c2wnjh68882grw8n672018cj3vs9lrhmix"))))))
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
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 cmdtest
242 (uri (string-append "http://git.liw.fi/cmdtest/snapshot/"
243 name "-" version ".tar.gz"))
246 "1jmfiyrrqmpvwdb273bkb8hjaf4rwx9njblx29pmr7giyahskwi5"))))
247 (build-system python-build-system)
251 (modify-phases %standard-phases
252 ;; check phase needs to be run before the build phase. If not, the
253 ;; coverage test runner looks for tests for the built source files,
256 (add-before 'build 'check
259 (("/bin/sh") (which "sh")))
260 ;; yarn uses python2-ttystatus to print messages.
261 ;; python2-ttystatus requires /dev/tty which is not present in
262 ;; the build environment. Hence assuming-failure test fails.
263 (delete-file "yarn.tests/assuming-failure.script")
264 (delete-file "yarn.tests/assuming-failure.stdout")
265 (invoke "python" "setup.py" "check"))))))
267 `(("python2-coverage-test-runner" ,python2-coverage-test-runner)))
269 `(("python2-cliapp" ,python2-cliapp)
270 ("python2-markdown" ,python2-markdown)
271 ("python2-ttystatus" ,python2-ttystatus)))
272 (home-page "https://liw.fi/cmdtest/")
273 (synopsis "Black box Unix program tester")
275 "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
276 given a command line and input files, and the expected output, and it verifies
277 that the command line produces the expected output. If not, it reports a
278 problem, and shows the differences.")
279 (license license:gpl3+)))
281 (define-public cmocka
287 (uri (string-append "https://cmocka.org/files/"
288 (version-major+minor version) "/cmocka-"
292 "1bxzzafjlwzgldcb07hjnlnqvh88wh21r2kw7z8f704w5bvvrsj3"))))
293 (build-system cmake-build-system)
295 `(#:tests? #f)) ; no test target
296 (home-page "https://cmocka.org/")
297 (synopsis "Unit testing framework for C")
298 (description "Cmocka is a unit testing framework for C with support for
299 mock objects. It only requires the standard C library, and works with
300 different compilers. Cmocka supports several different message output formats
301 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
303 (license license:asl2.0)))
305 (define-public cppcheck
312 (url "https://github.com/danmar/cppcheck")
314 (file-name (git-file-name name version))
316 (base32 "1xiy54rz99nzbpwj35jiyssd2nc6k5k0lw5ml6nh2qnmbfkl8swl"))))
317 (build-system cmake-build-system)
319 '(#:configure-flags '("-DBUILD_TESTS=ON")))
320 (home-page "http://cppcheck.sourceforge.net")
321 (synopsis "Static C/C++ code analyzer")
322 (description "Cppcheck is a static code analyzer for C and C++. Unlike
323 C/C++ compilers and many other analysis tools it does not detect syntax errors
324 in the code. Cppcheck primarily detects the types of bugs that the compilers
325 normally do not detect. The goal is to detect only real errors in the code
326 (i.e. have zero false positives).")
327 (license license:gpl3+)))
329 (define-public cxxtest
335 (uri (string-append "mirror://sourceforge/cxxtest/cxxtest/"
336 version "/cxxtest-" version ".tar.gz"))
339 "1n7pbj4z9ivx005hqvivj9ddhq8awynzg6jishfbypf6j7ply58w"))))
340 (build-system python-build-system)
343 (modify-phases %standard-phases
344 (add-after 'unpack 'chdir-to-source
348 (add-after 'install 'install-headers
349 (lambda* (#:key outputs #:allow-other-keys)
350 (let* ((out (assoc-ref outputs "out"))
351 (include-dir (string-append out "/include/cxxtest")))
352 (for-each (lambda (header-file)
353 (install-file header-file include-dir))
354 (find-files "../cxxtest"))
356 (add-after 'install 'install-doc
357 (lambda* (#:key outputs #:allow-other-keys)
358 (let* ((out (assoc-ref outputs "out"))
359 (doc-dir (string-append out "/share/doc/cxxtest")))
360 (install-file "../README" doc-dir)
361 (install-file "../doc/guide.txt" doc-dir)
362 (copy-recursively "../sample" (string-append doc-dir "/sample"))
365 `(("python-ply" ,python-ply)))
366 (home-page "https://cxxtest.com/")
367 (synopsis "Unit testing framework for C++")
368 (description "CxxTest is a unit testing framework for C++ that is similar
369 in spirit to JUnit, CppUnit, and xUnit. CxxTest does not require precompiling
370 a CxxTest testing library, it employs no advanced features of C++ (e.g. RTTI)
371 and it supports a very flexible form of test discovery.")
372 (license license:lgpl3+)))
374 (define-public go-gopkg.in-check.v1
375 (let ((commit "788fd78401277ebd861206a03c884797c6ec5541")
378 (name "go-gopkg.in-check.v1")
379 (version (git-version "0.0.0" revision commit))
383 (url "https://github.com/go-check/check.git")
385 (file-name (git-file-name name version))
388 "0v3bim0j375z81zrpr5qv42knqs0y2qv2vkjiqi5axvb78slki1a"))))
389 (build-system go-build-system)
391 '(#:import-path "gopkg.in/check.v1"))
393 `(("go-github-com-kr-pretty" ,go-github-com-kr-pretty)))
394 (synopsis "Rich testing extension for Go's testing package")
396 "@code{check} is a rich testing extension for Go's testing package.")
397 (home-page "https://github.com/go-check/check")
398 (license license:bsd-2))))
400 (define-public go-github.com-smartystreets-gunit
402 (name "go-github.com-smartystreets-gunit")
407 (url "https://github.com/smartystreets/gunit")
409 (file-name (git-file-name name version))
412 "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
413 (build-system go-build-system)
415 '(;; TODO: This package depends on go-github.com-smartystreets-assertions
416 ;; for running the tests, but go-github.com-smartystreets-assertions
417 ;; depends on this package, so break this loop by not running the tests
420 #:import-path "github.com/smartystreets/gunit"))
421 (synopsis "Testing tool for Go, in the style of xUnit")
423 "@code{gunit} allows the test author to use a struct as the scope for a
424 group of related test cases, in the style of xUnit fixtures. This makes
425 extraction of setup/teardown behavior (as well as invoking the system under
426 test) much simpler.")
427 (home-page "https://github.com/smartystreets/gunit")
428 (license license:expat)))
430 (define-public go-github.com-smartystreets-assertions
432 (name "go-github.com-smartystreets-assertions")
437 (url "https://github.com/smartystreets/assertions")
439 (file-name (git-file-name name version))
442 "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
443 (build-system go-build-system)
445 '(#:import-path "github.com/smartystreets/assertions"))
447 `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
448 (synopsis "Assertions for testing with Go")
450 "The @code{assertions} package provides convenient assertion functions
451 for writing tests in Go.")
452 (home-page "https://github.com/smartystreets/assertions")
453 (license license:expat)))
455 (define-public go-github.com-smartystreets-goconvey
457 (name "go-github.com-smartystreets-goconvey")
462 (url "https://github.com/smartystreets/goconvey")
464 (file-name (git-file-name name version))
467 "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
468 (build-system go-build-system)
470 '(#:import-path "github.com/smartystreets/goconvey"))
472 `(("go-github.com-jtolds-gls" ,go-github.com-jtolds-gls)
473 ("go-github.com-smartystreets-assertions" ,go-github.com-smartystreets-assertions)))
474 (synopsis "Go testing tool with both a web and terminal user interface")
476 "GoConvey is a testing tool for Go. It integrates with go test, can show
477 test coverage and has a web user interface that will refresh automatically.")
478 (home-page "https://github.com/smartystreets/goconvey")
479 (license license:expat)))
481 (define-public googletest
489 (url "https://github.com/google/googletest.git")
490 (commit (string-append "release-" version))))
491 (file-name (git-file-name name version))
493 (base32 "0270msj6n7mggh4xqqjp54kswbl7mkcc8px1p5dqdpmw5ngh9fzk"))))
494 (build-system cmake-build-system)
496 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
498 `(("python-2" ,python-2)))
499 (home-page "https://github.com/google/googletest/")
500 (synopsis "Test discovery and XUnit test framework")
501 (description "Google Test features an XUnit test framework, automated test
502 discovery, death tests, assertions, parameterized tests and XML test report
504 (license license:bsd-3)))
506 (define-public cpputest
513 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
514 version "/cpputest-" version ".tar.gz"))
517 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
518 (build-system gnu-build-system)
520 `(("googletest" ,googletest)))
521 (home-page "https://cpputest.github.io/")
522 (synopsis "Unit testing and mocking framework for C/C++")
524 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
525 C++ but is used in C and C++ projects and frequently used in embedded systems
526 but it works for any C/C++ project.")
527 (license license:bsd-3)))
529 (define-public python-parameterized
531 (name "python-parameterized")
536 (uri (pypi-uri "parameterized" version))
539 "1qj1939shm48d9ql6fm1nrdy4p7sdyj8clz1szh5swwpf1qqxxfa"))))
540 (build-system python-build-system)
541 (arguments '(#:tests? #f)) ; there are no tests
542 (home-page "https://github.com/wolever/parameterized")
543 (synopsis "Parameterized testing with any Python test framework")
545 "Parameterized is a Python library that aims to fix parameterized testing
546 for every Python test framework. It supports nose, py.test, and unittest.")
547 (license license:bsd-2)))
549 (define-public python2-parameterized
550 (package-with-python2 python-parameterized))
552 (define-public python-minimock
554 (name "python-minimock")
559 (uri (pypi-uri "MiniMock" version))
562 "0k2sxb1ibnyg05iblz7zhbv825f1zk9906rab7883iqgvzmdzpsz"))))
563 (build-system python-build-system)
564 (home-page "https://pypi.org/project/MiniMock")
565 (synopsis "Simple Python library for using mock objects")
566 (description "MiniMock is a simple library for building mock objects with
568 (license license:expat)))
570 (define-public python2-minimock
571 (package-with-python2 python-minimock))
573 (define-public python-mock
580 (uri (pypi-uri "mock" version))
583 "1flbpksir5sqrvq2z0dp8sl4bzbadg21sj4d42w3klpdfvgvcn5i"))))
585 `(("python-pbr" ,python-pbr-minimal)
586 ("python-six" ,python-six)))
587 (build-system python-build-system)
589 `(("python-unittest2" ,python-unittest2)))
592 (modify-phases %standard-phases
595 (zero? (system* "unit2")))))))
596 (home-page "https://github.com/testing-cabal/mock")
597 (synopsis "Python mocking and patching library for testing")
599 "Mock is a library for testing in Python. It allows you to replace parts
600 of your system under test with mock objects and make assertions about how they
602 (properties `((python2-variant . ,(delay python2-mock))))
603 (license license:expat)))
605 (define-public python2-mock
606 (let ((base (package-with-python2
607 (strip-python2-variant python-mock))))
608 (package (inherit base)
610 `(("python2-functools32" ,python2-functools32)
611 ("python2-funcsigs" ,python2-funcsigs)
612 ,@(package-propagated-inputs base))))))
614 (define-public python-nose
621 (uri (pypi-uri "nose" version))
624 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
625 (build-system python-build-system)
627 '(#:tests? #f)) ; FIXME: test suite fails
628 (home-page "http://readthedocs.org/docs/nose/")
629 (synopsis "Python testing library")
631 "Nose extends the unittest library to make testing easier.")
632 (license license:lgpl2.0+)))
634 (define-public python2-nose
635 (package-with-python2 python-nose))
637 (define-public python-nose2
639 (name "python-nose2")
644 (uri (pypi-uri "nose2" version))
647 "1x4zjq1zlyrh8b9ba0cmafd3w94pxhid408kibyjd3s6h1lap6s7"))))
648 (build-system python-build-system)
649 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
651 `(("python-cov-core" ,python-cov-core)
652 ("python-pytest-cov" ,python-pytest-cov)
653 ("python-six" ,python-six)))
654 (home-page "https://github.com/nose-devs/nose2")
655 (synopsis "Next generation of nicer testing for Python")
657 "Nose2 is the next generation of nicer testing for Python, based on the
658 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
659 better plugin api, being easier for users to configure, and simplifying internal
660 interfaces and processes.")
661 (license license:bsd-2)))
663 (define-public python2-nose2
664 (package-with-python2 python-nose2))
666 (define-public python-unittest2
668 (name "python-unittest2")
673 (uri (pypi-uri "unittest2" version))
675 (search-patches "python-unittest2-python3-compat.patch"
676 "python-unittest2-remove-argparse.patch"))
679 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
680 (build-system python-build-system)
683 (modify-phases %standard-phases
686 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
688 `(("python-six" ,python-six)
689 ("python-traceback2" ,python-traceback2)))
690 (home-page "http://pypi.python.org/pypi/unittest2")
691 (synopsis "Python unit testing library")
693 "Unittest2 is a replacement for the unittest module in the Python
695 (license license:psfl)))
697 (define-public python2-unittest2
698 (package-with-python2 python-unittest2))
700 (define-public python-pytest
702 (name "python-pytest")
707 (uri (pypi-uri "pytest" version))
710 "17grcfvd6ggvvqmprwv5y8g319nayam70hr43ssjwj40ws27z858"))))
711 (build-system python-build-system)
714 (modify-phases %standard-phases
715 (add-before 'check 'disable-invalid-tests
717 ;; Some tests involves the /usr directory, and fails.
718 (substitute* "testing/test_argcomplete.py"
719 (("def test_remove_dir_prefix\\(self\\):")
720 "@pytest.mark.xfail\n def test_remove_dir_prefix(self):"))
721 (substitute* "testing/test_argcomplete.py"
722 (("def test_remove_dir_prefix" line)
723 (string-append "@pytest.mark.skip"
724 "(reason=\"Assumes that /usr exists.\")\n "
727 (replace 'check (lambda _ (invoke "pytest" "-vv"))))))
729 `(("python-atomicwrites" ,python-atomicwrites)
730 ("python-attrs" ,python-attrs-bootstrap)
731 ("python-more-itertools" ,python-more-itertools)
732 ("python-pluggy" ,python-pluggy)
733 ("python-py" ,python-py)
734 ("python-six" ,python-six-bootstrap)))
736 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
738 ("python-hypothesis" ,python-hypothesis)
739 ("python-nose" ,python-nose)
740 ("python-mock" ,python-mock)
741 ("python-pytest" ,python-pytest-bootstrap)
742 ("python-setuptools-scm" ,python-setuptools-scm)))
743 (home-page "https://docs.pytest.org/en/latest/")
744 (synopsis "Python testing library")
746 "Pytest is a testing tool that provides auto-discovery of test modules
747 and functions, detailed info on failing assert statements, modular fixtures,
748 and many external plugins.")
749 (license license:expat)
750 (properties `((python2-variant . ,(delay python2-pytest))))))
752 (define-public python2-pytest
753 (let ((pytest (package-with-python2
754 (strip-python2-variant python-pytest))))
758 `(("python2-funcsigs" ,python2-funcsigs)
759 ("python2-pathlib2" ,python2-pathlib2)
760 ,@(package-propagated-inputs pytest))))))
762 (define-public python-pytest-bootstrap
764 (inherit (strip-python2-variant python-pytest))
765 (name "python-pytest-bootstrap")
766 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
767 (arguments `(#:tests? #f))
768 (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
770 (define-public python2-pytest-bootstrap
771 (let ((pytest (package-with-python2
772 (strip-python2-variant python-pytest-bootstrap))))
773 (package (inherit pytest)
775 `(("python2-funcsigs" ,python2-funcsigs-bootstrap)
776 ("python2-pathlib2" ,python2-pathlib2-bootstrap)
777 ,@(package-propagated-inputs pytest))))))
779 (define-public python-pytest-cov
781 (name "python-pytest-cov")
786 (uri (pypi-uri "pytest-cov" version))
788 (base32 "0cyxbbghx2l4p60w10k00j1j74q1ngfiffr0pxn73ababjr69dha"))))
789 (build-system python-build-system)
792 (modify-phases %standard-phases
795 ;; Options taken from tox.ini.
796 ;; TODO: make "--restructuredtext" tests pass. They currently fail
797 ;; with "Duplicate implicit target name".
798 (invoke "python" "./setup.py" "check"
799 "--strict" "--metadata"))))))
801 `(("python-coverage" ,python-coverage)
802 ("python-pytest" ,python-pytest)))
803 (home-page "https://github.com/pytest-dev/pytest-cov")
804 (synopsis "Pytest plugin for measuring coverage")
806 "Pytest-cov produces coverage reports. It supports centralised testing and
807 distributed testing in both @code{load} and @code{each} modes. It also
808 supports coverage of subprocesses.")
809 (license license:expat)))
811 (define-public python2-pytest-cov
812 (package-with-python2 python-pytest-cov))
814 (define-public python-pytest-runner
816 (name "python-pytest-runner")
821 (uri (pypi-uri "pytest-runner" version))
824 "1gkpyphawxz38ni1gdq1fmwyqcg02m7ypzqvv46z06crwdxi2gyj"))))
825 (build-system python-build-system)
827 `(("python-pytest" ,python-pytest-bootstrap)
828 ("python-setuptools-scm" ,python-setuptools-scm)))
829 (home-page "https://github.com/pytest-dev/pytest-runner")
830 (synopsis "Invoke py.test as a distutils command")
832 "This package provides a @command{pytest-runner} command that
833 @file{setup.py} files can use to run tests.")
834 (license license:expat)))
836 (define-public python2-pytest-runner
837 (package-with-python2 python-pytest-runner))
839 (define-public python-pytest-mock
841 (name "python-pytest-mock")
846 (uri (pypi-uri "pytest-mock" version))
849 "1i5mg3ff1qk0wqfcxfz60hwy3q5dskdp36i10ckigkzffg8hc3ad"))))
850 (build-system python-build-system)
852 `(("python-setuptools-scm" ,python-setuptools-scm)))
854 `(("python-pytest" ,python-pytest)))
855 (home-page "https://github.com/pytest-dev/pytest-mock/")
856 (synopsis "Thin-wrapper around the mock package for easier use with py.test")
858 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
859 around the patching API provided by the @code{mock} package, but with the
860 benefit of not having to worry about undoing patches at the end of a test.
861 The mocker fixture has the same API as @code{mock.patch}, supporting the
863 (properties `((python2-variant . ,(delay python2-pytest-mock))))
864 (license license:expat)))
866 (define-public python2-pytest-mock
867 (let ((base (package-with-python2
868 (strip-python2-variant python-pytest-mock))))
869 (package (inherit base)
871 `(("python2-mock" ,python2-mock)
872 ,@(package-propagated-inputs base))))))
874 (define-public python-pytest-xdist
876 (name "python-pytest-xdist")
881 (uri (pypi-uri "pytest-xdist" version))
884 "1d812apvcmshh2l8f38spqwb3bpp0x43yy7lyfpxxzc99h4r7y4n"))
885 (modules '((guix build utils)))
888 ;; Remove pre-compiled .pyc files from source.
889 (for-each delete-file-recursively
890 (find-files "." "__pycache__" #:directories? #t))
891 (for-each delete-file (find-files "." "\\.pyc$"))
893 (build-system python-build-system)
895 '(#:tests? #f)) ;FIXME: Some tests are failing.
897 ;; (modify-phases %standard-phases
899 ;; (add-after 'install 'check
900 ;; (lambda* (#:key inputs outputs #:allow-other-keys)
901 ;; (add-installed-pythonpath inputs outputs)
902 ;; (zero? (system* "py.test" "-v")))))
904 `(("python-setuptools-scm" ,python-setuptools-scm)))
906 `(("python-execnet" ,python-execnet)
907 ("python-pytest" ,python-pytest)
908 ("python-py" ,python-py)))
910 "https://github.com/pytest-dev/pytest-xdist")
912 "Plugin for py.test with distributed testing and loop-on-failing modes")
914 "The pytest-xdist plugin extends py.test with some unique test execution
915 modes: parallelization, running tests in boxed subprocesses, the ability
916 to run tests repeatedly when failed, and the ability to run tests on multiple
917 Python interpreters or platforms. It uses rsync to copy the existing
918 program code to a remote location, executes there, and then syncs the
920 (license license:expat)))
922 (define-public python2-pytest-xdist
923 (package-with-python2 python-pytest-xdist))
925 (define-public python-pytest-timeout
927 (name "python-pytest-timeout")
932 (uri (pypi-uri "pytest-timeout" version))
935 "1cczcjhw4xx5sjkhxlhc5c1bkr7x6fcyx12wrnvwfckshdvblc2a"))))
936 (build-system python-build-system)
938 `(("python-pytest" ,python-pytest)))
939 (home-page "http://bitbucket.org/pytest-dev/pytest-timeout/")
940 (synopsis "Plugin for py.test to abort hanging tests")
942 "This package provides a py.test plugin that aborts hanging tests after a
943 timeout has been exceeded.")
944 (license license:expat)))
946 (define-public python-scripttest
948 (name "python-scripttest")
953 (uri (pypi-uri "scripttest" version))
956 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
957 (build-system python-build-system)
959 `(("python-pytest" ,python-pytest)))
960 (home-page "http://pythonpaste.org/scripttest/")
961 (synopsis "Python library to test command-line scripts")
962 (description "Scripttest is a Python helper library for testing
963 interactive command-line applications. With it you can run a script in a
964 subprocess and see the output as well as any file modifications.")
965 (license license:expat)))
967 (define-public python2-scripttest
968 (package-with-python2 python-scripttest))
970 (define-public python-testtools-bootstrap
972 (name "python-testtools-bootstrap")
977 (uri (pypi-uri "testtools" version))
980 "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
981 (patches (search-patches "python-testtools.patch"))))
982 (build-system python-build-system)
983 (arguments '(#:tests? #f))
985 `(("python-extras" ,python-extras)
986 ("python-fixtures" ,python-fixtures-bootstrap)
987 ("python-mimeparse" ,python-mimeparse)
988 ("python-pbr" ,python-pbr-minimal)
989 ("python-six" ,python-six)
990 ("python-traceback2" ,python-traceback2)
991 ("python-unittest2" ,python-unittest2)))
992 (home-page "https://github.com/testing-cabal/testtools")
994 "Extensions to the Python standard library unit testing framework")
996 "This package is only for bootstrapping. Do not use this.")
997 (license license:psfl)))
999 (define-public python2-testtools-bootstrap
1000 (package-with-python2 python-testtools-bootstrap))
1002 (define-public python-testtools
1004 (inherit python-testtools-bootstrap)
1005 (name "python-testtools")
1007 `(#:phases (modify-phases %standard-phases
1010 (invoke "python" "-m" "testtools.run"
1011 "testtools.tests.test_suite"))))))
1013 `(("python-extras" ,python-extras)
1014 ("python-fixtures" ,python-fixtures)
1015 ("python-mimeparse" ,python-mimeparse)
1016 ("python-pbr" ,python-pbr)
1017 ("python-six" ,python-six)
1018 ("python-traceback2" ,python-traceback2)
1019 ("python-unittest2" ,python-unittest2)))
1021 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
1023 "Testtools extends the Python standard library unit testing framework to
1024 provide matchers, more debugging information, and cross-Python
1027 (define-public python2-testtools
1028 (package-with-python2 python-testtools))
1030 (define-public python-testscenarios-bootstrap
1032 (name "python-testscenarios-bootstrap")
1037 (uri (pypi-uri "testscenarios" version))
1040 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
1041 (build-system python-build-system)
1043 `(#:phases (modify-phases %standard-phases
1046 (invoke "python" "-m" "testtools.run"
1047 "testscenarios.test_suite"))))))
1049 `(("python-pbr" ,python-pbr-minimal)
1050 ("python-testtools" ,python-testtools-bootstrap)))
1051 (home-page "https://launchpad.net/testscenarios")
1052 (synopsis "Pyunit extension for dependency injection")
1054 "This package is only for bootstrapping. Don't use this.")
1055 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1057 (define-public python2-testscenarios-bootstrap
1058 (package-with-python2 python-testscenarios-bootstrap))
1060 (define-public python-testscenarios
1062 (inherit python-testscenarios-bootstrap)
1063 (name "python-testscenarios")
1065 `(("python-pbr" ,python-pbr)
1066 ("python-testtools" ,python-testtools)))
1068 "Testscenarios provides clean dependency injection for Python unittest
1071 (define-public python2-testscenarios
1072 (package-with-python2 python-testscenarios))
1074 ;; Testresources requires python-pbr at runtime, but pbr needs it for its
1075 ;; own tests. Hence this bootstrap variant.
1076 (define-public python-testresources-bootstrap
1078 (name "python-testresources-bootstrap")
1082 (uri (pypi-uri "testresources" version))
1085 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
1086 (build-system python-build-system)
1087 (arguments '(#:tests? #f))
1089 `(("python-pbr" ,python-pbr-minimal)))
1090 (home-page "https://launchpad.net/testresources")
1092 "Pyunit extension for managing test resources")
1094 "This package is only here for bootstrapping purposes. Use the regular
1095 testresources package instead.")
1096 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1098 (define-public python2-testresources-bootstrap
1099 (package-with-python2 python-testresources-bootstrap))
1101 (define-public python-testresources
1103 (inherit python-testresources-bootstrap)
1104 (name "python-testresources")
1106 `(("python-pbr" ,python-pbr)))
1109 `(("python-fixtures" ,python-fixtures)
1110 ("python-testtols" ,python-testtools)))
1112 "Testresources is an extension to Python's unittest to allow declarative
1113 use of resources by test cases.")))
1115 (define-public python2-testresources
1116 (package-with-python2 python-testresources))
1118 (define-public python-subunit-bootstrap
1120 (name "python-subunit-bootstrap")
1125 (uri (pypi-uri "python-subunit" version))
1128 "1fsw8rsn1s3nklx06mayrg5rn2zbky6wwjc5z07s7rf1wjzfs1wn"))))
1129 (build-system python-build-system)
1131 `(("python-extras" ,python-extras)
1132 ("python-testtools" ,python-testtools-bootstrap)))
1134 `(("python-fixtures" ,python-fixtures-bootstrap)
1135 ("python-hypothesis" ,python-hypothesis)
1136 ("python-testscenarios" ,python-testscenarios-bootstrap)))
1137 (home-page "https://launchpad.net/subunit")
1138 (synopsis "Python implementation of the subunit protocol")
1140 "This package is here for bootstrapping purposes only. Use the regular
1141 python-subunit package instead.")
1142 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1144 (define-public python2-subunit-bootstrap
1145 (package-with-python2 python-subunit-bootstrap))
1147 (define-public python-subunit
1149 (inherit python-subunit-bootstrap)
1150 (name "python-subunit")
1152 `(("python-extras" ,python-extras)
1153 ("python-testtools" ,python-testtools)))
1155 `(("python-fixtures" ,python-fixtures)
1156 ("python-hypothesis" ,python-hypothesis)
1157 ("python-testscenarios" ,python-testscenarios)))
1159 "Python-subunit is a Python implementation of the subunit test streaming
1162 (define-public python2-subunit
1163 (package-with-python2 python-subunit))
1165 ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
1166 ;; own tests. Hence this bootstrap variant.
1167 (define-public python-fixtures-bootstrap
1169 (name "python-fixtures-bootstrap")
1173 (uri (pypi-uri "fixtures" version))
1176 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
1177 (build-system python-build-system)
1178 (arguments `(#:tests? #f))
1180 `(("python-pbr-minimal" ,python-pbr-minimal)
1181 ("python-six" ,python-six)))
1182 (home-page "https://launchpad.net/python-fixtures")
1183 (synopsis "Python test fixture library")
1185 "This package is only used for bootstrapping. Use the regular
1186 python-fixtures package instead.")
1187 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1189 (define-public python2-fixtures-bootstrap
1190 (package-with-python2 python-fixtures-bootstrap))
1192 (define-public python-fixtures
1194 (inherit python-fixtures-bootstrap)
1195 (name "python-fixtures")
1198 (modify-phases %standard-phases
1201 (invoke "python" "-m" "testtools.run"
1202 "fixtures.test_suite"))))))
1204 ;; Fixtures uses pbr at runtime to check versions, etc.
1205 `(("python-pbr" ,python-pbr)
1206 ("python-six" ,python-six)))
1208 `(("python-mock" ,python-mock)
1209 ("python-testtools" ,python-testtools-bootstrap)))
1211 "Fixtures provides a way to create reusable state, useful when writing
1214 (define-public python2-fixtures
1215 (package-with-python2 python-fixtures))
1217 (define-public python-testrepository-bootstrap
1219 (name "python-testrepository-bootstrap")
1224 (uri (pypi-uri "testrepository" version))
1227 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1228 (build-system python-build-system)
1229 (arguments '(#:tests? #f))
1231 `(("python-fixtures" ,python-fixtures-bootstrap)
1232 ("python-subunit" ,python-subunit-bootstrap)
1233 ("python-testtools" ,python-testtools-bootstrap)))
1235 `(("python-mimeparse" ,python-mimeparse)))
1236 (home-page "https://launchpad.net/testrepository")
1237 (synopsis "Database for Python test results")
1239 "Bootstrap package for python-testrepository. Don't use this.")
1240 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1242 (define-public python2-testrepository-bootstrap
1243 (package-with-python2 python-testrepository-bootstrap))
1245 (define-public python-testrepository
1247 (inherit python-testrepository-bootstrap)
1248 (name "python-testrepository")
1250 ;; FIXME: Many tests are failing.
1253 `(("python-fixtures" ,python-fixtures)
1254 ("python-subunit" ,python-subunit)
1255 ("python-testtools" ,python-testtools)))
1257 `(("python-mimeparse" ,python-mimeparse)))
1258 (description "Testrepository provides a database of test results which can
1259 be used as part of a developer's workflow to check things such as what tests
1260 have failed since the last commit or what tests are currently failing.")))
1262 (define-public python2-testrepository
1263 (package-with-python2 python-testrepository))
1265 (define-public python-coverage
1267 (name "python-coverage")
1272 (uri (pypi-uri "coverage" version))
1275 "097l4s3ssxm1vncsn0nw3a1pbzah28773q36c1ab9wz01r04973s"))))
1276 (build-system python-build-system)
1278 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1280 (home-page "http://nedbatchelder.com/code/coverage")
1281 (synopsis "Code coverage measurement for Python")
1283 "Coverage measures code coverage, typically during test execution. It
1284 uses the code analysis tools and tracing hooks provided in the Python standard
1285 library to determine which lines are executable, and which have been
1287 (license license:bsd-3)))
1289 (define-public python2-coverage
1290 (package-with-python2 python-coverage))
1292 (define-public python-cov-core
1294 (name "python-cov-core")
1299 (uri (pypi-uri "cov-core" version))
1302 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1303 (build-system python-build-system)
1305 `(("python-coverage" ,python-coverage)))
1306 (home-page "https://github.com/schlamar/cov-core")
1307 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
1309 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1310 and @code{nose2-cov}. It is useful for developing coverage plugins for these
1311 testing frameworks.")
1312 (license license:expat)))
1314 (define-public python2-cov-core
1315 (package-with-python2 python-cov-core))
1317 (define-public python-codecov
1319 (name "python-codecov")
1324 (uri (pypi-uri "codecov" version))
1327 "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1328 (build-system python-build-system)
1330 `(("python-unittest2" ,python-unittest2)))
1332 `(("python-coverage" ,python-coverage)
1333 ("python-requests" ,python-requests)))
1334 (home-page "http://github.com/codecov/codecov-python")
1335 (synopsis "Upload code coverage reports to @code{codecov.io}")
1337 "Codecov collects code coverage reports from code written in Python, Java,
1338 C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
1339 (license license:asl2.0)))
1341 (define-public python-testpath
1343 (name "python-testpath")
1349 (url "https://github.com/jupyter/testpath")
1351 (file-name (git-file-name name version))
1354 "0r4iiizjql6ny1ln7ciw7rrbjadz1s9zrf2hl0xkgnh3ypd8936f"))))
1355 (build-system python-build-system)
1357 `(#:tests? #f ; this package does not even have a setup.py
1358 #:modules ((guix build python-build-system)
1361 #:imported-modules (,@%python-build-system-modules
1364 (modify-phases %standard-phases
1367 (lambda* (#:key inputs outputs #:allow-other-keys)
1368 (let* ((version (last
1369 (string-split (assoc-ref inputs "python") #\-)))
1370 (x.y (string-join (take (string-split version #\.) 2)
1373 (assoc-ref outputs "out")
1374 "/lib/python" x.y "/site-packages/testpath")))
1376 (copy-recursively "testpath" dir))
1378 (home-page "https://github.com/takluyver/testpath")
1379 (synopsis "Test utilities for code working with files and commands")
1381 "Testpath is a collection of utilities for Python code working with files
1382 and commands. It contains functions to check things on the file system, and
1383 tools for mocking system commands and recording calls to those.")
1384 (license license:expat)))
1386 (define-public python2-testpath
1387 (package-with-python2 python-testpath))
1389 (define-public python-testlib
1391 (name "python-testlib")
1396 (uri (pypi-uri "testlib" version ".zip"))
1398 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1399 (build-system python-build-system)
1401 `(("unzip" ,unzip))) ; for unpacking the source
1402 (synopsis "Python micro test suite harness")
1403 (description "A micro unittest suite harness for Python.")
1404 (home-page "https://github.com/trentm/testlib")
1405 (license license:expat)))
1407 (define-public python2-testlib
1408 (package-with-python2 python-testlib))
1410 ;;; The software provided by this package was integrated into pytest 2.8.
1411 (define-public python-pytest-cache
1413 (name "python-pytest-cache")
1417 (uri (pypi-uri "pytest-cache" version))
1420 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1421 (build-system python-build-system)
1423 `(("python-apipkg" ,python-apipkg)
1424 ("python-execnet" ,python-execnet)
1425 ("python-py" ,python-py)
1426 ("python-pytest" ,python-pytest)))
1427 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1428 (description "The pytest-cache plugin provides tools to rerun failures from
1429 the last py.test invocation.")
1430 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1431 (license license:expat)))
1433 (define-public python2-pytest-cache
1434 (package-with-python2 python-pytest-cache))
1436 (define-public python-pytest-localserver
1438 (name "python-pytest-localserver")
1442 (uri (pypi-uri "pytest-localserver" version))
1445 "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
1446 (build-system python-build-system)
1449 (modify-phases %standard-phases
1452 (invoke "py.test" "-v"))))))
1454 `(("python-pytest" ,python-pytest)
1455 ("python-requests" ,python-requests)
1456 ("python-six" ,python-six)))
1458 `(("python-werkzeug" ,python-werkzeug)))
1459 (synopsis "Py.test plugin to test server connections locally")
1460 (description "Pytest-localserver is a plugin for the pytest testing
1461 framework which enables you to test server connections locally.")
1462 (home-page "https://pypi.python.org/pypi/pytest-localserver")
1463 (license license:expat)))
1465 (define-public python-pytest-xprocess
1467 (name "python-pytest-xprocess")
1471 (uri (pypi-uri "pytest-xprocess" version))
1474 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1475 (build-system python-build-system)
1477 `(("python-pytest" ,python-pytest)
1478 ("python-pytest-cache" ,python-pytest-cache)
1479 ("python-psutil" ,python-psutil)))
1480 (synopsis "Pytest plugin to manage external processes across test runs")
1481 (description "Pytest-xprocess is an experimental py.test plugin for managing
1482 processes across test runs.")
1483 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1484 (license license:expat)))
1486 (define-public python-pytest-subtesthack
1488 (name "python-pytest-subtesthack")
1492 (uri (pypi-uri "pytest-subtesthack" version))
1495 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1496 (build-system python-build-system)
1498 `(("python-pytest" ,python-pytest)))
1499 (synopsis "Set-up and tear-down fixtures for unit tests")
1500 (description "This plugin allows you to set up and tear down fixtures within
1501 unit test functions that use @code{py.test}. This is useful for using
1502 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1503 function multiple times, without setting up or tearing down fixture state as is
1504 normally the case.")
1505 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1506 (license license:unlicense)))
1508 (define-public python2-pytest-subtesthack
1509 (package-with-python2 python-pytest-subtesthack))
1511 (define-public python-pytest-sugar
1513 (name "python-pytest-sugar")
1518 (uri (pypi-uri "pytest-sugar" version))
1521 "1asq7yc4g8bx2sn7yy974mhc9ywvaihasjab4inkirdwn9s7mn7w"))))
1522 (build-system python-build-system)
1524 `(("python-packaging" ,python-packaging)
1525 ("python-pytest" ,python-pytest)
1526 ("python-termcolor" ,python-termcolor)))
1527 (home-page "https://pivotfinland.com/pytest-sugar/")
1528 (synopsis "Plugin for pytest that changes the default look and feel")
1530 "@code{pytest-sugar} is a plugin for py.test that changes the default
1531 look and feel of py.test, using a progress bar and showing failures and errors
1533 (license license:bsd-3)))
1535 (define-public python-hypothesis
1537 (name "python-hypothesis")
1541 (uri (pypi-uri "hypothesis" version))
1544 "1rshs1japfmwgar98yrkq4hg4z2q76hlnq7w2n3lfbjnscn1jd9b"))))
1545 (build-system python-build-system)
1547 `(;; FIXME: Change to python-flake8 in the next rebuild cycle.
1548 ("python-flake8" ,python-flake8-3.5)
1549 ("python-pytest" ,python-pytest-bootstrap)))
1551 `(("python-attrs" ,python-attrs-bootstrap)
1552 ("python-coverage" ,python-coverage)))
1553 (synopsis "Library for property based testing")
1554 (description "Hypothesis is a library for testing your Python code against a
1555 much larger range of examples than you would ever want to write by hand. It’s
1556 based on the Haskell library, Quickcheck, and is designed to integrate
1557 seamlessly into your existing Python unit testing work flow.")
1558 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
1559 (license license:mpl2.0)
1560 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1562 (define-public python2-hypothesis
1563 (let ((hypothesis (package-with-python2
1564 (strip-python2-variant python-hypothesis))))
1565 (package (inherit hypothesis)
1567 `(("python2-enum34" ,python2-enum34)
1568 ,@(package-propagated-inputs hypothesis))))))
1570 (define-public python-lit
1577 (uri (pypi-uri "lit" version))
1580 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
1581 (build-system python-build-system)
1584 (modify-phases %standard-phases
1587 (invoke "python" "lit.py" "tests"))))))
1590 (home-page "https://llvm.org/")
1591 (synopsis "LLVM Software Testing Tool")
1592 (description "@code{lit} is a portable tool for executing LLVM and Clang
1593 style test suites, summarizing their results, and providing indication of
1595 (license license:ncsa)))
1597 (define-public python2-lit
1598 (package-with-python2 python-lit))
1600 (define-public python-pytest-pep8
1602 (name "python-pytest-pep8")
1606 (uri (pypi-uri "pytest-pep8" version))
1609 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
1610 (build-system python-build-system)
1612 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
1614 `(("python-pytest" ,python-pytest)))
1616 `(("python-pep8" ,python-pep8)))
1617 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
1618 (synopsis "Py.test plugin to check PEP8 requirements")
1619 (description "Pytest plugin for checking PEP8 compliance.")
1620 (license license:expat)))
1622 (define-public python2-pytest-pep8
1623 (package-with-python2 python-pytest-pep8))
1625 (define-public python-pytest-flakes
1627 (name "python-pytest-flakes")
1631 (uri (pypi-uri "pytest-flakes" version))
1634 "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
1635 (build-system python-build-system)
1638 (modify-phases %standard-phases
1640 (add-after 'install 'check
1641 (lambda* (#:key outputs inputs #:allow-other-keys)
1642 ;; It's easier to run tests after install.
1643 ;; Make installed package available for running the tests
1644 (add-installed-pythonpath inputs outputs)
1645 (invoke "py.test" "-vv"))))))
1647 `(("python-coverage" ,python-coverage)
1648 ("python-pytest" ,python-pytest)
1649 ("python-pytest-cache" ,python-pytest-cache)
1650 ("python-pytest-pep8" ,python-pytest-pep8)))
1652 `(("python-pyflakes" ,python-pyflakes)))
1653 (home-page "https://github.com/fschulze/pytest-flakes")
1654 (synopsis "Py.test plugin to check source code with pyflakes")
1655 (description "Pytest plugin for checking Python source code with pyflakes.")
1656 (license license:expat)))
1658 (define-public python2-pytest-flakes
1659 (package-with-python2 python-pytest-flakes))
1661 (define-public python2-coverage-test-runner
1663 (name "python2-coverage-test-runner")
1669 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
1670 "coverage-test-runner/snapshot/coverage-test-runner-"
1674 "1kjjb9llckycnfxag8zcvqsn4z1s3dwyw6b1n0avxydihgf30rny"))))
1675 (build-system python-build-system)
1677 `(#:python ,python-2
1679 (modify-phases %standard-phases
1682 (invoke "./testrun"))))))
1684 `(("python2-coverage" ,python2-coverage)))
1685 (home-page "https://liw.fi/coverage-test-runner/")
1686 (synopsis "Python module for running unit tests")
1687 (description "@code{CoverageTestRunner} is a python module for running
1688 unit tests and failing them if the unit test module does not exercise all
1689 statements in the module it tests.")
1690 (license license:gpl3+)))
1692 (define-public python-pylint
1694 (name "python-pylint")
1700 "https://github.com/PyCQA/pylint/archive/pylint-"
1704 "0mzn1czhf1mgr2wiqfihb274sja02h899b85kywdpivppa9nwrmp"))))
1705 (build-system python-build-system)
1707 `(("python-pytest" ,python-pytest)
1708 ("python-pytest-runner" ,python-pytest-runner)
1709 ("python-tox" ,python-tox)))
1711 `(("python-astroid" ,python-astroid)
1712 ("python-isort" ,python-isort)
1713 ("python-mccabe" ,python-mccabe)
1714 ("python-six" ,python-six)))
1717 (modify-phases %standard-phases
1720 ;; Somehow, tests for python2-pylint
1721 ;; fail if run from the build directory
1722 (let ((work "/tmp/work"))
1724 (setenv "PYTHONPATH"
1725 (string-append (getenv "PYTHONPATH") ":" work))
1726 (copy-recursively "." work)
1727 (with-directory-excursion "/tmp"
1728 (invoke "python" "-m" "unittest" "discover"
1729 "-s" (string-append work "/pylint/test")
1730 "-p" "*test_*.py"))))))))
1731 (home-page "https://github.com/PyCQA/pylint")
1732 (synopsis "Python source code analyzer which looks for coding standard
1734 (description "Pylint is a Python source code analyzer which looks
1735 for programming errors, helps enforcing a coding standard and sniffs
1736 for some code smells (as defined in Martin Fowler's Refactoring book).
1738 Pylint has many rules enabled by default, way too much to silence them
1739 all on a minimally sized program. It's highly configurable and handle
1740 pragmas to control it from within your code. Additionally, it is
1741 possible to write plugins to add your own checks.")
1742 (properties `((python2-variant . ,(delay python2-pylint))))
1743 (license license:gpl2+)))
1745 (define-public python2-pylint
1746 (let ((pylint (package-with-python2
1747 (strip-python2-variant python-pylint))))
1748 (package (inherit pylint)
1750 `(("python2-backports-functools-lru-cache"
1751 ,python2-backports-functools-lru-cache)
1752 ("python2-configparser" ,python2-configparser)
1753 ,@(package-propagated-inputs pylint))))))
1755 (define-public python-paramunittest
1757 (name "python-paramunittest")
1762 (uri (pypi-uri "ParamUnittest" version))
1765 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
1766 (build-system python-build-system)
1768 "https://github.com/rik0/ParamUnittest")
1770 "Simple extension to have parametrized unit tests")
1772 "This package allows to create parametrized unit-tests that work with the standard
1773 unittest package. A parametrized test case is automatically converted to multiple test
1774 cases. Since they are TestCase subclasses, they work with other test suites that
1775 recognize TestCases.")
1776 (license license:bsd-2)))
1778 (define-public python2-python-paramunittest
1779 (package-with-python2 python-paramunittest))
1781 (define-public python-pytest-warnings
1783 (name "python-pytest-warnings")
1788 (uri (pypi-uri "pytest-warnings" version))
1791 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
1792 (build-system python-build-system)
1794 `(("pytest" ,python-pytest)))
1795 (home-page "https://github.com/fschulze/pytest-warnings")
1796 (synopsis "Pytest plugin to list Python warnings in pytest report")
1798 "Python-pytest-warnings is a pytest plugin to list Python warnings in
1800 (license license:expat)
1801 (properties `((python2-variant . ,(delay python2-pytest-warnings))
1802 ;; This package is part of pytest as of version 3.1.0.
1803 (superseded . ,python-pytest)))))
1805 (define-public python2-pytest-warnings
1806 (package (inherit (package-with-python2
1807 (strip-python2-variant python-pytest-warnings)))
1808 (properties `((superseded . ,python2-pytest)))))
1810 (define-public python-pytest-capturelog
1812 (name "python-pytest-capturelog")
1817 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
1820 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
1821 (build-system python-build-system)
1823 `(("pytest" ,python-pytest)))
1824 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
1825 (synopsis "Pytest plugin to catch log messages")
1827 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
1828 (license license:expat)))
1830 (define-public python2-pytest-capturelog
1831 (package-with-python2 python-pytest-capturelog))
1833 (define-public python-pytest-catchlog
1835 (name "python-pytest-catchlog")
1840 (uri (pypi-uri "pytest-catchlog" version ".zip"))
1843 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
1844 (build-system python-build-system)
1846 `(("unzip" ,unzip)))
1848 `(("pytest" ,python-pytest)))
1849 (home-page "https://github.com/eisensheng/pytest-catchlog")
1850 (synopsis "Pytest plugin to catch log messages")
1852 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
1853 a fork of pytest-capturelog.")
1854 (license license:expat)))
1856 (define-public python2-pytest-catchlog
1857 (package-with-python2 python-pytest-catchlog))
1859 (define-public python-nosexcover
1861 (name "python-nosexcover")
1865 (uri (pypi-uri "nosexcover" version))
1868 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
1869 (build-system python-build-system)
1871 `(("python-coverage" ,python-coverage)
1872 ("python-nose" ,python-nose)))
1873 (home-page "http://github.com/cmheisel/nose-xcover")
1874 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
1875 (description "Nose-xcover is a companion to the built-in
1876 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
1877 to a file named coverage.xml.
1879 It will honor all the options you pass to the Nose coverage plugin,
1880 especially -cover-package.")
1881 (license license:expat)))
1883 (define-public python2-nosexcover
1884 (package-with-python2 python-nosexcover))
1886 (define-public python-discover
1888 (name "python-discover")
1893 (uri (pypi-uri "discover" version))
1896 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
1897 (build-system python-build-system)
1898 (home-page "http://pypi.python.org/pypi/discover/")
1900 "Python test discovery for unittest")
1902 "Discover provides test discovery for unittest, a feature that has been
1903 backported from Python 2.7 for Python 2.4+.")
1904 (license license:bsd-3)))
1906 (define-public python2-discover
1907 (package-with-python2 python-discover))
1909 (define-public behave
1915 (uri (pypi-uri "behave" version))
1918 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))))
1919 (build-system python-build-system)
1921 `(("python-mock" ,python-mock)
1922 ("python-nose" ,python-nose)
1923 ("python-pathpy" ,python-pathpy)
1924 ("python-pyhamcrest" ,python-pyhamcrest)
1925 ("python-pytest" ,python-pytest)))
1927 `(("python-importlib-metadata" ,python-importlib-metadata)
1928 ("python-six" ,python-six)
1929 ("python-parse" ,python-parse)
1930 ("python-parse-type" ,python-parse-type)))
1932 '(#:test-target "behave_test"))
1933 (home-page "https://github.com/behave/behave")
1934 (synopsis "Python behavior-driven development")
1936 "Behave is a tool for behavior-driven development in python.
1937 Behavior-driven development (or BDD) is an agile software development
1938 technique that encourages collaboration between developers, QA and
1939 non-technical or business participants in a software project. Behave uses
1940 tests written in a natural language style, backed up by Python code.")
1941 (license license:x11)))
1943 (define-public python-behave-web-api
1945 (name "python-behave-web-api")
1950 (uri (pypi-uri "behave-web-api" version))
1953 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
1954 (build-system python-build-system)
1957 (modify-phases %standard-phases
1958 (add-after 'unpack 'fix-dependencies
1960 (substitute* "setup.py"
1961 (("'wheel'") "") ; We don't use it.
1962 (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
1965 `(("behave" ,behave)
1966 ("python-requests" ,python-requests)))
1967 (home-page "https://github.com/jefersondaniel/behave-web-api")
1968 (synopsis "Provides testing for JSON APIs with Behave for Python")
1969 (description "This package provides testing utility modules for testing
1970 JSON APIs with Behave.")
1971 (license license:expat)))
1973 (define-public python2-behave-web-api
1974 (package-with-python2 python-behave-web-api))
1976 (define-public python-rednose
1978 (name "python-rednose")
1983 (uri (pypi-uri "rednose" version))
1986 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
1987 (build-system python-build-system)
1989 `(#:phases (modify-phases %standard-phases
1990 (add-after 'unpack 'patch-setup.py
1992 ;; Six is only required for tests and later versions
1994 (substitute* "setup.py"
1995 (("six==1.10.0") "six"))
1998 `(("python-colorama" ,python-colorama)
1999 ("python-termstyle" ,python-termstyle)))
2001 `(("python-six" ,python-six)
2002 ("python-nose" ,python-nose)))
2003 (home-page "https://github.com/JBKahn/rednose")
2004 (synopsis "Colored output for Python nosetests")
2005 (description "This package provides colored output for the
2006 @command{nosetests} command of the Python Nose unit test framework.")
2007 (license license:bsd-3)))
2009 (define-public python2-rednose
2010 (package-with-python2 python-rednose))
2012 (define-public python-nose-randomly
2014 (name "python-nose-randomly")
2019 (uri (pypi-uri "nose-randomly" version))
2021 (base32 "0z662rqhfk4bjmg806mn4frb8nz4gbh7mrddsrhfffp1g4yklj3y"))))
2022 (build-system python-build-system)
2024 `(("python-nose" ,python-nose)
2025 ("python-numpy" ,python-numpy)))
2026 (home-page "https://github.com/adamchainz/nose-randomly")
2028 "Nose plugin to randomly order tests and control random.seed")
2030 "This is a @code{Nose} plugin to randomly order tests which can be quite
2031 powerful in discovering hidden flaws in the tests themselves, while helping to
2032 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
2033 by resetting it to a repeatable number for each test, enabling the tests to
2034 create data based on random numbers and yet remain repeatable.")
2035 (license license:bsd-3)))
2037 (define-public python2-nose-randomly
2038 (package-with-python2 python-nose-randomly))
2040 (define-public python-nose-timer
2042 (name "python-nose-timer")
2047 (uri (pypi-uri "nose-timer" version))
2049 (base32 "05wzkc88vbzw62pqkvhl33211b90kns0lny70b7qw62rcg4flzk4"))))
2050 (build-system python-build-system)
2052 `(("python-nose" ,python-nose)
2053 ("python-termcolor" ,python-termcolor)))
2054 (home-page "https://github.com/mahmoudimus/nose-timer")
2055 (synopsis "Timer plugin for nosetests")
2056 (description "Shows how much time was needed to run individual tests.")
2057 (license license:expat)))
2059 (define-public python2-nose-timer
2060 (package-with-python2 python-nose-timer))
2062 (define-public python-freezegun
2064 (name "python-freezegun")
2069 (uri (pypi-uri "freezegun" version))
2071 (base32 "1rx57v8ryjncjimg8hys9kx1r3rknvwcl4y340g20jn0sf69qk9a"))))
2072 (build-system python-build-system)
2074 `(("python-mock" ,python-mock)
2075 ("python-pytest" ,python-pytest)))
2077 `(("python-six" ,python-six)
2078 ("python-dateutil" ,python-dateutil)))
2081 (modify-phases %standard-phases
2082 ;; The tests are normally executed via `make test`, but the PyPi
2083 ;; package does not include the Makefile.
2086 (invoke "pytest" "-vv"))))))
2087 (home-page "https://github.com/spulec/freezegun")
2088 (synopsis "Test utility for mocking the datetime module")
2090 "FreezeGun is a library that allows your python tests to travel through
2091 time by mocking the datetime module.")
2092 (license license:asl2.0)))
2094 (define-public python2-freezegun
2095 (package-with-python2 python-freezegun))
2097 (define-public python-flexmock
2099 (name "python-flexmock")
2103 (uri (pypi-uri "flexmock" version))
2106 "0b6qw3grhgx58kxlkj7mdma7xdvlj02zabvcf7w2qifnfjwwwcsh"))))
2107 (build-system python-build-system)
2108 (home-page "https://flexmock.readthedocs.org")
2109 (synopsis "Testing library for Python")
2111 "flexmock is a testing library for Python that makes it easy to create
2112 mocks, stubs and fakes.")
2113 (license license:bsd-3)))
2115 (define-public python2-flexmock
2116 (package-with-python2 python-flexmock))
2118 (define-public python-flaky
2120 (name "python-flaky")
2124 (uri (pypi-uri "flaky" version))
2127 "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j"))))
2128 (build-system python-build-system)
2130 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2132 (home-page "https://github.com/box/flaky")
2133 (synopsis "Automatically rerun flaky tests")
2135 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2138 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2139 on components that aren't 100% reliable. With flaky, instead of removing
2140 those tests or marking them to @code{@@skip}, they can be automatically
2142 (license license:asl2.0)))
2144 (define-public python2-flaky
2145 (package-with-python2 python-flaky))
2147 (define-public python-pyhamcrest
2149 (name "python-pyhamcrest")
2152 ;; Tests not distributed from pypi release.
2155 (url "https://github.com/hamcrest/PyHamcrest")
2156 (commit (string-append "V" version))))
2157 (file-name (git-file-name name version))
2160 "01qnzj9qnzz0y78qa3ing24ssvszb0adw59xc4qqmdn5wryy606b"))))
2161 (native-inputs ; All native inputs are for tests
2162 `(("python-pytest-cov" ,python-pytest-cov)
2163 ("python-mock" ,python-mock)
2164 ("python-pytest" ,python-pytest)
2165 ("python-hypothesis" ,python-hypothesis)))
2167 `(("python-six" ,python-six)))
2168 (build-system python-build-system)
2169 (home-page "http://hamcrest.org/")
2170 (synopsis "Hamcrest matchers for Python")
2172 "PyHamcrest is a framework for writing matcher objects,
2173 allowing you to declaratively define \"match\" rules.")
2174 (license license:bsd-3)))
2176 (define-public python2-pyhamcrest
2177 (package-with-python2 python-pyhamcrest))
2179 (define-public unittest-cpp
2181 (name "unittest-cpp")
2186 (url "https://github.com/unittest-cpp/unittest-cpp")
2187 (commit (string-append "v" version))))
2188 (file-name (git-file-name name version))
2190 (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
2192 `(#:tests? #f)) ; It's run after build automatically.
2193 (build-system cmake-build-system)
2194 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2195 (synopsis "Lightweight unit testing framework for C++")
2196 (description "UnitTest++ is a lightweight unit testing framework for C++.
2197 It was designed to do test-driven development on a wide variety of platforms.
2198 Simplicity, portability, speed, and small footprint are all very important
2199 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2200 of advanced library and language features, which means it should be easily
2201 portable to just about any platform.")
2202 (license license:expat)))
2204 (define-public libfaketime
2206 (name "libfaketime")
2208 (home-page "https://github.com/wolfcw/libfaketime")
2213 (commit (string-append "v" version))))
2216 "1cin1pqwpsswcv7amiwijirvcg3x1zf2l00s1x84nxc5602fzr5c"))
2217 (file-name (git-file-name name version))))
2218 (build-system gnu-build-system)
2220 '(#:phases (modify-phases %standard-phases
2222 (lambda* (#:key outputs #:allow-other-keys)
2223 (let ((out (assoc-ref outputs "out")))
2225 (setenv "PREFIX" out)
2227 (add-before 'check 'pre-check
2229 (substitute* "test/functests/test_exclude_mono.sh"
2230 (("/bin/bash") (which "bash")))
2232 #:test-target "test"))
2234 `(("perl" ,perl))) ;for tests
2235 (synopsis "Fake the system time for single applications")
2237 "The libfaketime library allows users to modify the system time that an
2238 application \"sees\". It is meant to be loaded using the dynamic linker's
2239 @code{LD_PRELOAD} environment variable. The @command{faketime} command
2240 provides a simple way to achieve this.")
2241 (license license:gpl2)))
2243 (define-public umockdev
2249 (uri (string-append "https://github.com/martinpitt/umockdev/"
2250 "releases/download/" version "/"
2251 "umockdev-" version ".tar.xz"))
2254 "1hx5jm9afng6hw9wyp524z8nwdp6w053pca0w2c0gqpgrmvjxvd2"))))
2255 (build-system gnu-build-system)
2258 (modify-phases %standard-phases
2259 (add-after 'unpack 'skip-broken-test
2261 (substitute* "tests/test-umockdev.c"
2262 (("/\\* sys/ in other dir")
2263 (string-append "return; // ")))
2267 ("python" ,python) ; for tests
2268 ("which" ,which) ; for tests
2269 ("gtk-doc" ,gtk-doc)
2270 ("pkg-config" ,pkg-config)))
2274 ("libgudev" ,libgudev)
2275 ("gobject-introspection" ,gobject-introspection)))
2276 (home-page "https://github.com/martinpitt/umockdev/")
2277 (synopsis "Mock hardware devices for creating unit tests")
2278 (description "umockdev mocks hardware devices for creating integration
2279 tests for hardware related libraries and programs. It also provides tools to
2280 record the properties and behaviour of particular devices, and to run a
2281 program or test suite under a test bed with the previously recorded devices
2283 (license license:lgpl2.1+)))
2285 (define-public python-pyfakefs
2287 (name "python-pyfakefs")
2291 ;; We use the PyPI URL because there is no proper release
2292 ;; available from GitHub. The GitHub project only provides
2293 ;; autogenerated tarballs, which are known to change in place.
2294 (uri (pypi-uri "pyfakefs" version))
2297 "0qb9jp0bqhc0dv0rn805fv99029fvx135f3bvka6scfkcl6jgllc"))
2298 (patches (search-patches
2299 "python-pyfakefs-remove-bad-test.patch"))
2300 (file-name (string-append name "-" version ".tar.gz"))))
2303 (modify-phases %standard-phases
2304 ;; The default test suite does not run these extra tests.
2305 (add-after 'check 'check-pytest-plugin
2308 "python" "-m" "pytest"
2309 "pyfakefs/pytest_tests/pytest_plugin_test.py")
2312 `(("python-pytest" ,python-pytest)))
2313 (build-system python-build-system)
2314 ;; Guix lint doesn't like that this is a permanent redirect to the GitHub
2315 ;; page, but the pyfakefs documentation asks us to use this specific URL
2316 ;; when linking to the project. Honor their request.
2317 (home-page "http://pyfakefs.org/")
2318 ;; TRANSLATORS: In the synopsis, "Mock" is a verb.
2319 (synopsis "Mock file system interactions in tests")
2321 "This package provides a Python library intended for use in automated
2322 tests. One difficulty when testing software is that the code under test might
2323 need to read or write to files in the local file system. If the file system
2324 is not set up in just the right way, it might cause a spurious error during
2325 the test. The pyfakefs library provides a solution to problems like this by
2326 mocking file system interactions. In other words, it arranges for the code
2327 under test to interact with a fake file system instead of the real file
2328 system. The code under test requires no modification to work with pyfakefs.")
2329 (license license:asl2.0)))
2331 (define-public python2-pyfakefs
2332 (package-with-python2 python-pyfakefs))