Merge branch 'master' into staging
[guix.git] / gnu / packages / check.scm
blob085538b2de629af95839ddd635f02baaa689eca6
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>
33 ;;;
34 ;;; This file is part of GNU Guix.
35 ;;;
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.
40 ;;;
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.
45 ;;;
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))
78 (define-public check
79   (package
80     (name "check")
81     (version "0.12.0")
82     (source
83      (origin
84       (method url-fetch)
85       (uri (string-append "https://github.com/libcheck/check/releases/download/"
86                           version "/check-" version ".tar.gz"))
87       (sha256
88        (base32
89         "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6"))))
90     (build-system gnu-build-system)
91     (home-page "https://libcheck.github.io/check/")
92     (synopsis "Unit test framework for C")
93     (description
94      "Check is a unit testing framework for C.  It features a simple
95 interface for defining unit tests, putting little in the way of the
96 developer.  Tests are run in a separate address space, so Check can
97 catch both assertion failures and code errors that cause segmentation
98 faults or other signals.  The output from unit tests can be used within
99 source code editors and IDEs.")
100     (license license:lgpl2.1+)))
102 (define-public cunit
103   (package
104     (name "cunit")
105     (version "2.1-3")
106     (source
107      (origin
108        (method url-fetch)
109        (uri (string-append "mirror://sourceforge/cunit/CUnit/"
110                            version "/CUnit-" version ".tar.bz2"))
111        (sha256
112         (base32
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
119                    ;; manually.
120                    (replace 'bootstrap
121                      (lambda _ (invoke "autoreconf" "-vfi"))))))
122     (native-inputs
123      `(("automake" ,automake)
124        ("autoconf" ,autoconf)
125        ("libtool" ,libtool)))
126     (home-page "http://cunit.sourceforge.net/")
127     (synopsis "Automated testing framework for C")
128     (description
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
135   (package
136     (name "cppunit")
137     (version "1.13.2")
138     (source (origin
139              (method url-fetch)
140               (uri (string-append "http://dev-www.libreoffice.org/src/"
141                                   name "-" version ".tar.gz"))
142              (sha256
143               (base32
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.
149     (arguments
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
156 supervised tests.")
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
165   (package
166     (inherit cppunit)
167     (version "1.14.0")
168     (source (origin
169               (method url-fetch)
170               (uri (string-append "https://dev-www.libreoffice.org/src/"
171                                   "cppunit-" version ".tar.gz"))
172               (sha256
173                (base32
174                 "1027cyfx5gsjkdkaf6c2wnjh68882grw8n672018cj3vs9lrhmix"))))))
176 ;; When dependent packages upgraded to use newer version of catch, this one should
177 ;; be removed.
178 (define-public catch-framework
179   (package
180     (name "catch")
181     (version "1.3.5")                  ;Sub-minor is the build number
182     (source (origin
183               (method git-fetch)
184               (uri (git-reference
185                     (url "https://github.com/philsquared/Catch")
186                     ;; Semi-arbitrary.
187                     (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
188               (file-name (string-append name "-" version))
189               (sha256
190                (base32
191                 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
192     (build-system trivial-build-system)
193     (arguments
194      `(#:modules ((guix build utils))
195        #:builder (begin
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-"
201                                                  ,version)))
202                      (for-each mkdir-p (list incdir docdir))
203                      (install-file (string-append source
204                                                   "/single_include/catch.hpp")
205                                    incdir)
206                      (copy-recursively (string-append source "/docs")
207                                        docdir)
208                      #t))))
209     (home-page "http://catch-lib.net/")
210     (synopsis "Automated test framework for C++ and Objective-C")
211     (description
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
217   (package
218     (name "catch2")
219     (version "1.12.2")
220     (home-page "https://github.com/catchorg/Catch2")
221     (source (origin
222               (method git-fetch)
223               (uri (git-reference
224                      (url "https://github.com/catchorg/Catch2")
225                      (commit (string-append "v" version))))
226               (file-name (git-file-name name version))
227               (sha256
228                (base32
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
237   (package
238     (name "cmdtest")
239     (version "0.32")
240     (source (origin
241               (method url-fetch)
242               (uri (string-append "http://git.liw.fi/cmdtest/snapshot/"
243                                   name "-" version ".tar.gz"))
244               (sha256
245                (base32
246                 "1jmfiyrrqmpvwdb273bkb8hjaf4rwx9njblx29pmr7giyahskwi5"))))
247     (build-system python-build-system)
248     (arguments
249      `(#:python ,python-2
250        #:phases
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,
254          ;; and fails.
255          (delete 'check)
256          (add-before 'build 'check
257            (lambda _
258              (substitute* "yarn"
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"))))))
266     (native-inputs
267      `(("python2-coverage-test-runner" ,python2-coverage-test-runner)))
268     (propagated-inputs
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")
274     (description
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
282   (package
283     (name "cmocka")
284     (version "1.1.3")
285     (source (origin
286               (method url-fetch)
287               (uri (string-append "https://cmocka.org/files/"
288                                   (version-major+minor version) "/cmocka-"
289                                   version ".tar.xz"))
290               (sha256
291                (base32
292                 "1bxzzafjlwzgldcb07hjnlnqvh88wh21r2kw7z8f704w5bvvrsj3"))))
293     (build-system cmake-build-system)
294     (arguments
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
302 format.")
303     (license license:asl2.0)))
305 (define-public cppcheck
306   (package
307     (name "cppcheck")
308     (version "1.87")
309     (source (origin
310       (method git-fetch)
311       (uri (git-reference
312              (url "https://github.com/danmar/cppcheck")
313              (commit version)))
314       (file-name (git-file-name name version))
315       (sha256
316        (base32 "1xiy54rz99nzbpwj35jiyssd2nc6k5k0lw5ml6nh2qnmbfkl8swl"))))
317     (build-system cmake-build-system)
318     (arguments
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
330   (package
331     (name "cxxtest")
332     (version "4.4")
333     (source (origin
334               (method url-fetch)
335               (uri (string-append "mirror://sourceforge/cxxtest/cxxtest/"
336                                   version "/cxxtest-" version ".tar.gz"))
337               (sha256
338                (base32
339                 "1n7pbj4z9ivx005hqvivj9ddhq8awynzg6jishfbypf6j7ply58w"))))
340     (build-system python-build-system)
341     (arguments
342      '(#:phases
343        (modify-phases %standard-phases
344          (add-after 'unpack 'chdir-to-source
345            (lambda _
346              (chdir "python")
347              #t))
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"))
355                #t)))
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"))
363                #t))))))
364     (propagated-inputs
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")
376         (revision "1"))
377     (package
378       (name "go-gopkg.in-check.v1")
379       (version (git-version "0.0.0" revision commit))
380       (source (origin
381                 (method git-fetch)
382                 (uri (git-reference
383                       (url "https://github.com/go-check/check.git")
384                       (commit commit)))
385                 (file-name (git-file-name name version))
386                 (sha256
387                  (base32
388                   "0v3bim0j375z81zrpr5qv42knqs0y2qv2vkjiqi5axvb78slki1a"))))
389       (build-system go-build-system)
390       (arguments
391        '(#:import-path "gopkg.in/check.v1"))
392       (propagated-inputs
393        `(("go-github-com-kr-pretty" ,go-github-com-kr-pretty)))
394       (synopsis "Rich testing extension for Go's testing package")
395       (description
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
401   (package
402     (name "go-github.com-smartystreets-gunit")
403     (version "1.0.0")
404     (source (origin
405               (method git-fetch)
406               (uri (git-reference
407                     (url "https://github.com/smartystreets/gunit")
408                     (commit version)))
409               (file-name (git-file-name name version))
410               (sha256
411                (base32
412                 "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
413     (build-system go-build-system)
414     (arguments
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
418        ;; for this package.
419        #:tests? #f
420        #:import-path "github.com/smartystreets/gunit"))
421     (synopsis "Testing tool for Go, in the style of xUnit")
422     (description
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
431   (package
432     (name "go-github.com-smartystreets-assertions")
433     (version "1.8.1")
434     (source (origin
435               (method git-fetch)
436               (uri (git-reference
437                     (url "https://github.com/smartystreets/assertions")
438                     (commit version)))
439               (file-name (git-file-name name version))
440               (sha256
441                (base32
442                 "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
443     (build-system go-build-system)
444     (arguments
445      '(#:import-path "github.com/smartystreets/assertions"))
446     (native-inputs
447      `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
448     (synopsis "Assertions for testing with Go")
449     (description
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
456   (package
457     (name "go-github.com-smartystreets-goconvey")
458     (version "1.6.3")
459     (source (origin
460               (method git-fetch)
461               (uri (git-reference
462                     (url "https://github.com/smartystreets/goconvey")
463                     (commit version)))
464               (file-name (git-file-name name version))
465               (sha256
466                (base32
467                 "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
468     (build-system go-build-system)
469     (arguments
470      '(#:import-path "github.com/smartystreets/goconvey"))
471     (propagated-inputs
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")
475     (description
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
482   (package
483     (name "googletest")
484     (version "1.8.1")
485     (source
486      (origin
487        (method git-fetch)
488        (uri (git-reference
489              (url "https://github.com/google/googletest.git")
490              (commit (string-append "release-" version))))
491        (file-name (git-file-name name version))
492        (sha256
493         (base32 "0270msj6n7mggh4xqqjp54kswbl7mkcc8px1p5dqdpmw5ngh9fzk"))))
494     (build-system cmake-build-system)
495     (arguments
496      `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
497     (native-inputs
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
503 generation.")
504     (license license:bsd-3)))
506 (define-public cpputest
507   (package
508     (name "cpputest")
509     (version "3.8")
510     (source
511      (origin
512        (method url-fetch)
513        (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
514                            version "/cpputest-" version ".tar.gz"))
515        (sha256
516         (base32
517          "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
518     (build-system gnu-build-system)
519     (native-inputs
520      `(("googletest" ,googletest)))
521     (home-page "https://cpputest.github.io/")
522     (synopsis "Unit testing and mocking framework for C/C++")
523     (description
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
530   (package
531     (name "python-parameterized")
532     (version "0.6.1")
533     (source
534      (origin
535        (method url-fetch)
536        (uri (pypi-uri "parameterized" version))
537        (sha256
538         (base32
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")
544     (description
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
553   (package
554     (name "python-minimock")
555     (version "1.2.8")
556     (source
557      (origin
558        (method url-fetch)
559        (uri (pypi-uri "MiniMock" version))
560        (sha256
561         (base32
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
567 doctest.")
568     (license license:expat)))
570 (define-public python2-minimock
571   (package-with-python2 python-minimock))
573 (define-public python-mock
574   (package
575     (name "python-mock")
576     (version "2.0.0")
577     (source
578      (origin
579        (method url-fetch)
580        (uri (pypi-uri "mock" version))
581        (sha256
582         (base32
583          "1flbpksir5sqrvq2z0dp8sl4bzbadg21sj4d42w3klpdfvgvcn5i"))))
584     (propagated-inputs
585      `(("python-pbr" ,python-pbr-minimal)
586        ("python-six" ,python-six)))
587     (build-system python-build-system)
588     (native-inputs
589      `(("python-unittest2" ,python-unittest2)))
590     (arguments
591      `(#:phases
592        (modify-phases %standard-phases
593          (replace 'check
594            (lambda _
595              (zero? (system* "unit2")))))))
596     (home-page "https://github.com/testing-cabal/mock")
597     (synopsis "Python mocking and patching library for testing")
598     (description
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
601 have been used.")
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)
609       (propagated-inputs
610        `(("python2-functools32" ,python2-functools32)
611          ("python2-funcsigs" ,python2-funcsigs)
612          ,@(package-propagated-inputs base))))))
614 (define-public python-nose
615   (package
616     (name "python-nose")
617     (version "1.3.7")
618     (source
619       (origin
620         (method url-fetch)
621         (uri (pypi-uri "nose" version))
622         (sha256
623           (base32
624             "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
625     (build-system python-build-system)
626     (arguments
627      '(#:tests? #f)) ; FIXME: test suite fails
628     (home-page "http://readthedocs.org/docs/nose/")
629     (synopsis "Python testing library")
630     (description
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
638   (package
639     (name "python-nose2")
640     (version "0.6.5")
641       (source
642         (origin
643           (method url-fetch)
644           (uri (pypi-uri "nose2" version))
645           (sha256
646            (base32
647             "1x4zjq1zlyrh8b9ba0cmafd3w94pxhid408kibyjd3s6h1lap6s7"))))
648     (build-system python-build-system)
649     (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
650     (propagated-inputs
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")
656     (description
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
667   (package
668     (name "python-unittest2")
669     (version "1.1.0")
670     (source
671      (origin
672        (method url-fetch)
673        (uri (pypi-uri "unittest2" version))
674        (patches
675         (search-patches "python-unittest2-python3-compat.patch"
676                         "python-unittest2-remove-argparse.patch"))
677        (sha256
678         (base32
679          "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
680     (build-system python-build-system)
681     (arguments
682      '(#:phases
683        (modify-phases %standard-phases
684          (replace 'check
685            (lambda _
686              (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
687     (propagated-inputs
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")
692     (description
693      "Unittest2 is a replacement for the unittest module in the Python
694 standard library.")
695     (license license:psfl)))
697 (define-public python2-unittest2
698   (package-with-python2 python-unittest2))
700 (define-public python-pytest
701   (package
702     (name "python-pytest")
703     (version "3.8.0")
704     (source
705      (origin
706        (method url-fetch)
707        (uri (pypi-uri "pytest" version))
708        (sha256
709         (base32
710          "17grcfvd6ggvvqmprwv5y8g319nayam70hr43ssjwj40ws27z858"))))
711     (build-system python-build-system)
712     (arguments
713      `(#:phases
714        (modify-phases %standard-phases
715          (add-before 'check 'disable-invalid-tests
716            (lambda _
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    "
725                                line)))
726              #t))
727          (replace 'check (lambda _ (invoke "pytest" "-vv"))))))
728     (propagated-inputs
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)))
735     (native-inputs
736      `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
737        ("bash" ,bash)
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")
745     (description
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))))
755     (package
756       (inherit pytest)
757       (propagated-inputs
758        `(("python2-funcsigs" ,python2-funcsigs)
759          ("python2-pathlib2" ,python2-pathlib2)
760          ,@(package-propagated-inputs pytest))))))
762 (define-public python-pytest-bootstrap
763   (package
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)
774              (propagated-inputs
775               `(("python2-funcsigs" ,python2-funcsigs-bootstrap)
776                 ("python2-pathlib2" ,python2-pathlib2-bootstrap)
777                 ,@(package-propagated-inputs pytest))))))
779 (define-public python-pytest-cov
780   (package
781     (name "python-pytest-cov")
782     (version "2.6.1")
783     (source
784       (origin
785         (method url-fetch)
786         (uri (pypi-uri "pytest-cov" version))
787         (sha256
788          (base32 "0cyxbbghx2l4p60w10k00j1j74q1ngfiffr0pxn73ababjr69dha"))))
789     (build-system python-build-system)
790     (arguments
791      `(#:phases
792        (modify-phases %standard-phases
793          (replace 'check
794           (lambda _
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"))))))
800     (propagated-inputs
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")
805     (description
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
815   (package
816     (name "python-pytest-runner")
817     (version "4.2")
818     (source
819      (origin
820        (method url-fetch)
821        (uri (pypi-uri "pytest-runner" version))
822        (sha256
823         (base32
824          "1gkpyphawxz38ni1gdq1fmwyqcg02m7ypzqvv46z06crwdxi2gyj"))))
825     (build-system python-build-system)
826     (native-inputs
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")
831     (description
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
840   (package
841     (name "python-pytest-mock")
842     (version "1.10.1")
843     (source
844       (origin
845         (method url-fetch)
846         (uri (pypi-uri "pytest-mock" version))
847         (sha256
848          (base32
849           "1i5mg3ff1qk0wqfcxfz60hwy3q5dskdp36i10ckigkzffg8hc3ad"))))
850     (build-system python-build-system)
851     (native-inputs
852      `(("python-setuptools-scm" ,python-setuptools-scm)))
853     (propagated-inputs
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")
857     (description
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
862 same arguments.")
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)
870       (propagated-inputs
871        `(("python2-mock" ,python2-mock)
872          ,@(package-propagated-inputs base))))))
874 (define-public python-pytest-xdist
875   (package
876     (name "python-pytest-xdist")
877     (version "1.25.0")
878     (source
879      (origin
880        (method url-fetch)
881        (uri (pypi-uri "pytest-xdist" version))
882        (sha256
883         (base32
884          "1d812apvcmshh2l8f38spqwb3bpp0x43yy7lyfpxxzc99h4r7y4n"))
885        (modules '((guix build utils)))
886        (snippet
887         '(begin
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$"))
892            #t))))
893     (build-system python-build-system)
894     (arguments
895      '(#:tests? #f)) ;FIXME: Some tests are failing.
896        ;; #:phases
897        ;; (modify-phases %standard-phases
898        ;;   (delete 'check)
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")))))
903     (native-inputs
904      `(("python-setuptools-scm" ,python-setuptools-scm)))
905     (propagated-inputs
906      `(("python-execnet" ,python-execnet)
907        ("python-pytest" ,python-pytest)
908        ("python-py" ,python-py)))
909     (home-page
910      "https://github.com/pytest-dev/pytest-xdist")
911     (synopsis
912      "Plugin for py.test with distributed testing and loop-on-failing modes")
913     (description
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
919 result back.")
920     (license license:expat)))
922 (define-public python2-pytest-xdist
923   (package-with-python2 python-pytest-xdist))
925 (define-public python-pytest-timeout
926   (package
927     (name "python-pytest-timeout")
928     (version "1.3.3")
929     (source
930      (origin
931        (method url-fetch)
932        (uri (pypi-uri "pytest-timeout" version))
933        (sha256
934         (base32
935          "1cczcjhw4xx5sjkhxlhc5c1bkr7x6fcyx12wrnvwfckshdvblc2a"))))
936     (build-system python-build-system)
937     (propagated-inputs
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")
941     (description
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
947   (package
948     (name "python-scripttest")
949     (version "1.3")
950     (source
951      (origin
952        (method url-fetch)
953        (uri (pypi-uri "scripttest" version))
954        (sha256
955         (base32
956          "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
957     (build-system python-build-system)
958     (native-inputs
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
971   (package
972     (name "python-testtools-bootstrap")
973     (version "2.3.0")
974     (source
975      (origin
976        (method url-fetch)
977        (uri (pypi-uri "testtools" version))
978        (sha256
979         (base32
980          "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
981        (patches (search-patches "python-testtools.patch"))))
982     (build-system python-build-system)
983     (arguments '(#:tests? #f))
984     (propagated-inputs
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")
993     (synopsis
994      "Extensions to the Python standard library unit testing framework")
995     (description
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
1003   (package
1004     (inherit python-testtools-bootstrap)
1005     (name "python-testtools")
1006     (arguments
1007      `(#:phases (modify-phases %standard-phases
1008                   (replace 'check
1009                     (lambda _
1010                       (invoke "python" "-m" "testtools.run"
1011                               "testtools.tests.test_suite"))))))
1012     (propagated-inputs
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)))
1020     (native-inputs
1021      `(("python-testscenarios" ,python-testscenarios-bootstrap)))
1022     (description
1023      "Testtools extends the Python standard library unit testing framework to
1024 provide matchers, more debugging information, and cross-Python
1025 compatibility.")))
1027 (define-public python2-testtools
1028   (package-with-python2 python-testtools))
1030 (define-public python-testscenarios-bootstrap
1031   (package
1032     (name "python-testscenarios-bootstrap")
1033     (version "0.5.0")
1034     (source
1035      (origin
1036        (method url-fetch)
1037        (uri (pypi-uri "testscenarios" version))
1038        (sha256
1039         (base32
1040          "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
1041     (build-system python-build-system)
1042     (arguments
1043      `(#:phases (modify-phases %standard-phases
1044                   (replace 'check
1045                     (lambda _
1046                       (invoke "python" "-m" "testtools.run"
1047                               "testscenarios.test_suite"))))))
1048     (propagated-inputs
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")
1053     (description
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
1061   (package
1062     (inherit python-testscenarios-bootstrap)
1063     (name "python-testscenarios")
1064     (propagated-inputs
1065      `(("python-pbr" ,python-pbr)
1066        ("python-testtools" ,python-testtools)))
1067     (description
1068      "Testscenarios provides clean dependency injection for Python unittest
1069 style tests.")))
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
1077   (package
1078     (name "python-testresources-bootstrap")
1079     (version "2.0.1")
1080     (source (origin
1081               (method url-fetch)
1082               (uri (pypi-uri "testresources" version))
1083               (sha256
1084                (base32
1085                 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
1086     (build-system python-build-system)
1087     (arguments '(#:tests? #f))
1088     (propagated-inputs
1089      `(("python-pbr" ,python-pbr-minimal)))
1090     (home-page "https://launchpad.net/testresources")
1091     (synopsis
1092      "Pyunit extension for managing test resources")
1093     (description
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
1102   (package
1103     (inherit python-testresources-bootstrap)
1104     (name "python-testresources")
1105     (propagated-inputs
1106      `(("python-pbr" ,python-pbr)))
1107     (arguments '())
1108     (native-inputs
1109      `(("python-fixtures" ,python-fixtures)
1110        ("python-testtols" ,python-testtools)))
1111     (description
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
1119   (package
1120     (name "python-subunit-bootstrap")
1121     (version "1.3.0")
1122     (source
1123      (origin
1124        (method url-fetch)
1125        (uri (pypi-uri "python-subunit" version))
1126        (sha256
1127         (base32
1128          "1fsw8rsn1s3nklx06mayrg5rn2zbky6wwjc5z07s7rf1wjzfs1wn"))))
1129     (build-system python-build-system)
1130     (propagated-inputs
1131      `(("python-extras" ,python-extras)
1132        ("python-testtools" ,python-testtools-bootstrap)))
1133     (native-inputs
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")
1139     (description
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
1148   (package
1149     (inherit python-subunit-bootstrap)
1150     (name "python-subunit")
1151     (propagated-inputs
1152      `(("python-extras" ,python-extras)
1153        ("python-testtools" ,python-testtools)))
1154     (native-inputs
1155      `(("python-fixtures" ,python-fixtures)
1156        ("python-hypothesis" ,python-hypothesis)
1157        ("python-testscenarios" ,python-testscenarios)))
1158     (description
1159      "Python-subunit is a Python implementation of the subunit test streaming
1160 protocol.")))
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
1168   (package
1169     (name "python-fixtures-bootstrap")
1170     (version "3.0.0")
1171     (source (origin
1172               (method url-fetch)
1173               (uri (pypi-uri "fixtures" version))
1174               (sha256
1175                (base32
1176                 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
1177     (build-system python-build-system)
1178     (arguments `(#:tests? #f))
1179     (propagated-inputs
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")
1184     (description
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
1193   (package
1194     (inherit python-fixtures-bootstrap)
1195     (name "python-fixtures")
1196     (arguments
1197      '(#:phases
1198        (modify-phases %standard-phases
1199          (replace 'check
1200            (lambda _
1201              (invoke "python" "-m" "testtools.run"
1202                      "fixtures.test_suite"))))))
1203     (propagated-inputs
1204      ;; Fixtures uses pbr at runtime to check versions, etc.
1205      `(("python-pbr" ,python-pbr)
1206        ("python-six" ,python-six)))
1207     (native-inputs
1208      `(("python-mock" ,python-mock)
1209        ("python-testtools" ,python-testtools-bootstrap)))
1210     (description
1211      "Fixtures provides a way to create reusable state, useful when writing
1212 Python tests.")))
1214 (define-public python2-fixtures
1215   (package-with-python2 python-fixtures))
1217 (define-public python-testrepository-bootstrap
1218   (package
1219     (name "python-testrepository-bootstrap")
1220      (version "0.0.20")
1221     (source
1222      (origin
1223        (method url-fetch)
1224        (uri (pypi-uri "testrepository" version))
1225        (sha256
1226         (base32
1227          "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1228     (build-system python-build-system)
1229     (arguments '(#:tests? #f))
1230     (propagated-inputs
1231      `(("python-fixtures" ,python-fixtures-bootstrap)
1232        ("python-subunit" ,python-subunit-bootstrap)
1233        ("python-testtools" ,python-testtools-bootstrap)))
1234     (native-inputs
1235      `(("python-mimeparse" ,python-mimeparse)))
1236     (home-page "https://launchpad.net/testrepository")
1237     (synopsis "Database for Python test results")
1238     (description
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
1246   (package
1247     (inherit python-testrepository-bootstrap)
1248     (name "python-testrepository")
1249     (arguments
1250      ;; FIXME: Many tests are failing.
1251      '(#:tests? #f))
1252     (propagated-inputs
1253      `(("python-fixtures" ,python-fixtures)
1254        ("python-subunit" ,python-subunit)
1255        ("python-testtools" ,python-testtools)))
1256     (native-inputs
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
1266   (package
1267     (name "python-coverage")
1268     (version "4.4.1")
1269     (source
1270      (origin
1271        (method url-fetch)
1272        (uri (pypi-uri "coverage" version))
1273        (sha256
1274         (base32
1275          "097l4s3ssxm1vncsn0nw3a1pbzah28773q36c1ab9wz01r04973s"))))
1276     (build-system python-build-system)
1277     (arguments
1278      ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1279      '(#:tests? #f))
1280     (home-page "http://nedbatchelder.com/code/coverage")
1281     (synopsis "Code coverage measurement for Python")
1282     (description
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
1286 executed.")
1287     (license license:bsd-3)))
1289 (define-public python2-coverage
1290   (package-with-python2 python-coverage))
1292 (define-public python-cov-core
1293   (package
1294     (name "python-cov-core")
1295     (version "1.15.0")
1296     (source
1297       (origin
1298         (method url-fetch)
1299         (uri (pypi-uri "cov-core" version))
1300         (sha256
1301          (base32
1302           "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1303     (build-system python-build-system)
1304     (propagated-inputs
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")
1308     (description
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
1318   (package
1319     (name "python-codecov")
1320     (version "2.0.15")
1321     (source
1322       (origin
1323         (method url-fetch)
1324         (uri (pypi-uri "codecov" version))
1325         (sha256
1326          (base32
1327           "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1328     (build-system python-build-system)
1329     (native-inputs
1330      `(("python-unittest2" ,python-unittest2)))
1331     (propagated-inputs
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}")
1336     (description
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
1342   (package
1343     (name "python-testpath")
1344     (version "0.2")
1345     (source
1346      (origin
1347        (method git-fetch)
1348        (uri (git-reference
1349               (url "https://github.com/jupyter/testpath")
1350               (commit version)))
1351        (file-name (git-file-name name version))
1352        (sha256
1353         (base32
1354          "0r4iiizjql6ny1ln7ciw7rrbjadz1s9zrf2hl0xkgnh3ypd8936f"))))
1355     (build-system python-build-system)
1356     (arguments
1357      `(#:tests? #f ; this package does not even have a setup.py
1358        #:modules ((guix build python-build-system)
1359                   (guix build utils)
1360                   (srfi srfi-1))
1361        #:imported-modules (,@%python-build-system-modules
1362                            (srfi srfi-1))
1363        #:phases
1364        (modify-phases %standard-phases
1365          (delete 'install)
1366          (replace 'build
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)
1371                                         "."))
1372                     (dir (string-append
1373                           (assoc-ref outputs "out")
1374                           "/lib/python" x.y "/site-packages/testpath")))
1375                (mkdir-p dir)
1376                (copy-recursively "testpath" dir))
1377              #t)))))
1378     (home-page "https://github.com/takluyver/testpath")
1379     (synopsis "Test utilities for code working with files and commands")
1380     (description
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
1390   (package
1391     (name "python-testlib")
1392     (version "0.6.5")
1393     (source
1394      (origin
1395        (method url-fetch)
1396        (uri (pypi-uri "testlib" version ".zip"))
1397        (sha256
1398         (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1399     (build-system python-build-system)
1400     (native-inputs
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
1412   (package
1413     (name "python-pytest-cache")
1414     (version "1.0")
1415     (source (origin
1416              (method url-fetch)
1417              (uri (pypi-uri "pytest-cache" version))
1418              (sha256
1419               (base32
1420                "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1421     (build-system python-build-system)
1422     (propagated-inputs
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
1437   (package
1438     (name "python-pytest-localserver")
1439     (version "0.5.0")
1440     (source (origin
1441               (method url-fetch)
1442               (uri (pypi-uri "pytest-localserver" version))
1443               (sha256
1444                (base32
1445                 "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
1446     (build-system python-build-system)
1447     (arguments
1448      '(#:phases
1449        (modify-phases %standard-phases
1450          (replace 'check
1451            (lambda _
1452              (invoke "py.test" "-v"))))))
1453     (native-inputs
1454      `(("python-pytest" ,python-pytest)
1455        ("python-requests" ,python-requests)
1456        ("python-six" ,python-six)))
1457     (propagated-inputs
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
1466   (package
1467     (name "python-pytest-xprocess")
1468     (version "0.9.1")
1469     (source (origin
1470              (method url-fetch)
1471              (uri (pypi-uri "pytest-xprocess" version))
1472              (sha256
1473               (base32
1474                "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1475     (build-system python-build-system)
1476     (propagated-inputs
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
1487   (package
1488     (name "python-pytest-subtesthack")
1489     (version "0.1.1")
1490     (source (origin
1491               (method url-fetch)
1492               (uri (pypi-uri "pytest-subtesthack" version))
1493               (sha256
1494                (base32
1495                 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1496     (build-system python-build-system)
1497     (propagated-inputs
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
1512   (package
1513     (name "python-pytest-sugar")
1514     (version "0.9.2")
1515     (source
1516      (origin
1517        (method url-fetch)
1518        (uri (pypi-uri "pytest-sugar" version))
1519        (sha256
1520         (base32
1521          "1asq7yc4g8bx2sn7yy974mhc9ywvaihasjab4inkirdwn9s7mn7w"))))
1522     (build-system python-build-system)
1523     (propagated-inputs
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")
1529     (description
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
1532 instantly.")
1533     (license license:bsd-3)))
1535 (define-public python-hypothesis
1536   (package
1537     (name "python-hypothesis")
1538     (version "3.70.3")
1539     (source (origin
1540               (method url-fetch)
1541               (uri (pypi-uri "hypothesis" version))
1542               (sha256
1543                (base32
1544                 "1rshs1japfmwgar98yrkq4hg4z2q76hlnq7w2n3lfbjnscn1jd9b"))))
1545     (build-system python-build-system)
1546     (native-inputs
1547      `(;; FIXME: Change to python-flake8 in the next rebuild cycle.
1548        ("python-flake8" ,python-flake8-3.5)
1549        ("python-pytest" ,python-pytest-bootstrap)))
1550     (propagated-inputs
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)
1566       (propagated-inputs
1567        `(("python2-enum34" ,python2-enum34)
1568          ,@(package-propagated-inputs hypothesis))))))
1570 (define-public python-lit
1571   (package
1572     (name "python-lit")
1573     (version "0.5.1")
1574     (source
1575       (origin
1576         (method url-fetch)
1577         (uri (pypi-uri "lit" version))
1578         (sha256
1579          (base32
1580           "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
1581     (build-system python-build-system)
1582     (arguments
1583      `(#:phases
1584        (modify-phases %standard-phases
1585          (replace 'check
1586            (lambda _
1587              (invoke "python" "lit.py" "tests"))))))
1588     (native-inputs
1589      `(("llvm" ,llvm)))
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
1594 failures.")
1595     (license license:ncsa)))
1597 (define-public python2-lit
1598   (package-with-python2 python-lit))
1600 (define-public python-pytest-pep8
1601   (package
1602     (name "python-pytest-pep8")
1603     (version "1.0.6")
1604     (source (origin
1605               (method url-fetch)
1606               (uri (pypi-uri "pytest-pep8" version))
1607               (sha256
1608                (base32
1609                 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
1610     (build-system python-build-system)
1611     (arguments
1612      `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
1613     (native-inputs
1614      `(("python-pytest" ,python-pytest)))
1615     (propagated-inputs
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
1626   (package
1627     (name "python-pytest-flakes")
1628     (version "1.0.1")
1629     (source (origin
1630               (method url-fetch)
1631               (uri (pypi-uri "pytest-flakes" version))
1632               (sha256
1633                (base32
1634                 "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
1635     (build-system python-build-system)
1636     (arguments
1637      `(#:phases
1638        (modify-phases %standard-phases
1639          (delete 'check)
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"))))))
1646     (native-inputs
1647      `(("python-coverage" ,python-coverage)
1648        ("python-pytest" ,python-pytest)
1649        ("python-pytest-cache" ,python-pytest-cache)
1650        ("python-pytest-pep8" ,python-pytest-pep8)))
1651     (propagated-inputs
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
1662   (package
1663     (name "python2-coverage-test-runner")
1664     (version "1.15")
1665     (source
1666      (origin
1667        (method url-fetch)
1668        (uri (string-append
1669              "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
1670              "coverage-test-runner/snapshot/coverage-test-runner-"
1671              version ".tar.gz"))
1672        (sha256
1673         (base32
1674          "1kjjb9llckycnfxag8zcvqsn4z1s3dwyw6b1n0avxydihgf30rny"))))
1675     (build-system python-build-system)
1676     (arguments
1677      `(#:python ,python-2
1678        #:phases
1679        (modify-phases %standard-phases
1680          (replace 'check
1681            (lambda _
1682              (invoke "./testrun"))))))
1683     (propagated-inputs
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
1693   (package
1694     (name "python-pylint")
1695     (version "1.7.2")
1696     (source
1697      (origin
1698        (method url-fetch)
1699        (uri (string-append
1700              "https://github.com/PyCQA/pylint/archive/pylint-"
1701              version ".tar.gz"))
1702        (sha256
1703         (base32
1704          "0mzn1czhf1mgr2wiqfihb274sja02h899b85kywdpivppa9nwrmp"))))
1705     (build-system python-build-system)
1706     (native-inputs
1707      `(("python-pytest" ,python-pytest)
1708        ("python-pytest-runner" ,python-pytest-runner)
1709        ("python-tox" ,python-tox)))
1710     (propagated-inputs
1711      `(("python-astroid" ,python-astroid)
1712        ("python-isort" ,python-isort)
1713        ("python-mccabe" ,python-mccabe)
1714        ("python-six" ,python-six)))
1715     (arguments
1716      `(#:phases
1717        (modify-phases %standard-phases
1718          (replace 'check
1719                   (lambda _
1720                     ;; Somehow, tests for python2-pylint
1721                     ;; fail if run from the build directory
1722                     (let ((work "/tmp/work"))
1723                       (mkdir-p 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
1733 errors")
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)
1749              (propagated-inputs
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
1756   (package
1757     (name "python-paramunittest")
1758     (version "0.2")
1759     (source
1760      (origin
1761        (method url-fetch)
1762        (uri (pypi-uri "ParamUnittest" version))
1763        (sha256
1764         (base32
1765          "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
1766     (build-system python-build-system)
1767     (home-page
1768      "https://github.com/rik0/ParamUnittest")
1769     (synopsis
1770      "Simple extension to have parametrized unit tests")
1771     (description
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
1782   (package
1783     (name "python-pytest-warnings")
1784     (version "0.2.0")
1785     (source
1786      (origin
1787        (method url-fetch)
1788        (uri (pypi-uri "pytest-warnings" version))
1789        (sha256
1790         (base32
1791          "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
1792     (build-system python-build-system)
1793     (propagated-inputs
1794      `(("pytest" ,python-pytest)))
1795     (home-page "https://github.com/fschulze/pytest-warnings")
1796     (synopsis "Pytest plugin to list Python warnings in pytest report")
1797     (description
1798      "Python-pytest-warnings is a pytest plugin to list Python warnings in
1799 pytest report.")
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
1811   (package
1812     (name "python-pytest-capturelog")
1813     (version "0.7")
1814     (source
1815      (origin
1816        (method url-fetch)
1817        (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
1818        (sha256
1819         (base32
1820          "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
1821     (build-system python-build-system)
1822     (propagated-inputs
1823      `(("pytest" ,python-pytest)))
1824     (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
1825     (synopsis "Pytest plugin to catch log messages")
1826     (description
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
1834   (package
1835     (name "python-pytest-catchlog")
1836     (version "1.2.2")
1837     (source
1838      (origin
1839        (method url-fetch)
1840        (uri (pypi-uri "pytest-catchlog" version ".zip"))
1841        (sha256
1842         (base32
1843          "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
1844     (build-system python-build-system)
1845     (native-inputs
1846      `(("unzip" ,unzip)))
1847     (propagated-inputs
1848      `(("pytest" ,python-pytest)))
1849     (home-page "https://github.com/eisensheng/pytest-catchlog")
1850     (synopsis "Pytest plugin to catch log messages")
1851     (description
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
1860   (package
1861     (name "python-nosexcover")
1862     (version "1.0.11")
1863     (source (origin
1864               (method url-fetch)
1865               (uri (pypi-uri "nosexcover" version))
1866               (sha256
1867                (base32
1868                 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
1869     (build-system python-build-system)
1870     (propagated-inputs
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
1887   (package
1888     (name "python-discover")
1889     (version "0.4.0")
1890     (source
1891      (origin
1892        (method url-fetch)
1893        (uri (pypi-uri "discover" version))
1894        (sha256
1895         (base32
1896          "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
1897     (build-system python-build-system)
1898     (home-page "http://pypi.python.org/pypi/discover/")
1899     (synopsis
1900      "Python test discovery for unittest")
1901     (description
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
1910   (package
1911     (name "behave")
1912     (version "1.2.6")
1913     (source (origin
1914              (method url-fetch)
1915              (uri (pypi-uri "behave" version))
1916              (sha256
1917               (base32
1918                "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))))
1919     (build-system python-build-system)
1920     (native-inputs
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)))
1926     (propagated-inputs
1927      `(("python-importlib-metadata" ,python-importlib-metadata)
1928        ("python-six" ,python-six)
1929        ("python-parse" ,python-parse)
1930        ("python-parse-type" ,python-parse-type)))
1931     (arguments
1932      '(#:test-target "behave_test"))
1933     (home-page "https://github.com/behave/behave")
1934     (synopsis "Python behavior-driven development")
1935     (description
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
1944   (package
1945     (name "python-behave-web-api")
1946     (version "1.0.6")
1947     (source
1948      (origin
1949        (method url-fetch)
1950        (uri (pypi-uri "behave-web-api" version))
1951        (sha256
1952         (base32
1953          "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
1954     (build-system python-build-system)
1955     (arguments
1956      `(#:phases
1957        (modify-phases %standard-phases
1958          (add-after 'unpack 'fix-dependencies
1959            (lambda _
1960              (substitute* "setup.py"
1961                (("'wheel'") "")                ; We don't use it.
1962                (("'ordereddict==1.1'") ""))    ; Python >= 2.7 has it built-in.
1963              #t)))))
1964     (propagated-inputs
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
1977   (package
1978     (name "python-rednose")
1979     (version "1.2.3")
1980     (source
1981       (origin
1982         (method url-fetch)
1983         (uri (pypi-uri "rednose" version))
1984         (sha256
1985           (base32
1986             "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
1987     (build-system python-build-system)
1988     (arguments
1989      `(#:phases (modify-phases %standard-phases
1990                   (add-after 'unpack 'patch-setup.py
1991                     (lambda _
1992                       ;; Six is only required for tests and later versions
1993                       ;; work fine.
1994                       (substitute* "setup.py"
1995                         (("six==1.10.0") "six"))
1996                       #t)))))
1997     (propagated-inputs
1998      `(("python-colorama" ,python-colorama)
1999        ("python-termstyle" ,python-termstyle)))
2000     (native-inputs
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
2013   (package
2014     (name "python-nose-randomly")
2015     (version "1.2.6")
2016     (source
2017      (origin
2018        (method url-fetch)
2019        (uri (pypi-uri "nose-randomly" version))
2020        (sha256
2021         (base32 "0z662rqhfk4bjmg806mn4frb8nz4gbh7mrddsrhfffp1g4yklj3y"))))
2022     (build-system python-build-system)
2023     (native-inputs
2024      `(("python-nose" ,python-nose)
2025        ("python-numpy" ,python-numpy)))
2026     (home-page "https://github.com/adamchainz/nose-randomly")
2027     (synopsis
2028      "Nose plugin to randomly order tests and control random.seed")
2029     (description
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
2041   (package
2042     (name "python-nose-timer")
2043     (version "0.7.5")
2044     (source
2045       (origin
2046         (method url-fetch)
2047         (uri (pypi-uri "nose-timer" version))
2048         (sha256
2049           (base32 "05wzkc88vbzw62pqkvhl33211b90kns0lny70b7qw62rcg4flzk4"))))
2050     (build-system python-build-system)
2051     (propagated-inputs
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
2063   (package
2064     (name "python-freezegun")
2065     (version "0.3.12")
2066     (source
2067      (origin
2068        (method url-fetch)
2069        (uri (pypi-uri "freezegun" version))
2070        (sha256
2071         (base32 "1rx57v8ryjncjimg8hys9kx1r3rknvwcl4y340g20jn0sf69qk9a"))))
2072     (build-system python-build-system)
2073     (native-inputs
2074      `(("python-mock" ,python-mock)
2075        ("python-pytest" ,python-pytest)))
2076     (propagated-inputs
2077      `(("python-six" ,python-six)
2078        ("python-dateutil" ,python-dateutil)))
2079     (arguments
2080      `(#:phases
2081        (modify-phases %standard-phases
2082          ;; The tests are normally executed via `make test`, but the PyPi
2083          ;; package does not include the Makefile.
2084          (replace 'check
2085            (lambda _
2086              (invoke "pytest" "-vv"))))))
2087     (home-page "https://github.com/spulec/freezegun")
2088     (synopsis "Test utility for mocking the datetime module")
2089     (description
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
2098   (package
2099     (name "python-flexmock")
2100     (version "0.10.4")
2101     (source (origin
2102               (method url-fetch)
2103               (uri (pypi-uri "flexmock" version))
2104               (sha256
2105                (base32
2106                 "0b6qw3grhgx58kxlkj7mdma7xdvlj02zabvcf7w2qifnfjwwwcsh"))))
2107     (build-system python-build-system)
2108     (home-page "https://flexmock.readthedocs.org")
2109     (synopsis "Testing library for Python")
2110     (description
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
2119   (package
2120     (name "python-flaky")
2121     (version "3.5.3")
2122     (source (origin
2123               (method url-fetch)
2124               (uri (pypi-uri "flaky" version))
2125               (sha256
2126                (base32
2127                 "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j"))))
2128     (build-system python-build-system)
2129     (arguments
2130      ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2131      '(#:tests? #f))
2132     (home-page "https://github.com/box/flaky")
2133     (synopsis "Automatically rerun flaky tests")
2134     (description
2135      "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2136 reruns flaky tests.
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
2141 retried.")
2142     (license license:asl2.0)))
2144 (define-public python2-flaky
2145   (package-with-python2 python-flaky))
2147 (define-public python-pyhamcrest
2148   (package
2149     (name "python-pyhamcrest")
2150     (version "1.9.0")
2151     (source (origin
2152               ;; Tests not distributed from pypi release.
2153               (method git-fetch)
2154               (uri (git-reference
2155                      (url "https://github.com/hamcrest/PyHamcrest")
2156                      (commit (string-append "V" version))))
2157               (file-name (git-file-name name version))
2158               (sha256
2159                (base32
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)))
2166     (propagated-inputs
2167      `(("python-six" ,python-six)))
2168     (build-system python-build-system)
2169     (home-page "http://hamcrest.org/")
2170     (synopsis "Hamcrest matchers for Python")
2171     (description
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
2180   (package
2181     (name "unittest-cpp")
2182     (version "2.0.0")
2183     (source (origin
2184               (method git-fetch)
2185               (uri (git-reference
2186                      (url "https://github.com/unittest-cpp/unittest-cpp")
2187                      (commit (string-append "v" version))))
2188               (file-name (git-file-name name version))
2189               (sha256
2190                (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
2191     (arguments
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
2205   (package
2206     (name "libfaketime")
2207     (version "0.9.7")
2208     (home-page "https://github.com/wolfcw/libfaketime")
2209     (source (origin
2210               (method git-fetch)
2211               (uri (git-reference
2212                     (url home-page)
2213                     (commit (string-append "v" version))))
2214               (sha256
2215                (base32
2216                 "1cin1pqwpsswcv7amiwijirvcg3x1zf2l00s1x84nxc5602fzr5c"))
2217               (file-name (git-file-name name version))))
2218     (build-system gnu-build-system)
2219     (arguments
2220      '(#:phases (modify-phases %standard-phases
2221                   (replace 'configure
2222                     (lambda* (#:key outputs #:allow-other-keys)
2223                       (let ((out (assoc-ref outputs "out")))
2224                         (setenv "CC" "gcc")
2225                         (setenv "PREFIX" out)
2226                         #t)))
2227                   (add-before 'check 'pre-check
2228                     (lambda _
2229                       (substitute* "test/functests/test_exclude_mono.sh"
2230                         (("/bin/bash") (which "bash")))
2231                       #t)))
2232        #:test-target "test"))
2233     (native-inputs
2234      `(("perl" ,perl)))                           ;for tests
2235     (synopsis "Fake the system time for single applications")
2236     (description
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
2244   (package
2245     (name "umockdev")
2246     (version "0.12.1")
2247     (source (origin
2248               (method url-fetch)
2249               (uri (string-append "https://github.com/martinpitt/umockdev/"
2250                                   "releases/download/" version  "/"
2251                                   "umockdev-" version ".tar.xz"))
2252               (sha256
2253                (base32
2254                 "1hx5jm9afng6hw9wyp524z8nwdp6w053pca0w2c0gqpgrmvjxvd2"))))
2255     (build-system gnu-build-system)
2256     (arguments
2257      `(#:phases
2258        (modify-phases %standard-phases
2259          (add-after 'unpack 'skip-broken-test
2260            (lambda _
2261              (substitute* "tests/test-umockdev.c"
2262                (("/\\* sys/ in other dir")
2263                 (string-append "return; // ")))
2264              #t)))))
2265     (native-inputs
2266      `(("vala" ,vala)
2267        ("python" ,python)               ; for tests
2268        ("which" ,which)                 ; for tests
2269        ("gtk-doc" ,gtk-doc)
2270        ("pkg-config" ,pkg-config)))
2271     (inputs
2272      `(("glib" ,glib)
2273        ("eudev" ,eudev)
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
2282 loaded.")
2283     (license license:lgpl2.1+)))
2285 (define-public python-pyfakefs
2286   (package
2287     (name "python-pyfakefs")
2288     (version "3.5.8")
2289     (source (origin
2290               (method url-fetch)
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))
2295               (sha256
2296                (base32
2297                 "0qb9jp0bqhc0dv0rn805fv99029fvx135f3bvka6scfkcl6jgllc"))
2298               (patches (search-patches
2299                         "python-pyfakefs-remove-bad-test.patch"))
2300               (file-name (string-append name "-" version ".tar.gz"))))
2301     (arguments
2302      `(#:phases
2303        (modify-phases %standard-phases
2304          ;; The default test suite does not run these extra tests.
2305          (add-after 'check 'check-pytest-plugin
2306            (lambda _
2307              (invoke
2308               "python" "-m" "pytest"
2309               "pyfakefs/pytest_tests/pytest_plugin_test.py")
2310              #t)))))
2311     (native-inputs
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")
2320     (description
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))