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 "1027cyfx5gsjkdkaf6c2wnjh68882grw8n672018cj3vs9lrhmix"))))
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 ;; When dependent packages upgraded to use newer version of catch, this one should
161 (define-public catch-framework
164 (version "1.3.5") ;Sub-minor is the build number
168 (url "https://github.com/philsquared/Catch")
170 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
171 (file-name (string-append name "-" version))
174 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
175 (build-system trivial-build-system)
177 `(#:modules ((guix build utils))
179 (use-modules (guix build utils))
180 (let* ((source (assoc-ref %build-inputs "source"))
181 (output (assoc-ref %outputs "out"))
182 (incdir (string-append output "/include"))
183 (docdir (string-append output "/share/doc/catch-"
185 (for-each mkdir-p (list incdir docdir))
186 (install-file (string-append source
187 "/single_include/catch.hpp")
189 (copy-recursively (string-append source "/docs")
192 (home-page "http://catch-lib.net/")
193 (synopsis "Automated test framework for C++ and Objective-C")
195 "Catch stands for C++ Automated Test Cases in Headers and is a
196 multi-paradigm automated test framework for C++ and Objective-C.")
197 (license license:boost1.0)))
199 (define-public catch-framework2
203 (home-page "https://github.com/catchorg/Catch2")
207 (url "https://github.com/catchorg/Catch2")
208 (commit (string-append "v" version))))
209 (file-name (git-file-name name version))
212 "1gdp5wm8khn02g2miz381llw3191k7309qj8s3jd6sasj01rhf23"))))
213 (build-system cmake-build-system)
214 (synopsis "Automated test framework for C++ and Objective-C")
215 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
216 a multi-paradigm automated test framework for C++ and Objective-C.")
217 (license license:boost1.0)))
219 (define-public cmdtest
225 (uri (string-append "http://git.liw.fi/cmdtest/snapshot/"
226 name "-" version ".tar.gz"))
229 "1jmfiyrrqmpvwdb273bkb8hjaf4rwx9njblx29pmr7giyahskwi5"))))
230 (build-system python-build-system)
234 (modify-phases %standard-phases
235 ;; check phase needs to be run before the build phase. If not, the
236 ;; coverage test runner looks for tests for the built source files,
239 (add-before 'build 'check
242 (("/bin/sh") (which "sh")))
243 ;; yarn uses python2-ttystatus to print messages.
244 ;; python2-ttystatus requires /dev/tty which is not present in
245 ;; the build environment. Hence assuming-failure test fails.
246 (delete-file "yarn.tests/assuming-failure.script")
247 (delete-file "yarn.tests/assuming-failure.stdout")
248 (invoke "python" "setup.py" "check"))))))
250 `(("python2-coverage-test-runner" ,python2-coverage-test-runner)))
252 `(("python2-cliapp" ,python2-cliapp)
253 ("python2-markdown" ,python2-markdown)
254 ("python2-ttystatus" ,python2-ttystatus)))
255 (home-page "https://liw.fi/cmdtest/")
256 (synopsis "Black box Unix program tester")
258 "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
259 given a command line and input files, and the expected output, and it verifies
260 that the command line produces the expected output. If not, it reports a
261 problem, and shows the differences.")
262 (license license:gpl3+)))
264 (define-public cmocka
270 (uri (string-append "https://cmocka.org/files/"
271 (version-major+minor version) "/cmocka-"
275 "1bxzzafjlwzgldcb07hjnlnqvh88wh21r2kw7z8f704w5bvvrsj3"))))
276 (build-system cmake-build-system)
278 `(#:tests? #f)) ; no test target
279 (home-page "https://cmocka.org/")
280 (synopsis "Unit testing framework for C")
281 (description "Cmocka is a unit testing framework for C with support for
282 mock objects. It only requires the standard C library, and works with
283 different compilers. Cmocka supports several different message output formats
284 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
286 (license license:asl2.0)))
288 (define-public cppcheck
295 (url "https://github.com/danmar/cppcheck")
297 (file-name (git-file-name name version))
299 (base32 "1xiy54rz99nzbpwj35jiyssd2nc6k5k0lw5ml6nh2qnmbfkl8swl"))))
300 (build-system cmake-build-system)
302 '(#:configure-flags '("-DBUILD_TESTS=ON")))
303 (home-page "http://cppcheck.sourceforge.net")
304 (synopsis "Static C/C++ code analyzer")
305 (description "Cppcheck is a static code analyzer for C and C++. Unlike
306 C/C++ compilers and many other analysis tools it does not detect syntax errors
307 in the code. Cppcheck primarily detects the types of bugs that the compilers
308 normally do not detect. The goal is to detect only real errors in the code
309 (i.e. have zero false positives).")
310 (license license:gpl3+)))
312 (define-public cxxtest
318 (uri (string-append "mirror://sourceforge/cxxtest/cxxtest/"
319 version "/cxxtest-" version ".tar.gz"))
322 "1n7pbj4z9ivx005hqvivj9ddhq8awynzg6jishfbypf6j7ply58w"))))
323 (build-system python-build-system)
326 (modify-phases %standard-phases
327 (add-after 'unpack 'chdir-to-source
331 (add-after 'install 'install-headers
332 (lambda* (#:key outputs #:allow-other-keys)
333 (let* ((out (assoc-ref outputs "out"))
334 (include-dir (string-append out "/include/cxxtest")))
335 (for-each (lambda (header-file)
336 (install-file header-file include-dir))
337 (find-files "../cxxtest"))
339 (add-after 'install 'install-doc
340 (lambda* (#:key outputs #:allow-other-keys)
341 (let* ((out (assoc-ref outputs "out"))
342 (doc-dir (string-append out "/share/doc/cxxtest")))
343 (install-file "../README" doc-dir)
344 (install-file "../doc/guide.txt" doc-dir)
345 (copy-recursively "../sample" (string-append doc-dir "/sample"))
348 `(("python-ply" ,python-ply)))
349 (home-page "https://cxxtest.com/")
350 (synopsis "Unit testing framework for C++")
351 (description "CxxTest is a unit testing framework for C++ that is similar
352 in spirit to JUnit, CppUnit, and xUnit. CxxTest does not require precompiling
353 a CxxTest testing library, it employs no advanced features of C++ (e.g. RTTI)
354 and it supports a very flexible form of test discovery.")
355 (license license:lgpl3+)))
357 (define-public doctest
361 (home-page "https://github.com/onqtam/doctest")
364 (uri (git-reference (url home-page) (commit version)))
365 (file-name (git-file-name name version))
368 "0rddlzhnv0f5036q0m0p019pismka7sx6x8cnzk65sk77b1dsbhg"))))
369 (build-system cmake-build-system)
370 (synopsis "C++ test framework")
372 "doctest is a single-header testing framework for C++11 and later. It
373 has been designed to be fast, light and unintrusive.")
374 (license license:expat)))
376 (define-public go-gopkg.in-check.v1
377 (let ((commit "788fd78401277ebd861206a03c884797c6ec5541")
380 (name "go-gopkg.in-check.v1")
381 (version (git-version "0.0.0" revision commit))
385 (url "https://github.com/go-check/check.git")
387 (file-name (git-file-name name version))
390 "0v3bim0j375z81zrpr5qv42knqs0y2qv2vkjiqi5axvb78slki1a"))))
391 (build-system go-build-system)
393 '(#:import-path "gopkg.in/check.v1"))
395 `(("go-github-com-kr-pretty" ,go-github-com-kr-pretty)))
396 (synopsis "Rich testing extension for Go's testing package")
398 "@code{check} is a rich testing extension for Go's testing package.")
399 (home-page "https://github.com/go-check/check")
400 (license license:bsd-2))))
402 (define-public go-github.com-smartystreets-gunit
404 (name "go-github.com-smartystreets-gunit")
409 (url "https://github.com/smartystreets/gunit")
411 (file-name (git-file-name name version))
414 "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
415 (build-system go-build-system)
417 '(;; TODO: This package depends on go-github.com-smartystreets-assertions
418 ;; for running the tests, but go-github.com-smartystreets-assertions
419 ;; depends on this package, so break this loop by not running the tests
422 #:import-path "github.com/smartystreets/gunit"))
423 (synopsis "Testing tool for Go, in the style of xUnit")
425 "@code{gunit} allows the test author to use a struct as the scope for a
426 group of related test cases, in the style of xUnit fixtures. This makes
427 extraction of setup/teardown behavior (as well as invoking the system under
428 test) much simpler.")
429 (home-page "https://github.com/smartystreets/gunit")
430 (license license:expat)))
432 (define-public go-github.com-smartystreets-assertions
434 (name "go-github.com-smartystreets-assertions")
439 (url "https://github.com/smartystreets/assertions")
441 (file-name (git-file-name name version))
444 "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
445 (build-system go-build-system)
447 '(#:import-path "github.com/smartystreets/assertions"))
449 `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
450 (synopsis "Assertions for testing with Go")
452 "The @code{assertions} package provides convenient assertion functions
453 for writing tests in Go.")
454 (home-page "https://github.com/smartystreets/assertions")
455 (license license:expat)))
457 (define-public go-github.com-smartystreets-goconvey
459 (name "go-github.com-smartystreets-goconvey")
464 (url "https://github.com/smartystreets/goconvey")
466 (file-name (git-file-name name version))
469 "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
470 (build-system go-build-system)
472 '(#:import-path "github.com/smartystreets/goconvey"))
474 `(("go-github.com-jtolds-gls" ,go-github.com-jtolds-gls)
475 ("go-github.com-smartystreets-assertions" ,go-github.com-smartystreets-assertions)))
476 (synopsis "Go testing tool with both a web and terminal user interface")
478 "GoConvey is a testing tool for Go. It integrates with go test, can show
479 test coverage and has a web user interface that will refresh automatically.")
480 (home-page "https://github.com/smartystreets/goconvey")
481 (license license:expat)))
483 (define-public googletest
491 (url "https://github.com/google/googletest.git")
492 (commit (string-append "release-" version))))
493 (file-name (git-file-name name version))
495 (base32 "0270msj6n7mggh4xqqjp54kswbl7mkcc8px1p5dqdpmw5ngh9fzk"))))
496 (build-system cmake-build-system)
498 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
500 `(("python-2" ,python-2)))
501 (home-page "https://github.com/google/googletest/")
502 (synopsis "Test discovery and XUnit test framework")
503 (description "Google Test features an XUnit test framework, automated test
504 discovery, death tests, assertions, parameterized tests and XML test report
506 (license license:bsd-3)))
508 (define-public cpputest
515 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
516 version "/cpputest-" version ".tar.gz"))
519 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
520 (build-system gnu-build-system)
522 `(("googletest" ,googletest)))
523 (home-page "https://cpputest.github.io/")
524 (synopsis "Unit testing and mocking framework for C/C++")
526 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
527 C++ but is used in C and C++ projects and frequently used in embedded systems
528 but it works for any C/C++ project.")
529 (license license:bsd-3)))
531 (define-public python-parameterized
533 (name "python-parameterized")
538 (uri (pypi-uri "parameterized" version))
541 "1qj1939shm48d9ql6fm1nrdy4p7sdyj8clz1szh5swwpf1qqxxfa"))))
542 (build-system python-build-system)
543 (arguments '(#:tests? #f)) ; there are no tests
544 (home-page "https://github.com/wolever/parameterized")
545 (synopsis "Parameterized testing with any Python test framework")
547 "Parameterized is a Python library that aims to fix parameterized testing
548 for every Python test framework. It supports nose, py.test, and unittest.")
549 (license license:bsd-2)))
551 (define-public python2-parameterized
552 (package-with-python2 python-parameterized))
554 (define-public python-minimock
556 (name "python-minimock")
561 (uri (pypi-uri "MiniMock" version))
564 "0k2sxb1ibnyg05iblz7zhbv825f1zk9906rab7883iqgvzmdzpsz"))))
565 (build-system python-build-system)
566 (home-page "https://pypi.org/project/MiniMock")
567 (synopsis "Simple Python library for using mock objects")
568 (description "MiniMock is a simple library for building mock objects with
570 (license license:expat)))
572 (define-public python2-minimock
573 (package-with-python2 python-minimock))
575 (define-public python-mock
582 (uri (pypi-uri "mock" version))
585 "1flbpksir5sqrvq2z0dp8sl4bzbadg21sj4d42w3klpdfvgvcn5i"))))
587 `(("python-pbr" ,python-pbr-minimal)
588 ("python-six" ,python-six)))
589 (build-system python-build-system)
591 `(("python-unittest2" ,python-unittest2)))
594 (modify-phases %standard-phases
597 (zero? (system* "unit2")))))))
598 (home-page "https://github.com/testing-cabal/mock")
599 (synopsis "Python mocking and patching library for testing")
601 "Mock is a library for testing in Python. It allows you to replace parts
602 of your system under test with mock objects and make assertions about how they
604 (properties `((python2-variant . ,(delay python2-mock))))
605 (license license:expat)))
607 (define-public python2-mock
608 (let ((base (package-with-python2
609 (strip-python2-variant python-mock))))
610 (package (inherit base)
612 `(("python2-functools32" ,python2-functools32)
613 ("python2-funcsigs" ,python2-funcsigs)
614 ,@(package-propagated-inputs base))))))
616 (define-public python-nose
623 (uri (pypi-uri "nose" version))
626 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
627 (build-system python-build-system)
629 '(#:tests? #f)) ; FIXME: test suite fails
630 (home-page "http://readthedocs.org/docs/nose/")
631 (synopsis "Python testing library")
633 "Nose extends the unittest library to make testing easier.")
634 (license license:lgpl2.0+)))
636 (define-public python2-nose
637 (package-with-python2 python-nose))
639 (define-public python-nose2
641 (name "python-nose2")
646 (uri (pypi-uri "nose2" version))
649 "1x4zjq1zlyrh8b9ba0cmafd3w94pxhid408kibyjd3s6h1lap6s7"))))
650 (build-system python-build-system)
651 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
653 `(("python-cov-core" ,python-cov-core)
654 ("python-pytest-cov" ,python-pytest-cov)
655 ("python-six" ,python-six)))
656 (home-page "https://github.com/nose-devs/nose2")
657 (synopsis "Next generation of nicer testing for Python")
659 "Nose2 is the next generation of nicer testing for Python, based on the
660 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
661 better plugin api, being easier for users to configure, and simplifying internal
662 interfaces and processes.")
663 (license license:bsd-2)))
665 (define-public python2-nose2
666 (package-with-python2 python-nose2))
668 (define-public python-unittest2
670 (name "python-unittest2")
675 (uri (pypi-uri "unittest2" version))
677 (search-patches "python-unittest2-python3-compat.patch"
678 "python-unittest2-remove-argparse.patch"))
681 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
682 (build-system python-build-system)
685 (modify-phases %standard-phases
688 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
690 `(("python-six" ,python-six)
691 ("python-traceback2" ,python-traceback2)))
692 (home-page "http://pypi.python.org/pypi/unittest2")
693 (synopsis "Python unit testing library")
695 "Unittest2 is a replacement for the unittest module in the Python
697 (license license:psfl)))
699 (define-public python2-unittest2
700 (package-with-python2 python-unittest2))
702 (define-public python-pytest
704 (name "python-pytest")
709 (uri (pypi-uri "pytest" version))
712 "18w38kjnffdcrlbw6ny6dksgxai6x9bxpjs2m6klqmb8hfzjkcb2"))))
713 (build-system python-build-system)
716 (modify-phases %standard-phases
719 (invoke "pytest" "-vv" "-k"
721 ;; These tests involve the /usr directory, and fails.
722 "not test_remove_dir_prefix"
723 " and not test_argcomplete"
724 ;; This test tries to override PYTHONPATH, and
725 ;; subsequently fails to locate the test libraries.
726 " and not test_collection")))))))
728 `(("python-atomicwrites" ,python-atomicwrites)
729 ("python-attrs" ,python-attrs-bootstrap)
730 ("python-more-itertools" ,python-more-itertools)
731 ("python-pluggy" ,python-pluggy)
732 ("python-py" ,python-py)
733 ("python-six" ,python-six-bootstrap)))
735 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
737 ("python-hypothesis" ,python-hypothesis)
738 ("python-nose" ,python-nose)
739 ("python-mock" ,python-mock)
740 ("python-pytest" ,python-pytest-bootstrap)
741 ("python-setuptools-scm" ,python-setuptools-scm)))
742 (home-page "https://docs.pytest.org/en/latest/")
743 (synopsis "Python testing library")
745 "Pytest is a testing tool that provides auto-discovery of test modules
746 and functions, detailed info on failing assert statements, modular fixtures,
747 and many external plugins.")
748 (license license:expat)
749 (properties `((python2-variant . ,(delay python2-pytest))))))
751 (define-public python2-pytest
752 (let ((pytest (package-with-python2
753 (strip-python2-variant python-pytest))))
757 `(("python2-funcsigs" ,python2-funcsigs)
758 ("python2-pathlib2" ,python2-pathlib2)
759 ,@(package-propagated-inputs pytest))))))
761 (define-public python-pytest-bootstrap
763 (inherit (strip-python2-variant python-pytest))
764 (name "python-pytest-bootstrap")
765 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
766 (arguments `(#:tests? #f))
767 (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
769 (define-public python2-pytest-bootstrap
770 (let ((pytest (package-with-python2
771 (strip-python2-variant python-pytest-bootstrap))))
772 (package (inherit pytest)
774 `(("python2-funcsigs" ,python2-funcsigs-bootstrap)
775 ("python2-pathlib2" ,python2-pathlib2-bootstrap)
776 ,@(package-propagated-inputs pytest))))))
778 (define-public python-pytest-cov
780 (name "python-pytest-cov")
785 (uri (pypi-uri "pytest-cov" version))
787 (base32 "0cyxbbghx2l4p60w10k00j1j74q1ngfiffr0pxn73ababjr69dha"))))
788 (build-system python-build-system)
791 (modify-phases %standard-phases
794 ;; Options taken from tox.ini.
795 ;; TODO: make "--restructuredtext" tests pass. They currently fail
796 ;; with "Duplicate implicit target name".
797 (invoke "python" "./setup.py" "check"
798 "--strict" "--metadata"))))))
800 `(("python-coverage" ,python-coverage)
801 ("python-pytest" ,python-pytest)))
802 (home-page "https://github.com/pytest-dev/pytest-cov")
803 (synopsis "Pytest plugin for measuring coverage")
805 "Pytest-cov produces coverage reports. It supports centralised testing and
806 distributed testing in both @code{load} and @code{each} modes. It also
807 supports coverage of subprocesses.")
808 (license license:expat)))
810 (define-public python2-pytest-cov
811 (package-with-python2 python-pytest-cov))
813 (define-public python-pytest-runner
815 (name "python-pytest-runner")
820 (uri (pypi-uri "pytest-runner" version))
823 "1x0d9n40lsiphblbs61rdc0d5r31f6vh0vcahqdv0mffakbnrb80"))))
824 (build-system python-build-system)
826 `(("python-pytest" ,python-pytest-bootstrap)
827 ("python-setuptools-scm" ,python-setuptools-scm)))
828 (home-page "https://github.com/pytest-dev/pytest-runner")
829 (synopsis "Invoke py.test as a distutils command")
831 "This package provides a @command{pytest-runner} command that
832 @file{setup.py} files can use to run tests.")
833 (license license:expat)))
835 (define-public python2-pytest-runner
836 (package-with-python2 python-pytest-runner))
838 ;; python-bleach 3.1.0 requires this ancient version of pytest-runner.
839 ;; Remove once no longer needed.
840 (define-public python-pytest-runner-2
846 (uri (pypi-uri "pytest-runner" version))
849 "11ivjj9hfphkv4yfb2g74av4yy86y8gcbf7gbif0p1hcdfnxg3w6"))))))
851 (define-public python2-pytest-runner-2
852 (package-with-python2 python-pytest-runner-2))
854 (define-public python-pytest-mock
856 (name "python-pytest-mock")
861 (uri (pypi-uri "pytest-mock" version))
864 "1i5mg3ff1qk0wqfcxfz60hwy3q5dskdp36i10ckigkzffg8hc3ad"))))
865 (build-system python-build-system)
867 `(("python-setuptools-scm" ,python-setuptools-scm)))
869 `(("python-pytest" ,python-pytest)))
870 (home-page "https://github.com/pytest-dev/pytest-mock/")
871 (synopsis "Thin-wrapper around the mock package for easier use with py.test")
873 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
874 around the patching API provided by the @code{mock} package, but with the
875 benefit of not having to worry about undoing patches at the end of a test.
876 The mocker fixture has the same API as @code{mock.patch}, supporting the
878 (properties `((python2-variant . ,(delay python2-pytest-mock))))
879 (license license:expat)))
881 (define-public python2-pytest-mock
882 (let ((base (package-with-python2
883 (strip-python2-variant python-pytest-mock))))
884 (package (inherit base)
886 `(("python2-mock" ,python2-mock)
887 ,@(package-propagated-inputs base))))))
889 (define-public python-pytest-xdist
891 (name "python-pytest-xdist")
896 (uri (pypi-uri "pytest-xdist" version))
899 "1d812apvcmshh2l8f38spqwb3bpp0x43yy7lyfpxxzc99h4r7y4n"))
900 (modules '((guix build utils)))
903 ;; Remove pre-compiled .pyc files from source.
904 (for-each delete-file-recursively
905 (find-files "." "__pycache__" #:directories? #t))
906 (for-each delete-file (find-files "." "\\.pyc$"))
908 (build-system python-build-system)
910 '(#:tests? #f)) ;FIXME: Some tests are failing.
912 ;; (modify-phases %standard-phases
914 ;; (add-after 'install 'check
915 ;; (lambda* (#:key inputs outputs #:allow-other-keys)
916 ;; (add-installed-pythonpath inputs outputs)
917 ;; (zero? (system* "py.test" "-v")))))
919 `(("python-setuptools-scm" ,python-setuptools-scm)))
921 `(("python-execnet" ,python-execnet)
922 ("python-pytest" ,python-pytest)
923 ("python-py" ,python-py)))
925 "https://github.com/pytest-dev/pytest-xdist")
927 "Plugin for py.test with distributed testing and loop-on-failing modes")
929 "The pytest-xdist plugin extends py.test with some unique test execution
930 modes: parallelization, running tests in boxed subprocesses, the ability
931 to run tests repeatedly when failed, and the ability to run tests on multiple
932 Python interpreters or platforms. It uses rsync to copy the existing
933 program code to a remote location, executes there, and then syncs the
935 (license license:expat)))
937 (define-public python2-pytest-xdist
938 (package-with-python2 python-pytest-xdist))
940 (define-public python-pytest-timeout
942 (name "python-pytest-timeout")
947 (uri (pypi-uri "pytest-timeout" version))
950 "1cczcjhw4xx5sjkhxlhc5c1bkr7x6fcyx12wrnvwfckshdvblc2a"))))
951 (build-system python-build-system)
953 `(("python-pytest" ,python-pytest)))
954 (home-page "http://bitbucket.org/pytest-dev/pytest-timeout/")
955 (synopsis "Plugin for py.test to abort hanging tests")
957 "This package provides a py.test plugin that aborts hanging tests after a
958 timeout has been exceeded.")
959 (license license:expat)))
961 (define-public python-scripttest
963 (name "python-scripttest")
968 (uri (pypi-uri "scripttest" version))
971 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
972 (build-system python-build-system)
974 `(("python-pytest" ,python-pytest)))
975 (home-page "http://pythonpaste.org/scripttest/")
976 (synopsis "Python library to test command-line scripts")
977 (description "Scripttest is a Python helper library for testing
978 interactive command-line applications. With it you can run a script in a
979 subprocess and see the output as well as any file modifications.")
980 (license license:expat)))
982 (define-public python2-scripttest
983 (package-with-python2 python-scripttest))
985 (define-public python-testtools-bootstrap
987 (name "python-testtools-bootstrap")
992 (uri (pypi-uri "testtools" version))
995 "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
996 (patches (search-patches "python-testtools.patch"))))
997 (build-system python-build-system)
998 (arguments '(#:tests? #f))
1000 `(("python-extras" ,python-extras)
1001 ("python-fixtures" ,python-fixtures-bootstrap)
1002 ("python-mimeparse" ,python-mimeparse)
1003 ("python-pbr" ,python-pbr-minimal)
1004 ("python-six" ,python-six)
1005 ("python-traceback2" ,python-traceback2)
1006 ("python-unittest2" ,python-unittest2)))
1007 (home-page "https://github.com/testing-cabal/testtools")
1009 "Extensions to the Python standard library unit testing framework")
1011 "This package is only for bootstrapping. Do not use this.")
1012 (license license:psfl)))
1014 (define-public python2-testtools-bootstrap
1015 (package-with-python2 python-testtools-bootstrap))
1017 (define-public python-testtools
1019 (inherit python-testtools-bootstrap)
1020 (name "python-testtools")
1022 `(#:phases (modify-phases %standard-phases
1025 (invoke "python" "-m" "testtools.run"
1026 "testtools.tests.test_suite"))))))
1028 `(("python-extras" ,python-extras)
1029 ("python-fixtures" ,python-fixtures)
1030 ("python-mimeparse" ,python-mimeparse)
1031 ("python-pbr" ,python-pbr)
1032 ("python-six" ,python-six)
1033 ("python-traceback2" ,python-traceback2)
1034 ("python-unittest2" ,python-unittest2)))
1036 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
1038 "Testtools extends the Python standard library unit testing framework to
1039 provide matchers, more debugging information, and cross-Python
1042 (define-public python2-testtools
1043 (package-with-python2 python-testtools))
1045 (define-public python-testscenarios-bootstrap
1047 (name "python-testscenarios-bootstrap")
1052 (uri (pypi-uri "testscenarios" version))
1055 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
1056 (build-system python-build-system)
1058 `(#:phases (modify-phases %standard-phases
1061 (invoke "python" "-m" "testtools.run"
1062 "testscenarios.test_suite"))))))
1064 `(("python-pbr" ,python-pbr-minimal)
1065 ("python-testtools" ,python-testtools-bootstrap)))
1066 (home-page "https://launchpad.net/testscenarios")
1067 (synopsis "Pyunit extension for dependency injection")
1069 "This package is only for bootstrapping. Don't use this.")
1070 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1072 (define-public python2-testscenarios-bootstrap
1073 (package-with-python2 python-testscenarios-bootstrap))
1075 (define-public python-testscenarios
1077 (inherit python-testscenarios-bootstrap)
1078 (name "python-testscenarios")
1080 `(("python-pbr" ,python-pbr)
1081 ("python-testtools" ,python-testtools)))
1083 "Testscenarios provides clean dependency injection for Python unittest
1086 (define-public python2-testscenarios
1087 (package-with-python2 python-testscenarios))
1089 ;; Testresources requires python-pbr at runtime, but pbr needs it for its
1090 ;; own tests. Hence this bootstrap variant.
1091 (define-public python-testresources-bootstrap
1093 (name "python-testresources-bootstrap")
1097 (uri (pypi-uri "testresources" version))
1100 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
1101 (build-system python-build-system)
1102 (arguments '(#:tests? #f))
1104 `(("python-pbr" ,python-pbr-minimal)))
1105 (home-page "https://launchpad.net/testresources")
1107 "Pyunit extension for managing test resources")
1109 "This package is only here for bootstrapping purposes. Use the regular
1110 testresources package instead.")
1111 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1113 (define-public python2-testresources-bootstrap
1114 (package-with-python2 python-testresources-bootstrap))
1116 (define-public python-testresources
1118 (inherit python-testresources-bootstrap)
1119 (name "python-testresources")
1121 `(("python-pbr" ,python-pbr)))
1124 `(("python-fixtures" ,python-fixtures)
1125 ("python-testtols" ,python-testtools)))
1127 "Testresources is an extension to Python's unittest to allow declarative
1128 use of resources by test cases.")))
1130 (define-public python2-testresources
1131 (package-with-python2 python-testresources))
1133 (define-public python-subunit-bootstrap
1135 (name "python-subunit-bootstrap")
1140 (uri (pypi-uri "python-subunit" version))
1143 "1fsw8rsn1s3nklx06mayrg5rn2zbky6wwjc5z07s7rf1wjzfs1wn"))))
1144 (build-system python-build-system)
1146 `(("python-extras" ,python-extras)
1147 ("python-testtools" ,python-testtools-bootstrap)))
1149 `(("python-fixtures" ,python-fixtures-bootstrap)
1150 ("python-hypothesis" ,python-hypothesis)
1151 ("python-testscenarios" ,python-testscenarios-bootstrap)))
1152 (home-page "https://launchpad.net/subunit")
1153 (synopsis "Python implementation of the subunit protocol")
1155 "This package is here for bootstrapping purposes only. Use the regular
1156 python-subunit package instead.")
1157 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1159 (define-public python2-subunit-bootstrap
1160 (package-with-python2 python-subunit-bootstrap))
1162 (define-public python-subunit
1164 (inherit python-subunit-bootstrap)
1165 (name "python-subunit")
1167 `(("python-extras" ,python-extras)
1168 ("python-testtools" ,python-testtools)))
1170 `(("python-fixtures" ,python-fixtures)
1171 ("python-hypothesis" ,python-hypothesis)
1172 ("python-testscenarios" ,python-testscenarios)))
1174 "Python-subunit is a Python implementation of the subunit test streaming
1177 (define-public python2-subunit
1178 (package-with-python2 python-subunit))
1180 ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
1181 ;; own tests. Hence this bootstrap variant.
1182 (define-public python-fixtures-bootstrap
1184 (name "python-fixtures-bootstrap")
1188 (uri (pypi-uri "fixtures" version))
1191 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
1192 (build-system python-build-system)
1193 (arguments `(#:tests? #f))
1195 `(("python-pbr-minimal" ,python-pbr-minimal)
1196 ("python-six" ,python-six)))
1197 (home-page "https://launchpad.net/python-fixtures")
1198 (synopsis "Python test fixture library")
1200 "This package is only used for bootstrapping. Use the regular
1201 python-fixtures package instead.")
1202 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1204 (define-public python2-fixtures-bootstrap
1205 (package-with-python2 python-fixtures-bootstrap))
1207 (define-public python-fixtures
1209 (inherit python-fixtures-bootstrap)
1210 (name "python-fixtures")
1213 (modify-phases %standard-phases
1216 (invoke "python" "-m" "testtools.run"
1217 "fixtures.test_suite"))))))
1219 ;; Fixtures uses pbr at runtime to check versions, etc.
1220 `(("python-pbr" ,python-pbr)
1221 ("python-six" ,python-six)))
1223 `(("python-mock" ,python-mock)
1224 ("python-testtools" ,python-testtools-bootstrap)))
1226 "Fixtures provides a way to create reusable state, useful when writing
1229 (define-public python2-fixtures
1230 (package-with-python2 python-fixtures))
1232 (define-public python-testrepository-bootstrap
1234 (name "python-testrepository-bootstrap")
1239 (uri (pypi-uri "testrepository" version))
1242 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1243 (build-system python-build-system)
1244 (arguments '(#:tests? #f))
1246 `(("python-fixtures" ,python-fixtures-bootstrap)
1247 ("python-subunit" ,python-subunit-bootstrap)
1248 ("python-testtools" ,python-testtools-bootstrap)))
1250 `(("python-mimeparse" ,python-mimeparse)))
1251 (home-page "https://launchpad.net/testrepository")
1252 (synopsis "Database for Python test results")
1254 "Bootstrap package for python-testrepository. Don't use this.")
1255 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1257 (define-public python2-testrepository-bootstrap
1258 (package-with-python2 python-testrepository-bootstrap))
1260 (define-public python-testrepository
1262 (inherit python-testrepository-bootstrap)
1263 (name "python-testrepository")
1265 ;; FIXME: Many tests are failing.
1268 `(("python-fixtures" ,python-fixtures)
1269 ("python-subunit" ,python-subunit)
1270 ("python-testtools" ,python-testtools)))
1272 `(("python-mimeparse" ,python-mimeparse)))
1273 (description "Testrepository provides a database of test results which can
1274 be used as part of a developer's workflow to check things such as what tests
1275 have failed since the last commit or what tests are currently failing.")))
1277 (define-public python2-testrepository
1278 (package-with-python2 python-testrepository))
1280 (define-public python-coverage
1282 (name "python-coverage")
1287 (uri (pypi-uri "coverage" version))
1290 "02f6m073qdispn96rc616hg0rnmw1pgqzw3bgxwiwza4zf9hirlx"))))
1291 (build-system python-build-system)
1293 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1295 (home-page "http://nedbatchelder.com/code/coverage")
1296 (synopsis "Code coverage measurement for Python")
1298 "Coverage measures code coverage, typically during test execution. It
1299 uses the code analysis tools and tracing hooks provided in the Python standard
1300 library to determine which lines are executable, and which have been
1302 (license license:bsd-3)))
1304 (define-public python2-coverage
1305 (package-with-python2 python-coverage))
1307 (define-public python-cov-core
1309 (name "python-cov-core")
1314 (uri (pypi-uri "cov-core" version))
1317 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1318 (build-system python-build-system)
1320 `(("python-coverage" ,python-coverage)))
1321 (home-page "https://github.com/schlamar/cov-core")
1322 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
1324 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1325 and @code{nose2-cov}. It is useful for developing coverage plugins for these
1326 testing frameworks.")
1327 (license license:expat)))
1329 (define-public python2-cov-core
1330 (package-with-python2 python-cov-core))
1332 (define-public python-codecov
1334 (name "python-codecov")
1339 (uri (pypi-uri "codecov" version))
1342 "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1343 (build-system python-build-system)
1345 `(("python-unittest2" ,python-unittest2)))
1347 `(("python-coverage" ,python-coverage)
1348 ("python-requests" ,python-requests)))
1349 (home-page "http://github.com/codecov/codecov-python")
1350 (synopsis "Upload code coverage reports to @code{codecov.io}")
1352 "Codecov collects code coverage reports from code written in Python, Java,
1353 C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
1354 (license license:asl2.0)))
1356 (define-public python-testpath
1358 (name "python-testpath")
1364 (url "https://github.com/jupyter/testpath")
1366 (file-name (git-file-name name version))
1369 "0r4iiizjql6ny1ln7ciw7rrbjadz1s9zrf2hl0xkgnh3ypd8936f"))))
1370 (build-system python-build-system)
1372 `(#:tests? #f ; this package does not even have a setup.py
1373 #:modules ((guix build python-build-system)
1376 #:imported-modules (,@%python-build-system-modules
1379 (modify-phases %standard-phases
1382 (lambda* (#:key inputs outputs #:allow-other-keys)
1383 (let* ((version (last
1384 (string-split (assoc-ref inputs "python") #\-)))
1385 (x.y (string-join (take (string-split version #\.) 2)
1388 (assoc-ref outputs "out")
1389 "/lib/python" x.y "/site-packages/testpath")))
1391 (copy-recursively "testpath" dir))
1393 (home-page "https://github.com/takluyver/testpath")
1394 (synopsis "Test utilities for code working with files and commands")
1396 "Testpath is a collection of utilities for Python code working with files
1397 and commands. It contains functions to check things on the file system, and
1398 tools for mocking system commands and recording calls to those.")
1399 (license license:expat)))
1401 (define-public python2-testpath
1402 (package-with-python2 python-testpath))
1404 (define-public python-testlib
1406 (name "python-testlib")
1411 (uri (pypi-uri "testlib" version ".zip"))
1413 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1414 (build-system python-build-system)
1416 `(("unzip" ,unzip))) ; for unpacking the source
1417 (synopsis "Python micro test suite harness")
1418 (description "A micro unittest suite harness for Python.")
1419 (home-page "https://github.com/trentm/testlib")
1420 (license license:expat)))
1422 (define-public python2-testlib
1423 (package-with-python2 python-testlib))
1425 ;;; The software provided by this package was integrated into pytest 2.8.
1426 (define-public python-pytest-cache
1428 (name "python-pytest-cache")
1432 (uri (pypi-uri "pytest-cache" version))
1435 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1436 (build-system python-build-system)
1438 `(("python-apipkg" ,python-apipkg)
1439 ("python-execnet" ,python-execnet)
1440 ("python-py" ,python-py)
1441 ("python-pytest" ,python-pytest)))
1442 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1443 (description "The pytest-cache plugin provides tools to rerun failures from
1444 the last py.test invocation.")
1445 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1446 (license license:expat)))
1448 (define-public python2-pytest-cache
1449 (package-with-python2 python-pytest-cache))
1451 (define-public python-pytest-localserver
1453 (name "python-pytest-localserver")
1457 (uri (pypi-uri "pytest-localserver" version))
1460 "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
1461 (build-system python-build-system)
1464 (modify-phases %standard-phases
1467 (invoke "py.test" "-v"))))))
1469 `(("python-pytest" ,python-pytest)
1470 ("python-requests" ,python-requests)
1471 ("python-six" ,python-six)))
1473 `(("python-werkzeug" ,python-werkzeug)))
1474 (synopsis "Py.test plugin to test server connections locally")
1475 (description "Pytest-localserver is a plugin for the pytest testing
1476 framework which enables you to test server connections locally.")
1477 (home-page "https://pypi.python.org/pypi/pytest-localserver")
1478 (license license:expat)))
1480 (define-public python-pytest-xprocess
1482 (name "python-pytest-xprocess")
1486 (uri (pypi-uri "pytest-xprocess" version))
1489 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1490 (build-system python-build-system)
1492 `(("python-pytest" ,python-pytest)
1493 ("python-pytest-cache" ,python-pytest-cache)
1494 ("python-psutil" ,python-psutil)))
1495 (synopsis "Pytest plugin to manage external processes across test runs")
1496 (description "Pytest-xprocess is an experimental py.test plugin for managing
1497 processes across test runs.")
1498 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1499 (license license:expat)))
1501 (define-public python-pytest-subtesthack
1503 (name "python-pytest-subtesthack")
1507 (uri (pypi-uri "pytest-subtesthack" version))
1510 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1511 (build-system python-build-system)
1513 `(("python-pytest" ,python-pytest)))
1514 (synopsis "Set-up and tear-down fixtures for unit tests")
1515 (description "This plugin allows you to set up and tear down fixtures within
1516 unit test functions that use @code{py.test}. This is useful for using
1517 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1518 function multiple times, without setting up or tearing down fixture state as is
1519 normally the case.")
1520 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1521 (license license:unlicense)))
1523 (define-public python2-pytest-subtesthack
1524 (package-with-python2 python-pytest-subtesthack))
1526 (define-public python-pytest-sugar
1528 (name "python-pytest-sugar")
1533 (uri (pypi-uri "pytest-sugar" version))
1536 "1asq7yc4g8bx2sn7yy974mhc9ywvaihasjab4inkirdwn9s7mn7w"))))
1537 (build-system python-build-system)
1539 `(("python-packaging" ,python-packaging)
1540 ("python-pytest" ,python-pytest)
1541 ("python-termcolor" ,python-termcolor)))
1542 (home-page "https://pivotfinland.com/pytest-sugar/")
1543 (synopsis "Plugin for pytest that changes the default look and feel")
1545 "@code{pytest-sugar} is a plugin for py.test that changes the default
1546 look and feel of py.test, using a progress bar and showing failures and errors
1548 (license license:bsd-3)))
1550 (define-public python-hypothesis
1552 (name "python-hypothesis")
1556 (uri (pypi-uri "hypothesis" version))
1559 "0a35nwqyjnm4cphi43xracqpkws0ip61mndvqb1iqq7gkva83lb1"))))
1560 (build-system python-build-system)
1562 `(("python-flake8" ,python-flake8)
1563 ("python-pytest" ,python-pytest-bootstrap)))
1565 `(("python-attrs" ,python-attrs-bootstrap)
1566 ("python-coverage" ,python-coverage)))
1567 (synopsis "Library for property based testing")
1568 (description "Hypothesis is a library for testing your Python code against a
1569 much larger range of examples than you would ever want to write by hand. It’s
1570 based on the Haskell library, Quickcheck, and is designed to integrate
1571 seamlessly into your existing Python unit testing work flow.")
1572 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
1573 (license license:mpl2.0)
1574 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1576 (define-public python2-hypothesis
1577 (let ((hypothesis (package-with-python2
1578 (strip-python2-variant python-hypothesis))))
1579 (package (inherit hypothesis)
1581 `(("python2-enum34" ,python2-enum34)
1582 ,@(package-propagated-inputs hypothesis))))))
1584 (define-public python-lit
1591 (uri (pypi-uri "lit" version))
1594 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
1595 (build-system python-build-system)
1598 (modify-phases %standard-phases
1601 (invoke "python" "lit.py" "tests"))))))
1604 (home-page "https://llvm.org/")
1605 (synopsis "LLVM Software Testing Tool")
1606 (description "@code{lit} is a portable tool for executing LLVM and Clang
1607 style test suites, summarizing their results, and providing indication of
1609 (license license:ncsa)))
1611 (define-public python2-lit
1612 (package-with-python2 python-lit))
1614 (define-public python-pytest-pep8
1616 (name "python-pytest-pep8")
1620 (uri (pypi-uri "pytest-pep8" version))
1623 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
1624 (build-system python-build-system)
1626 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
1628 `(("python-pytest" ,python-pytest)))
1630 `(("python-pep8" ,python-pep8)))
1631 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
1632 (synopsis "Py.test plugin to check PEP8 requirements")
1633 (description "Pytest plugin for checking PEP8 compliance.")
1634 (license license:expat)))
1636 (define-public python2-pytest-pep8
1637 (package-with-python2 python-pytest-pep8))
1639 (define-public python-pytest-flakes
1641 (name "python-pytest-flakes")
1645 (uri (pypi-uri "pytest-flakes" version))
1648 "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
1649 (build-system python-build-system)
1652 (modify-phases %standard-phases
1654 (add-after 'install 'check
1655 (lambda* (#:key outputs inputs #:allow-other-keys)
1656 ;; It's easier to run tests after install.
1657 ;; Make installed package available for running the tests
1658 (add-installed-pythonpath inputs outputs)
1659 (invoke "py.test" "-vv"))))))
1661 `(("python-coverage" ,python-coverage)
1662 ("python-pytest" ,python-pytest)
1663 ("python-pytest-cache" ,python-pytest-cache)
1664 ("python-pytest-pep8" ,python-pytest-pep8)))
1666 `(("python-pyflakes" ,python-pyflakes)))
1667 (home-page "https://github.com/fschulze/pytest-flakes")
1668 (synopsis "Py.test plugin to check source code with pyflakes")
1669 (description "Pytest plugin for checking Python source code with pyflakes.")
1670 (license license:expat)))
1672 (define-public python2-pytest-flakes
1673 (package-with-python2 python-pytest-flakes))
1675 (define-public python2-coverage-test-runner
1677 (name "python2-coverage-test-runner")
1683 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
1684 "coverage-test-runner/snapshot/coverage-test-runner-"
1688 "1kjjb9llckycnfxag8zcvqsn4z1s3dwyw6b1n0avxydihgf30rny"))))
1689 (build-system python-build-system)
1691 `(#:python ,python-2
1693 (modify-phases %standard-phases
1696 (invoke "./testrun"))))))
1698 `(("python2-coverage" ,python2-coverage)))
1699 (home-page "https://liw.fi/coverage-test-runner/")
1700 (synopsis "Python module for running unit tests")
1701 (description "@code{CoverageTestRunner} is a python module for running
1702 unit tests and failing them if the unit test module does not exercise all
1703 statements in the module it tests.")
1704 (license license:gpl3+)))
1706 (define-public python-pylint
1708 (name "python-pylint")
1714 "https://github.com/PyCQA/pylint/archive/pylint-"
1718 "0mzn1czhf1mgr2wiqfihb274sja02h899b85kywdpivppa9nwrmp"))))
1719 (build-system python-build-system)
1721 `(("python-pytest" ,python-pytest)
1722 ("python-pytest-runner" ,python-pytest-runner)
1723 ("python-tox" ,python-tox)))
1725 `(("python-astroid" ,python-astroid)
1726 ("python-isort" ,python-isort)
1727 ("python-mccabe" ,python-mccabe)
1728 ("python-six" ,python-six)))
1731 (modify-phases %standard-phases
1734 ;; Somehow, tests for python2-pylint
1735 ;; fail if run from the build directory
1736 (let ((work "/tmp/work"))
1738 (setenv "PYTHONPATH"
1739 (string-append (getenv "PYTHONPATH") ":" work))
1740 (copy-recursively "." work)
1741 (with-directory-excursion "/tmp"
1742 (invoke "python" "-m" "unittest" "discover"
1743 "-s" (string-append work "/pylint/test")
1744 "-p" "*test_*.py"))))))))
1745 (home-page "https://github.com/PyCQA/pylint")
1746 (synopsis "Python source code analyzer which looks for coding standard
1748 (description "Pylint is a Python source code analyzer which looks
1749 for programming errors, helps enforcing a coding standard and sniffs
1750 for some code smells (as defined in Martin Fowler's Refactoring book).
1752 Pylint has many rules enabled by default, way too much to silence them
1753 all on a minimally sized program. It's highly configurable and handle
1754 pragmas to control it from within your code. Additionally, it is
1755 possible to write plugins to add your own checks.")
1756 (properties `((python2-variant . ,(delay python2-pylint))))
1757 (license license:gpl2+)))
1759 (define-public python2-pylint
1760 (let ((pylint (package-with-python2
1761 (strip-python2-variant python-pylint))))
1762 (package (inherit pylint)
1764 `(("python2-backports-functools-lru-cache"
1765 ,python2-backports-functools-lru-cache)
1766 ("python2-configparser" ,python2-configparser)
1767 ,@(package-propagated-inputs pylint))))))
1769 (define-public python-paramunittest
1771 (name "python-paramunittest")
1776 (uri (pypi-uri "ParamUnittest" version))
1779 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
1780 (build-system python-build-system)
1782 "https://github.com/rik0/ParamUnittest")
1784 "Simple extension to have parametrized unit tests")
1786 "This package allows to create parametrized unit-tests that work with the standard
1787 unittest package. A parametrized test case is automatically converted to multiple test
1788 cases. Since they are TestCase subclasses, they work with other test suites that
1789 recognize TestCases.")
1790 (license license:bsd-2)))
1792 (define-public python2-python-paramunittest
1793 (package-with-python2 python-paramunittest))
1795 (define-public python-pytest-warnings
1797 (name "python-pytest-warnings")
1802 (uri (pypi-uri "pytest-warnings" version))
1805 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
1806 (build-system python-build-system)
1808 `(("pytest" ,python-pytest)))
1809 (home-page "https://github.com/fschulze/pytest-warnings")
1810 (synopsis "Pytest plugin to list Python warnings in pytest report")
1812 "Python-pytest-warnings is a pytest plugin to list Python warnings in
1814 (license license:expat)
1815 (properties `((python2-variant . ,(delay python2-pytest-warnings))
1816 ;; This package is part of pytest as of version 3.1.0.
1817 (superseded . ,python-pytest)))))
1819 (define-public python2-pytest-warnings
1820 (package (inherit (package-with-python2
1821 (strip-python2-variant python-pytest-warnings)))
1822 (properties `((superseded . ,python2-pytest)))))
1824 (define-public python-pytest-capturelog
1826 (name "python-pytest-capturelog")
1831 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
1834 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
1835 (build-system python-build-system)
1837 `(("pytest" ,python-pytest)))
1838 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
1839 (synopsis "Pytest plugin to catch log messages")
1841 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
1842 (license license:expat)))
1844 (define-public python2-pytest-capturelog
1845 (package-with-python2 python-pytest-capturelog))
1847 (define-public python-pytest-catchlog
1849 (name "python-pytest-catchlog")
1854 (uri (pypi-uri "pytest-catchlog" version ".zip"))
1857 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
1858 (build-system python-build-system)
1860 `(("unzip" ,unzip)))
1862 `(("pytest" ,python-pytest)))
1863 (home-page "https://github.com/eisensheng/pytest-catchlog")
1864 (synopsis "Pytest plugin to catch log messages")
1866 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
1867 a fork of pytest-capturelog.")
1868 (license license:expat)))
1870 (define-public python2-pytest-catchlog
1871 (package-with-python2 python-pytest-catchlog))
1873 (define-public python-nosexcover
1875 (name "python-nosexcover")
1879 (uri (pypi-uri "nosexcover" version))
1882 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
1883 (build-system python-build-system)
1885 `(("python-coverage" ,python-coverage)
1886 ("python-nose" ,python-nose)))
1887 (home-page "http://github.com/cmheisel/nose-xcover")
1888 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
1889 (description "Nose-xcover is a companion to the built-in
1890 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
1891 to a file named coverage.xml.
1893 It will honor all the options you pass to the Nose coverage plugin,
1894 especially -cover-package.")
1895 (license license:expat)))
1897 (define-public python2-nosexcover
1898 (package-with-python2 python-nosexcover))
1900 (define-public python-discover
1902 (name "python-discover")
1907 (uri (pypi-uri "discover" version))
1910 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
1911 (build-system python-build-system)
1912 (home-page "http://pypi.python.org/pypi/discover/")
1914 "Python test discovery for unittest")
1916 "Discover provides test discovery for unittest, a feature that has been
1917 backported from Python 2.7 for Python 2.4+.")
1918 (license license:bsd-3)))
1920 (define-public python2-discover
1921 (package-with-python2 python-discover))
1923 (define-public behave
1929 (uri (pypi-uri "behave" version))
1932 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))))
1933 (build-system python-build-system)
1935 `(("python-mock" ,python-mock)
1936 ("python-nose" ,python-nose)
1937 ("python-pathpy" ,python-pathpy)
1938 ("python-pyhamcrest" ,python-pyhamcrest)
1939 ("python-pytest" ,python-pytest)))
1941 `(("python-importlib-metadata" ,python-importlib-metadata)
1942 ("python-six" ,python-six)
1943 ("python-parse" ,python-parse)
1944 ("python-parse-type" ,python-parse-type)))
1946 '(#:test-target "behave_test"))
1947 (home-page "https://github.com/behave/behave")
1948 (synopsis "Python behavior-driven development")
1950 "Behave is a tool for behavior-driven development in python.
1951 Behavior-driven development (or BDD) is an agile software development
1952 technique that encourages collaboration between developers, QA and
1953 non-technical or business participants in a software project. Behave uses
1954 tests written in a natural language style, backed up by Python code.")
1955 (license license:x11)))
1957 (define-public python-behave-web-api
1959 (name "python-behave-web-api")
1964 (uri (pypi-uri "behave-web-api" version))
1967 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
1968 (build-system python-build-system)
1971 (modify-phases %standard-phases
1972 (add-after 'unpack 'fix-dependencies
1974 (substitute* "setup.py"
1975 (("'wheel'") "") ; We don't use it.
1976 (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
1979 `(("behave" ,behave)
1980 ("python-requests" ,python-requests)))
1981 (home-page "https://github.com/jefersondaniel/behave-web-api")
1982 (synopsis "Provides testing for JSON APIs with Behave for Python")
1983 (description "This package provides testing utility modules for testing
1984 JSON APIs with Behave.")
1985 (license license:expat)))
1987 (define-public python2-behave-web-api
1988 (package-with-python2 python-behave-web-api))
1990 (define-public python-rednose
1992 (name "python-rednose")
1997 (uri (pypi-uri "rednose" version))
2000 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
2001 (build-system python-build-system)
2003 `(#:phases (modify-phases %standard-phases
2004 (add-after 'unpack 'patch-setup.py
2006 ;; Six is only required for tests and later versions
2008 (substitute* "setup.py"
2009 (("six==1.10.0") "six"))
2012 `(("python-colorama" ,python-colorama)
2013 ("python-termstyle" ,python-termstyle)))
2015 `(("python-six" ,python-six)
2016 ("python-nose" ,python-nose)))
2017 (home-page "https://github.com/JBKahn/rednose")
2018 (synopsis "Colored output for Python nosetests")
2019 (description "This package provides colored output for the
2020 @command{nosetests} command of the Python Nose unit test framework.")
2021 (license license:bsd-3)))
2023 (define-public python2-rednose
2024 (package-with-python2 python-rednose))
2026 (define-public python-nose-randomly
2028 (name "python-nose-randomly")
2033 (uri (pypi-uri "nose-randomly" version))
2035 (base32 "0z662rqhfk4bjmg806mn4frb8nz4gbh7mrddsrhfffp1g4yklj3y"))))
2036 (build-system python-build-system)
2038 `(("python-nose" ,python-nose)
2039 ("python-numpy" ,python-numpy)))
2040 (home-page "https://github.com/adamchainz/nose-randomly")
2042 "Nose plugin to randomly order tests and control random.seed")
2044 "This is a @code{Nose} plugin to randomly order tests which can be quite
2045 powerful in discovering hidden flaws in the tests themselves, while helping to
2046 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
2047 by resetting it to a repeatable number for each test, enabling the tests to
2048 create data based on random numbers and yet remain repeatable.")
2049 (license license:bsd-3)))
2051 (define-public python2-nose-randomly
2052 (package-with-python2 python-nose-randomly))
2054 (define-public python-nose-timer
2056 (name "python-nose-timer")
2061 (uri (pypi-uri "nose-timer" version))
2063 (base32 "05wzkc88vbzw62pqkvhl33211b90kns0lny70b7qw62rcg4flzk4"))))
2064 (build-system python-build-system)
2066 `(("python-nose" ,python-nose)
2067 ("python-termcolor" ,python-termcolor)))
2068 (home-page "https://github.com/mahmoudimus/nose-timer")
2069 (synopsis "Timer plugin for nosetests")
2070 (description "Shows how much time was needed to run individual tests.")
2071 (license license:expat)))
2073 (define-public python2-nose-timer
2074 (package-with-python2 python-nose-timer))
2076 (define-public python-freezegun
2078 (name "python-freezegun")
2083 (uri (pypi-uri "freezegun" version))
2085 (base32 "1rx57v8ryjncjimg8hys9kx1r3rknvwcl4y340g20jn0sf69qk9a"))))
2086 (build-system python-build-system)
2088 `(("python-mock" ,python-mock)
2089 ("python-pytest" ,python-pytest)))
2091 `(("python-six" ,python-six)
2092 ("python-dateutil" ,python-dateutil)))
2095 (modify-phases %standard-phases
2096 ;; The tests are normally executed via `make test`, but the PyPi
2097 ;; package does not include the Makefile.
2100 (invoke "pytest" "-vv"))))))
2101 (home-page "https://github.com/spulec/freezegun")
2102 (synopsis "Test utility for mocking the datetime module")
2104 "FreezeGun is a library that allows your python tests to travel through
2105 time by mocking the datetime module.")
2106 (license license:asl2.0)))
2108 (define-public python2-freezegun
2109 (package-with-python2 python-freezegun))
2111 (define-public python-flexmock
2113 (name "python-flexmock")
2117 (uri (pypi-uri "flexmock" version))
2120 "0b6qw3grhgx58kxlkj7mdma7xdvlj02zabvcf7w2qifnfjwwwcsh"))))
2121 (build-system python-build-system)
2122 (home-page "https://flexmock.readthedocs.org")
2123 (synopsis "Testing library for Python")
2125 "flexmock is a testing library for Python that makes it easy to create
2126 mocks, stubs and fakes.")
2127 (license license:bsd-3)))
2129 (define-public python2-flexmock
2130 (package-with-python2 python-flexmock))
2132 (define-public python-flaky
2134 (name "python-flaky")
2138 (uri (pypi-uri "flaky" version))
2141 "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j"))))
2142 (build-system python-build-system)
2144 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2146 (home-page "https://github.com/box/flaky")
2147 (synopsis "Automatically rerun flaky tests")
2149 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2152 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2153 on components that aren't 100% reliable. With flaky, instead of removing
2154 those tests or marking them to @code{@@skip}, they can be automatically
2156 (license license:asl2.0)))
2158 (define-public python2-flaky
2159 (package-with-python2 python-flaky))
2161 (define-public python-pyhamcrest
2162 ;; The latest release was in 2016 and its test suite does not work with recent
2163 ;; versions of Pytest. Just take the master branch for now, which seems stable.
2164 (let ((commit "25fdc5f00bdf3084335353bc9247253098ec4cf2")
2167 (name "python-pyhamcrest")
2168 (version (git-version "1.9.0" revision commit))
2170 ;; Tests not distributed from pypi release.
2173 (url "https://github.com/hamcrest/PyHamcrest")
2175 (file-name (git-file-name name version))
2178 "1miqmhhi68vaix8sqc1lvpvbm27bacffxh5anm5cbfsvk7g9n6f3"))))
2179 (native-inputs ;all native inputs are for tests
2180 `(("python-pytest-cov" ,python-pytest-cov)
2181 ("python-mock" ,python-mock)
2182 ("python-pytest" ,python-pytest)
2183 ("python-hypothesis" ,python-hypothesis)))
2185 `(("python-six" ,python-six)))
2186 (build-system python-build-system)
2188 `(#:phases (modify-phases %standard-phases
2191 (setenv "PYTHONPATH"
2192 (string-append "build/lib:"
2193 (getenv "PYTHONPATH")))
2194 (invoke "pytest" "-vv"))))))
2195 (home-page "http://hamcrest.org/")
2196 (synopsis "Hamcrest matchers for Python")
2198 "PyHamcrest is a framework for writing matcher objects,
2199 allowing you to declaratively define \"match\" rules.")
2200 (license license:bsd-3))))
2202 (define-public python2-pyhamcrest
2203 (package-with-python2 python-pyhamcrest))
2205 (define-public unittest-cpp
2207 (name "unittest-cpp")
2212 (url "https://github.com/unittest-cpp/unittest-cpp")
2213 (commit (string-append "v" version))))
2214 (file-name (git-file-name name version))
2216 (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
2218 `(#:tests? #f)) ; It's run after build automatically.
2219 (build-system cmake-build-system)
2220 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2221 (synopsis "Lightweight unit testing framework for C++")
2222 (description "UnitTest++ is a lightweight unit testing framework for C++.
2223 It was designed to do test-driven development on a wide variety of platforms.
2224 Simplicity, portability, speed, and small footprint are all very important
2225 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2226 of advanced library and language features, which means it should be easily
2227 portable to just about any platform.")
2228 (license license:expat)))
2230 (define-public libfaketime
2232 (name "libfaketime")
2234 (home-page "https://github.com/wolfcw/libfaketime")
2239 (commit (string-append "v" version))))
2242 "1mfdl82ppgbdvy1ny8mb7xii7p0g7awvn4bn36jb8v4r545slmjc"))
2243 (file-name (git-file-name name version))))
2244 (build-system gnu-build-system)
2246 '(#:phases (modify-phases %standard-phases
2248 (lambda* (#:key outputs #:allow-other-keys)
2249 (let ((out (assoc-ref outputs "out")))
2251 (setenv "PREFIX" out)
2253 (add-before 'check 'pre-check
2255 (substitute* "test/functests/test_exclude_mono.sh"
2256 (("/bin/bash") (which "bash")))
2258 #:test-target "test"))
2260 `(("perl" ,perl))) ;for tests
2261 (synopsis "Fake the system time for single applications")
2263 "The libfaketime library allows users to modify the system time that an
2264 application \"sees\". It is meant to be loaded using the dynamic linker's
2265 @code{LD_PRELOAD} environment variable. The @command{faketime} command
2266 provides a simple way to achieve this.")
2267 (license license:gpl2)))
2269 (define-public umockdev
2275 (uri (string-append "https://github.com/martinpitt/umockdev/"
2276 "releases/download/" version "/"
2277 "umockdev-" version ".tar.xz"))
2280 "095v3abc321s584sga04y16lcmdzsdi88h24wcrm78v7vq484g74"))))
2281 (build-system gnu-build-system)
2284 (modify-phases %standard-phases
2285 (add-after 'unpack 'skip-broken-test
2287 (substitute* "tests/test-umockdev.c"
2288 (("/\\* sys/ in other dir")
2289 (string-append "return; // ")))
2293 ("gtk-doc" ,gtk-doc)
2294 ("pkg-config" ,pkg-config)
2302 ("libgudev" ,libgudev)
2303 ("gobject-introspection" ,gobject-introspection)))
2304 (home-page "https://github.com/martinpitt/umockdev/")
2305 (synopsis "Mock hardware devices for creating unit tests")
2306 (description "umockdev mocks hardware devices for creating integration
2307 tests for hardware related libraries and programs. It also provides tools to
2308 record the properties and behaviour of particular devices, and to run a
2309 program or test suite under a test bed with the previously recorded devices
2311 (license license:lgpl2.1+)))
2313 (define-public python-pyfakefs
2315 (name "python-pyfakefs")
2319 ;; We use the PyPI URL because there is no proper release
2320 ;; available from GitHub. The GitHub project only provides
2321 ;; autogenerated tarballs, which are known to change in place.
2322 (uri (pypi-uri "pyfakefs" version))
2325 "0qb9jp0bqhc0dv0rn805fv99029fvx135f3bvka6scfkcl6jgllc"))
2326 (patches (search-patches
2327 "python-pyfakefs-remove-bad-test.patch"))
2328 (file-name (string-append name "-" version ".tar.gz"))))
2331 (modify-phases %standard-phases
2332 ;; The default test suite does not run these extra tests.
2333 (add-after 'check 'check-pytest-plugin
2336 "python" "-m" "pytest"
2337 "pyfakefs/pytest_tests/pytest_plugin_test.py")
2340 `(("python-pytest" ,python-pytest)))
2341 (build-system python-build-system)
2342 ;; Guix lint doesn't like that this is a permanent redirect to the GitHub
2343 ;; page, but the pyfakefs documentation asks us to use this specific URL
2344 ;; when linking to the project. Honor their request.
2345 (home-page "http://pyfakefs.org/")
2346 ;; TRANSLATORS: In the synopsis, "Mock" is a verb.
2347 (synopsis "Mock file system interactions in tests")
2349 "This package provides a Python library intended for use in automated
2350 tests. One difficulty when testing software is that the code under test might
2351 need to read or write to files in the local file system. If the file system
2352 is not set up in just the right way, it might cause a spurious error during
2353 the test. The pyfakefs library provides a solution to problems like this by
2354 mocking file system interactions. In other words, it arranges for the code
2355 under test to interact with a fake file system instead of the real file
2356 system. The code under test requires no modification to work with pyfakefs.")
2357 (license license:asl2.0)))
2359 (define-public python2-pyfakefs
2360 (package-with-python2 python-pyfakefs))