gnu: Add external-program.
[jackhill/guix/guix.git] / gnu / packages / check.scm
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, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
25 ;;; Copyright © 2017, 2019 Kei Kebreau <kkebreau@posteo.net>
26 ;;; Copyright © 2017 ng0 <ng0@n0.is>
27 ;;; Copyright © 2015, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
28 ;;; Copyright © 2016, 2017, 2018, 2019 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/>.
48
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))
77
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+)))
101
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+)))
133
134 (define-public cppunit
135 (package
136 (name "cppunit")
137 (version "1.14.0")
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 "1027cyfx5gsjkdkaf6c2wnjh68882grw8n672018cj3vs9lrhmix"))))
145 ;; Explicitly link with libdl. This is expected to be done by packages
146 ;; relying on cppunit for their tests. However, not all of them do.
147 ;; If we added the linker flag to such packages, we would pollute all
148 ;; binaries, not only those used for testing.
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
158
159 ;; When dependent packages upgraded to use newer version of catch, this one should
160 ;; be removed.
161 (define-public catch-framework
162 (package
163 (name "catch")
164 (version "1.3.5") ;Sub-minor is the build number
165 (source (origin
166 (method git-fetch)
167 (uri (git-reference
168 (url "https://github.com/philsquared/Catch")
169 ;; Semi-arbitrary.
170 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
171 (file-name (string-append name "-" version))
172 (sha256
173 (base32
174 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
175 (build-system trivial-build-system)
176 (arguments
177 `(#:modules ((guix build utils))
178 #:builder (begin
179 (use-modules (guix build utils))
180 (let* ((source (assoc-ref %build-inputs "source"))
181 (output (assoc-ref %outputs "out"))
182 (incdir (string-append output "/include"))
183 (docdir (string-append output "/share/doc/catch-"
184 ,version)))
185 (for-each mkdir-p (list incdir docdir))
186 (install-file (string-append source
187 "/single_include/catch.hpp")
188 incdir)
189 (copy-recursively (string-append source "/docs")
190 docdir)
191 #t))))
192 (home-page "http://catch-lib.net/")
193 (synopsis "Automated test framework for C++ and Objective-C")
194 (description
195 "Catch stands for C++ Automated Test Cases in Headers and is a
196 multi-paradigm automated test framework for C++ and Objective-C.")
197 (license license:boost1.0)))
198
199 (define-public catch-framework2-1
200 (package
201 (name "catch2")
202 (version "1.12.2")
203 (home-page "https://github.com/catchorg/Catch2")
204 (source (origin
205 (method git-fetch)
206 (uri (git-reference
207 (url "https://github.com/catchorg/Catch2")
208 (commit (string-append "v" version))))
209 (file-name (git-file-name name version))
210 (sha256
211 (base32
212 "1gdp5wm8khn02g2miz381llw3191k7309qj8s3jd6sasj01rhf23"))))
213 (build-system cmake-build-system)
214 (synopsis "Automated test framework for C++ and Objective-C")
215 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
216 a multi-paradigm automated test framework for C++ and Objective-C.")
217 (license license:boost1.0)))
218
219 (define-public catch-framework2
220 (package
221 (name "catch2")
222 (version "2.1.2")
223 (home-page "https://github.com/catchorg/Catch2")
224 (source (origin
225 (method git-fetch)
226 (uri (git-reference
227 (url "https://github.com/catchorg/Catch2")
228 (commit (string-append "v" version))))
229 (file-name (git-file-name name version))
230 (sha256
231 (base32
232 "14vcckqmbydjsg40ngi6iv999zimysh2l7fmrqj1d7xl990qz233"))))
233 (build-system cmake-build-system)
234 (inputs
235 `(("python" ,python-wrapper)))
236 (synopsis "Automated test framework for C++ and Objective-C")
237 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
238 a multi-paradigm automated test framework for C++ and Objective-C.")
239 (license license:boost1.0)))
240
241 (define-public cmdtest
242 (package
243 (name "cmdtest")
244 (version "0.32")
245 (source (origin
246 (method url-fetch)
247 (uri (string-append "http://git.liw.fi/cmdtest/snapshot/"
248 name "-" version ".tar.gz"))
249 (sha256
250 (base32
251 "1jmfiyrrqmpvwdb273bkb8hjaf4rwx9njblx29pmr7giyahskwi5"))))
252 (build-system python-build-system)
253 (arguments
254 `(#:python ,python-2
255 #:phases
256 (modify-phases %standard-phases
257 ;; check phase needs to be run before the build phase. If not, the
258 ;; coverage test runner looks for tests for the built source files,
259 ;; and fails.
260 (delete 'check)
261 (add-before 'build 'check
262 (lambda _
263 (substitute* "yarn"
264 (("/bin/sh") (which "sh")))
265 ;; yarn uses python2-ttystatus to print messages.
266 ;; python2-ttystatus requires /dev/tty which is not present in
267 ;; the build environment. Hence assuming-failure test fails.
268 (delete-file "yarn.tests/assuming-failure.script")
269 (delete-file "yarn.tests/assuming-failure.stdout")
270 (invoke "python" "setup.py" "check"))))))
271 (native-inputs
272 `(("python2-coverage-test-runner" ,python2-coverage-test-runner)))
273 (propagated-inputs
274 `(("python2-cliapp" ,python2-cliapp)
275 ("python2-markdown" ,python2-markdown)
276 ("python2-ttystatus" ,python2-ttystatus)))
277 (home-page "https://liw.fi/cmdtest/")
278 (synopsis "Black box Unix program tester")
279 (description
280 "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
281 given a command line and input files, and the expected output, and it verifies
282 that the command line produces the expected output. If not, it reports a
283 problem, and shows the differences.")
284 (license license:gpl3+)))
285
286 (define-public cmocka
287 (package
288 (name "cmocka")
289 (version "1.1.5")
290 (source (origin
291 (method url-fetch)
292 (uri (string-append "https://cmocka.org/files/"
293 (version-major+minor version) "/cmocka-"
294 version ".tar.xz"))
295 (sha256
296 (base32
297 "1dm8pdvkyfa8dsbz9bpq7wwgixjij4sii9bbn5sgvqjm5ljdik7h"))))
298 (build-system cmake-build-system)
299 (arguments
300 `(#:tests? #f)) ; no test target
301 (home-page "https://cmocka.org/")
302 (synopsis "Unit testing framework for C")
303 (description "Cmocka is a unit testing framework for C with support for
304 mock objects. It only requires the standard C library, and works with
305 different compilers. Cmocka supports several different message output formats
306 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
307 format.")
308 (license license:asl2.0)))
309
310 (define-public cppcheck
311 (package
312 (name "cppcheck")
313 (version "1.89")
314 (source (origin
315 (method git-fetch)
316 (uri (git-reference
317 (url "https://github.com/danmar/cppcheck")
318 (commit version)))
319 (file-name (git-file-name name version))
320 (sha256
321 (base32 "07yn1zycsb7sn1v7fprihbl0ih4n2zkd7l9jvmkjcskvwn4n21h0"))))
322 (build-system cmake-build-system)
323 (arguments
324 '(#:configure-flags '("-DBUILD_TESTS=ON")))
325 (home-page "http://cppcheck.sourceforge.net")
326 (synopsis "Static C/C++ code analyzer")
327 (description "Cppcheck is a static code analyzer for C and C++. Unlike
328 C/C++ compilers and many other analysis tools it does not detect syntax errors
329 in the code. Cppcheck primarily detects the types of bugs that the compilers
330 normally do not detect. The goal is to detect only real errors in the code
331 (i.e. have zero false positives).")
332 (license license:gpl3+)))
333
334 (define-public cxxtest
335 (package
336 (name "cxxtest")
337 (version "4.4")
338 (source (origin
339 (method url-fetch)
340 (uri (string-append "mirror://sourceforge/cxxtest/cxxtest/"
341 version "/cxxtest-" version ".tar.gz"))
342 (sha256
343 (base32
344 "1n7pbj4z9ivx005hqvivj9ddhq8awynzg6jishfbypf6j7ply58w"))))
345 (build-system python-build-system)
346 (arguments
347 '(#:phases
348 (modify-phases %standard-phases
349 (add-after 'unpack 'chdir-to-source
350 (lambda _
351 (chdir "python")
352 #t))
353 (add-after 'install 'install-headers
354 (lambda* (#:key outputs #:allow-other-keys)
355 (let* ((out (assoc-ref outputs "out"))
356 (include-dir (string-append out "/include/cxxtest")))
357 (for-each (lambda (header-file)
358 (install-file header-file include-dir))
359 (find-files "../cxxtest"))
360 #t)))
361 (add-after 'install 'install-doc
362 (lambda* (#:key outputs #:allow-other-keys)
363 (let* ((out (assoc-ref outputs "out"))
364 (doc-dir (string-append out "/share/doc/cxxtest")))
365 (install-file "../README" doc-dir)
366 (install-file "../doc/guide.txt" doc-dir)
367 (copy-recursively "../sample" (string-append doc-dir "/sample"))
368 #t))))))
369 (propagated-inputs
370 `(("python-ply" ,python-ply)))
371 (home-page "https://cxxtest.com/")
372 (synopsis "Unit testing framework for C++")
373 (description "CxxTest is a unit testing framework for C++ that is similar
374 in spirit to JUnit, CppUnit, and xUnit. CxxTest does not require precompiling
375 a CxxTest testing library, it employs no advanced features of C++ (e.g. RTTI)
376 and it supports a very flexible form of test discovery.")
377 (license license:lgpl3+)))
378
379 (define-public doctest
380 (package
381 (name "doctest")
382 (version "2.3.5")
383 (home-page "https://github.com/onqtam/doctest")
384 (source (origin
385 (method git-fetch)
386 (uri (git-reference (url home-page) (commit version)))
387 (file-name (git-file-name name version))
388 (sha256
389 (base32
390 "0rddlzhnv0f5036q0m0p019pismka7sx6x8cnzk65sk77b1dsbhg"))))
391 (build-system cmake-build-system)
392 (synopsis "C++ test framework")
393 (description
394 "doctest is a single-header testing framework for C++11 and later. It
395 has been designed to be fast, light and unintrusive.")
396 (license license:expat)))
397
398 (define-public go-gopkg.in-check.v1
399 (let ((commit "788fd78401277ebd861206a03c884797c6ec5541")
400 (revision "1"))
401 (package
402 (name "go-gopkg.in-check.v1")
403 (version (git-version "0.0.0" revision commit))
404 (source (origin
405 (method git-fetch)
406 (uri (git-reference
407 (url "https://github.com/go-check/check.git")
408 (commit commit)))
409 (file-name (git-file-name name version))
410 (sha256
411 (base32
412 "0v3bim0j375z81zrpr5qv42knqs0y2qv2vkjiqi5axvb78slki1a"))))
413 (build-system go-build-system)
414 (arguments
415 '(#:import-path "gopkg.in/check.v1"))
416 (propagated-inputs
417 `(("go-github-com-kr-pretty" ,go-github-com-kr-pretty)))
418 (synopsis "Rich testing extension for Go's testing package")
419 (description
420 "@code{check} is a rich testing extension for Go's testing package.")
421 (home-page "https://github.com/go-check/check")
422 (license license:bsd-2))))
423
424 (define-public go-github.com-smartystreets-gunit
425 (package
426 (name "go-github.com-smartystreets-gunit")
427 (version "1.0.0")
428 (source (origin
429 (method git-fetch)
430 (uri (git-reference
431 (url "https://github.com/smartystreets/gunit")
432 (commit version)))
433 (file-name (git-file-name name version))
434 (sha256
435 (base32
436 "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
437 (build-system go-build-system)
438 (arguments
439 '(;; TODO: This package depends on go-github.com-smartystreets-assertions
440 ;; for running the tests, but go-github.com-smartystreets-assertions
441 ;; depends on this package, so break this loop by not running the tests
442 ;; for this package.
443 #:tests? #f
444 #:import-path "github.com/smartystreets/gunit"))
445 (synopsis "Testing tool for Go, in the style of xUnit")
446 (description
447 "@code{gunit} allows the test author to use a struct as the scope for a
448 group of related test cases, in the style of xUnit fixtures. This makes
449 extraction of setup/teardown behavior (as well as invoking the system under
450 test) much simpler.")
451 (home-page "https://github.com/smartystreets/gunit")
452 (license license:expat)))
453
454 (define-public go-github.com-smartystreets-assertions
455 (package
456 (name "go-github.com-smartystreets-assertions")
457 (version "1.8.1")
458 (source (origin
459 (method git-fetch)
460 (uri (git-reference
461 (url "https://github.com/smartystreets/assertions")
462 (commit version)))
463 (file-name (git-file-name name version))
464 (sha256
465 (base32
466 "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
467 (build-system go-build-system)
468 (arguments
469 '(#:import-path "github.com/smartystreets/assertions"))
470 (native-inputs
471 `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
472 (synopsis "Assertions for testing with Go")
473 (description
474 "The @code{assertions} package provides convenient assertion functions
475 for writing tests in Go.")
476 (home-page "https://github.com/smartystreets/assertions")
477 (license license:expat)))
478
479 (define-public go-github.com-smartystreets-goconvey
480 (package
481 (name "go-github.com-smartystreets-goconvey")
482 (version "1.6.3")
483 (source (origin
484 (method git-fetch)
485 (uri (git-reference
486 (url "https://github.com/smartystreets/goconvey")
487 (commit version)))
488 (file-name (git-file-name name version))
489 (sha256
490 (base32
491 "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
492 (build-system go-build-system)
493 (arguments
494 '(#:import-path "github.com/smartystreets/goconvey"))
495 (propagated-inputs
496 `(("go-github.com-jtolds-gls" ,go-github.com-jtolds-gls)
497 ("go-github.com-smartystreets-assertions" ,go-github.com-smartystreets-assertions)))
498 (synopsis "Go testing tool with both a web and terminal user interface")
499 (description
500 "GoConvey is a testing tool for Go. It integrates with go test, can show
501 test coverage and has a web user interface that will refresh automatically.")
502 (home-page "https://github.com/smartystreets/goconvey")
503 (license license:expat)))
504
505 (define-public googletest
506 (package
507 (name "googletest")
508 (version "1.8.1")
509 (source
510 (origin
511 (method git-fetch)
512 (uri (git-reference
513 (url "https://github.com/google/googletest.git")
514 (commit (string-append "release-" version))))
515 (file-name (git-file-name name version))
516 (sha256
517 (base32 "0270msj6n7mggh4xqqjp54kswbl7mkcc8px1p5dqdpmw5ngh9fzk"))))
518 (build-system cmake-build-system)
519 (arguments
520 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
521 (native-inputs
522 `(("python" ,python-wrapper)))
523 (home-page "https://github.com/google/googletest/")
524 (synopsis "Test discovery and XUnit test framework")
525 (description "Google Test features an XUnit test framework, automated test
526 discovery, death tests, assertions, parameterized tests and XML test report
527 generation.")
528 (license license:bsd-3)))
529
530 (define-public cpputest
531 (package
532 (name "cpputest")
533 (version "3.8")
534 (source
535 (origin
536 (method url-fetch)
537 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
538 version "/cpputest-" version ".tar.gz"))
539 (sha256
540 (base32
541 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
542 (build-system gnu-build-system)
543 (native-inputs
544 `(("googletest" ,googletest)))
545 (home-page "https://cpputest.github.io/")
546 (synopsis "Unit testing and mocking framework for C/C++")
547 (description
548 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
549 C++ but is used in C and C++ projects and frequently used in embedded systems
550 but it works for any C/C++ project.")
551 (license license:bsd-3)))
552
553 (define-public python-parameterized
554 (package
555 (name "python-parameterized")
556 (version "0.6.1")
557 (source
558 (origin
559 (method url-fetch)
560 (uri (pypi-uri "parameterized" version))
561 (sha256
562 (base32
563 "1qj1939shm48d9ql6fm1nrdy4p7sdyj8clz1szh5swwpf1qqxxfa"))))
564 (build-system python-build-system)
565 (arguments '(#:tests? #f)) ; there are no tests
566 (home-page "https://github.com/wolever/parameterized")
567 (synopsis "Parameterized testing with any Python test framework")
568 (description
569 "Parameterized is a Python library that aims to fix parameterized testing
570 for every Python test framework. It supports nose, py.test, and unittest.")
571 (license license:bsd-2)))
572
573 (define-public python2-parameterized
574 (package-with-python2 python-parameterized))
575
576 (define-public python-minimock
577 (package
578 (name "python-minimock")
579 (version "1.2.8")
580 (source
581 (origin
582 (method url-fetch)
583 (uri (pypi-uri "MiniMock" version))
584 (sha256
585 (base32
586 "0k2sxb1ibnyg05iblz7zhbv825f1zk9906rab7883iqgvzmdzpsz"))))
587 (build-system python-build-system)
588 (home-page "https://pypi.org/project/MiniMock")
589 (synopsis "Simple Python library for using mock objects")
590 (description "MiniMock is a simple library for building mock objects with
591 doctest.")
592 (license license:expat)))
593
594 (define-public python2-minimock
595 (package-with-python2 python-minimock))
596
597 (define-public python-mock
598 (package
599 (name "python-mock")
600 (version "2.0.0")
601 (source
602 (origin
603 (method url-fetch)
604 (uri (pypi-uri "mock" version))
605 (sha256
606 (base32
607 "1flbpksir5sqrvq2z0dp8sl4bzbadg21sj4d42w3klpdfvgvcn5i"))))
608 (propagated-inputs
609 `(("python-pbr" ,python-pbr-minimal)
610 ("python-six" ,python-six)))
611 (build-system python-build-system)
612 (native-inputs
613 `(("python-unittest2" ,python-unittest2)))
614 (arguments
615 `(#:phases
616 (modify-phases %standard-phases
617 (replace 'check
618 (lambda _
619 (zero? (system* "unit2")))))))
620 (home-page "https://github.com/testing-cabal/mock")
621 (synopsis "Python mocking and patching library for testing")
622 (description
623 "Mock is a library for testing in Python. It allows you to replace parts
624 of your system under test with mock objects and make assertions about how they
625 have been used.")
626 (properties `((python2-variant . ,(delay python2-mock))))
627 (license license:expat)))
628
629 (define-public python2-mock
630 (let ((base (package-with-python2
631 (strip-python2-variant python-mock))))
632 (package (inherit base)
633 (propagated-inputs
634 `(("python2-functools32" ,python2-functools32)
635 ("python2-funcsigs" ,python2-funcsigs)
636 ,@(package-propagated-inputs base))))))
637
638 (define-public python-nose
639 (package
640 (name "python-nose")
641 (version "1.3.7")
642 (source
643 (origin
644 (method url-fetch)
645 (uri (pypi-uri "nose" version))
646 (sha256
647 (base32
648 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
649 (build-system python-build-system)
650 (arguments
651 '(#:tests? #f)) ; FIXME: test suite fails
652 (home-page "http://readthedocs.org/docs/nose/")
653 (synopsis "Python testing library")
654 (description
655 "Nose extends the unittest library to make testing easier.")
656 (license license:lgpl2.0+)))
657
658 (define-public python2-nose
659 (package-with-python2 python-nose))
660
661 (define-public python-nose2
662 (package
663 (name "python-nose2")
664 (version "0.6.5")
665 (source
666 (origin
667 (method url-fetch)
668 (uri (pypi-uri "nose2" version))
669 (sha256
670 (base32
671 "1x4zjq1zlyrh8b9ba0cmafd3w94pxhid408kibyjd3s6h1lap6s7"))))
672 (build-system python-build-system)
673 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
674 (propagated-inputs
675 `(("python-cov-core" ,python-cov-core)
676 ("python-pytest-cov" ,python-pytest-cov)
677 ("python-six" ,python-six)))
678 (home-page "https://github.com/nose-devs/nose2")
679 (synopsis "Next generation of nicer testing for Python")
680 (description
681 "Nose2 is the next generation of nicer testing for Python, based on the
682 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
683 better plugin api, being easier for users to configure, and simplifying internal
684 interfaces and processes.")
685 (license license:bsd-2)))
686
687 (define-public python2-nose2
688 (package-with-python2 python-nose2))
689
690 (define-public python-unittest2
691 (package
692 (name "python-unittest2")
693 (version "1.1.0")
694 (source
695 (origin
696 (method url-fetch)
697 (uri (pypi-uri "unittest2" version))
698 (patches
699 (search-patches "python-unittest2-python3-compat.patch"
700 "python-unittest2-remove-argparse.patch"))
701 (sha256
702 (base32
703 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
704 (build-system python-build-system)
705 (arguments
706 '(#:phases
707 (modify-phases %standard-phases
708 (replace 'check
709 (lambda _
710 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
711 (propagated-inputs
712 `(("python-six" ,python-six)
713 ("python-traceback2" ,python-traceback2)))
714 (home-page "http://pypi.python.org/pypi/unittest2")
715 (synopsis "Python unit testing library")
716 (description
717 "Unittest2 is a replacement for the unittest module in the Python
718 standard library.")
719 (license license:psfl)))
720
721 (define-public python2-unittest2
722 (package-with-python2 python-unittest2))
723
724 (define-public python-pytest
725 (package
726 (name "python-pytest")
727 (version "4.4.2")
728 (source
729 (origin
730 (method url-fetch)
731 (uri (pypi-uri "pytest" version))
732 (sha256
733 (base32
734 "18w38kjnffdcrlbw6ny6dksgxai6x9bxpjs2m6klqmb8hfzjkcb2"))))
735 (build-system python-build-system)
736 (arguments
737 `(#:phases
738 (modify-phases %standard-phases
739 (replace 'check
740 (lambda _
741 (invoke "pytest" "-vv" "-k"
742 (string-append
743 ;; These tests involve the /usr directory, and fails.
744 "not test_remove_dir_prefix"
745 " and not test_argcomplete"
746 ;; This test tries to override PYTHONPATH, and
747 ;; subsequently fails to locate the test libraries.
748 " and not test_collection")))))))
749 (propagated-inputs
750 `(("python-atomicwrites" ,python-atomicwrites)
751 ("python-attrs" ,python-attrs-bootstrap)
752 ("python-more-itertools" ,python-more-itertools)
753 ("python-pluggy" ,python-pluggy)
754 ("python-py" ,python-py)
755 ("python-six" ,python-six-bootstrap)))
756 (native-inputs
757 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
758 ("bash" ,bash)
759 ("python-hypothesis" ,python-hypothesis)
760 ("python-nose" ,python-nose)
761 ("python-mock" ,python-mock)
762 ("python-pytest" ,python-pytest-bootstrap)
763 ("python-setuptools-scm" ,python-setuptools-scm)))
764 (home-page "https://docs.pytest.org/en/latest/")
765 (synopsis "Python testing library")
766 (description
767 "Pytest is a testing tool that provides auto-discovery of test modules
768 and functions, detailed info on failing assert statements, modular fixtures,
769 and many external plugins.")
770 (license license:expat)
771 (properties `((python2-variant . ,(delay python2-pytest))))))
772
773 (define-public python2-pytest
774 (let ((pytest (package-with-python2
775 (strip-python2-variant python-pytest))))
776 (package
777 (inherit pytest)
778 (propagated-inputs
779 `(("python2-funcsigs" ,python2-funcsigs)
780 ("python2-pathlib2" ,python2-pathlib2)
781 ,@(package-propagated-inputs pytest))))))
782
783 (define-public python-pytest-bootstrap
784 (package
785 (inherit (strip-python2-variant python-pytest))
786 (name "python-pytest-bootstrap")
787 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
788 (arguments `(#:tests? #f))
789 (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
790
791 (define-public python2-pytest-bootstrap
792 (let ((pytest (package-with-python2
793 (strip-python2-variant python-pytest-bootstrap))))
794 (package (inherit pytest)
795 (propagated-inputs
796 `(("python2-funcsigs" ,python2-funcsigs-bootstrap)
797 ("python2-pathlib2" ,python2-pathlib2-bootstrap)
798 ,@(package-propagated-inputs pytest))))))
799
800 (define-public python-pytest-cov
801 (package
802 (name "python-pytest-cov")
803 (version "2.6.1")
804 (source
805 (origin
806 (method url-fetch)
807 (uri (pypi-uri "pytest-cov" version))
808 (sha256
809 (base32 "0cyxbbghx2l4p60w10k00j1j74q1ngfiffr0pxn73ababjr69dha"))))
810 (build-system python-build-system)
811 (arguments
812 `(#:phases
813 (modify-phases %standard-phases
814 (replace 'check
815 (lambda _
816 ;; Options taken from tox.ini.
817 ;; TODO: make "--restructuredtext" tests pass. They currently fail
818 ;; with "Duplicate implicit target name".
819 (invoke "python" "./setup.py" "check"
820 "--strict" "--metadata"))))))
821 (propagated-inputs
822 `(("python-coverage" ,python-coverage)
823 ("python-pytest" ,python-pytest)))
824 (home-page "https://github.com/pytest-dev/pytest-cov")
825 (synopsis "Pytest plugin for measuring coverage")
826 (description
827 "Pytest-cov produces coverage reports. It supports centralised testing and
828 distributed testing in both @code{load} and @code{each} modes. It also
829 supports coverage of subprocesses.")
830 (license license:expat)))
831
832 (define-public python2-pytest-cov
833 (package-with-python2 python-pytest-cov))
834
835 (define-public python-pytest-runner
836 (package
837 (name "python-pytest-runner")
838 (version "4.4")
839 (source
840 (origin
841 (method url-fetch)
842 (uri (pypi-uri "pytest-runner" version))
843 (sha256
844 (base32
845 "1x0d9n40lsiphblbs61rdc0d5r31f6vh0vcahqdv0mffakbnrb80"))))
846 (build-system python-build-system)
847 (native-inputs
848 `(("python-pytest" ,python-pytest-bootstrap)
849 ("python-setuptools-scm" ,python-setuptools-scm)))
850 (home-page "https://github.com/pytest-dev/pytest-runner")
851 (synopsis "Invoke py.test as a distutils command")
852 (description
853 "This package provides a @command{pytest-runner} command that
854 @file{setup.py} files can use to run tests.")
855 (license license:expat)))
856
857 (define-public python2-pytest-runner
858 (package-with-python2 python-pytest-runner))
859
860 ;; python-bleach 3.1.0 requires this ancient version of pytest-runner.
861 ;; Remove once no longer needed.
862 (define-public python-pytest-runner-2
863 (package/inherit
864 python-pytest-runner
865 (version "2.12.2")
866 (source (origin
867 (method url-fetch)
868 (uri (pypi-uri "pytest-runner" version))
869 (sha256
870 (base32
871 "11ivjj9hfphkv4yfb2g74av4yy86y8gcbf7gbif0p1hcdfnxg3w6"))))))
872
873 (define-public python2-pytest-runner-2
874 (package-with-python2 python-pytest-runner-2))
875
876 (define-public python-pytest-mock
877 (package
878 (name "python-pytest-mock")
879 (version "1.10.1")
880 (source
881 (origin
882 (method url-fetch)
883 (uri (pypi-uri "pytest-mock" version))
884 (sha256
885 (base32
886 "1i5mg3ff1qk0wqfcxfz60hwy3q5dskdp36i10ckigkzffg8hc3ad"))))
887 (build-system python-build-system)
888 (native-inputs
889 `(("python-setuptools-scm" ,python-setuptools-scm)))
890 (propagated-inputs
891 `(("python-pytest" ,python-pytest)))
892 (home-page "https://github.com/pytest-dev/pytest-mock/")
893 (synopsis "Thin-wrapper around the mock package for easier use with py.test")
894 (description
895 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
896 around the patching API provided by the @code{mock} package, but with the
897 benefit of not having to worry about undoing patches at the end of a test.
898 The mocker fixture has the same API as @code{mock.patch}, supporting the
899 same arguments.")
900 (properties `((python2-variant . ,(delay python2-pytest-mock))))
901 (license license:expat)))
902
903 (define-public python2-pytest-mock
904 (let ((base (package-with-python2
905 (strip-python2-variant python-pytest-mock))))
906 (package (inherit base)
907 (propagated-inputs
908 `(("python2-mock" ,python2-mock)
909 ,@(package-propagated-inputs base))))))
910
911 (define-public python-pytest-xdist
912 (package
913 (name "python-pytest-xdist")
914 (version "1.25.0")
915 (source
916 (origin
917 (method url-fetch)
918 (uri (pypi-uri "pytest-xdist" version))
919 (sha256
920 (base32
921 "1d812apvcmshh2l8f38spqwb3bpp0x43yy7lyfpxxzc99h4r7y4n"))
922 (modules '((guix build utils)))
923 (snippet
924 '(begin
925 ;; Remove pre-compiled .pyc files from source.
926 (for-each delete-file-recursively
927 (find-files "." "__pycache__" #:directories? #t))
928 (for-each delete-file (find-files "." "\\.pyc$"))
929 #t))))
930 (build-system python-build-system)
931 (arguments
932 '(#:tests? #f)) ;FIXME: Some tests are failing.
933 ;; #:phases
934 ;; (modify-phases %standard-phases
935 ;; (delete 'check)
936 ;; (add-after 'install 'check
937 ;; (lambda* (#:key inputs outputs #:allow-other-keys)
938 ;; (add-installed-pythonpath inputs outputs)
939 ;; (zero? (system* "py.test" "-v")))))
940 (native-inputs
941 `(("python-setuptools-scm" ,python-setuptools-scm)))
942 (propagated-inputs
943 `(("python-execnet" ,python-execnet)
944 ("python-pytest" ,python-pytest)
945 ("python-py" ,python-py)))
946 (home-page
947 "https://github.com/pytest-dev/pytest-xdist")
948 (synopsis
949 "Plugin for py.test with distributed testing and loop-on-failing modes")
950 (description
951 "The pytest-xdist plugin extends py.test with some unique test execution
952 modes: parallelization, running tests in boxed subprocesses, the ability
953 to run tests repeatedly when failed, and the ability to run tests on multiple
954 Python interpreters or platforms. It uses rsync to copy the existing
955 program code to a remote location, executes there, and then syncs the
956 result back.")
957 (license license:expat)))
958
959 (define-public python2-pytest-xdist
960 (package-with-python2 python-pytest-xdist))
961
962 (define-public python-pytest-timeout
963 (package
964 (name "python-pytest-timeout")
965 (version "1.3.3")
966 (source
967 (origin
968 (method url-fetch)
969 (uri (pypi-uri "pytest-timeout" version))
970 (sha256
971 (base32
972 "1cczcjhw4xx5sjkhxlhc5c1bkr7x6fcyx12wrnvwfckshdvblc2a"))))
973 (build-system python-build-system)
974 (propagated-inputs
975 `(("python-pytest" ,python-pytest)))
976 (home-page "http://bitbucket.org/pytest-dev/pytest-timeout/")
977 (synopsis "Plugin for py.test to abort hanging tests")
978 (description
979 "This package provides a py.test plugin that aborts hanging tests after a
980 timeout has been exceeded.")
981 (license license:expat)))
982
983 (define-public python-scripttest
984 (package
985 (name "python-scripttest")
986 (version "1.3")
987 (source
988 (origin
989 (method url-fetch)
990 (uri (pypi-uri "scripttest" version))
991 (sha256
992 (base32
993 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
994 (build-system python-build-system)
995 (native-inputs
996 `(("python-pytest" ,python-pytest)))
997 (home-page "http://pythonpaste.org/scripttest/")
998 (synopsis "Python library to test command-line scripts")
999 (description "Scripttest is a Python helper library for testing
1000 interactive command-line applications. With it you can run a script in a
1001 subprocess and see the output as well as any file modifications.")
1002 (license license:expat)))
1003
1004 (define-public python2-scripttest
1005 (package-with-python2 python-scripttest))
1006
1007 (define-public python-testtools-bootstrap
1008 (package
1009 (name "python-testtools-bootstrap")
1010 (version "2.3.0")
1011 (source
1012 (origin
1013 (method url-fetch)
1014 (uri (pypi-uri "testtools" version))
1015 (sha256
1016 (base32
1017 "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
1018 (patches (search-patches "python-testtools.patch"))))
1019 (build-system python-build-system)
1020 (arguments '(#:tests? #f))
1021 (propagated-inputs
1022 `(("python-extras" ,python-extras)
1023 ("python-fixtures" ,python-fixtures-bootstrap)
1024 ("python-mimeparse" ,python-mimeparse)
1025 ("python-pbr" ,python-pbr-minimal)
1026 ("python-six" ,python-six)
1027 ("python-traceback2" ,python-traceback2)
1028 ("python-unittest2" ,python-unittest2)))
1029 (home-page "https://github.com/testing-cabal/testtools")
1030 (synopsis
1031 "Extensions to the Python standard library unit testing framework")
1032 (description
1033 "This package is only for bootstrapping. Do not use this.")
1034 (license license:psfl)))
1035
1036 (define-public python2-testtools-bootstrap
1037 (package-with-python2 python-testtools-bootstrap))
1038
1039 (define-public python-testtools
1040 (package
1041 (inherit python-testtools-bootstrap)
1042 (name "python-testtools")
1043 (arguments
1044 `(#:phases (modify-phases %standard-phases
1045 (replace 'check
1046 (lambda _
1047 (invoke "python" "-m" "testtools.run"
1048 "testtools.tests.test_suite"))))))
1049 (propagated-inputs
1050 `(("python-extras" ,python-extras)
1051 ("python-fixtures" ,python-fixtures)
1052 ("python-mimeparse" ,python-mimeparse)
1053 ("python-pbr" ,python-pbr)
1054 ("python-six" ,python-six)
1055 ("python-traceback2" ,python-traceback2)
1056 ("python-unittest2" ,python-unittest2)))
1057 (native-inputs
1058 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
1059 (description
1060 "Testtools extends the Python standard library unit testing framework to
1061 provide matchers, more debugging information, and cross-Python
1062 compatibility.")))
1063
1064 (define-public python2-testtools
1065 (package-with-python2 python-testtools))
1066
1067 (define-public python-testscenarios-bootstrap
1068 (package
1069 (name "python-testscenarios-bootstrap")
1070 (version "0.5.0")
1071 (source
1072 (origin
1073 (method url-fetch)
1074 (uri (pypi-uri "testscenarios" version))
1075 (sha256
1076 (base32
1077 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
1078 (build-system python-build-system)
1079 (arguments
1080 `(#:phases (modify-phases %standard-phases
1081 (replace 'check
1082 (lambda _
1083 (invoke "python" "-m" "testtools.run"
1084 "testscenarios.test_suite"))))))
1085 (propagated-inputs
1086 `(("python-pbr" ,python-pbr-minimal)
1087 ("python-testtools" ,python-testtools-bootstrap)))
1088 (home-page "https://launchpad.net/testscenarios")
1089 (synopsis "Pyunit extension for dependency injection")
1090 (description
1091 "This package is only for bootstrapping. Don't use this.")
1092 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1093
1094 (define-public python2-testscenarios-bootstrap
1095 (package-with-python2 python-testscenarios-bootstrap))
1096
1097 (define-public python-testscenarios
1098 (package
1099 (inherit python-testscenarios-bootstrap)
1100 (name "python-testscenarios")
1101 (propagated-inputs
1102 `(("python-pbr" ,python-pbr)
1103 ("python-testtools" ,python-testtools)))
1104 (description
1105 "Testscenarios provides clean dependency injection for Python unittest
1106 style tests.")))
1107
1108 (define-public python2-testscenarios
1109 (package-with-python2 python-testscenarios))
1110
1111 ;; Testresources requires python-pbr at runtime, but pbr needs it for its
1112 ;; own tests. Hence this bootstrap variant.
1113 (define-public python-testresources-bootstrap
1114 (package
1115 (name "python-testresources-bootstrap")
1116 (version "2.0.1")
1117 (source (origin
1118 (method url-fetch)
1119 (uri (pypi-uri "testresources" version))
1120 (sha256
1121 (base32
1122 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
1123 (build-system python-build-system)
1124 (arguments '(#:tests? #f))
1125 (propagated-inputs
1126 `(("python-pbr" ,python-pbr-minimal)))
1127 (home-page "https://launchpad.net/testresources")
1128 (synopsis
1129 "Pyunit extension for managing test resources")
1130 (description
1131 "This package is only here for bootstrapping purposes. Use the regular
1132 testresources package instead.")
1133 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1134
1135 (define-public python2-testresources-bootstrap
1136 (package-with-python2 python-testresources-bootstrap))
1137
1138 (define-public python-testresources
1139 (package
1140 (inherit python-testresources-bootstrap)
1141 (name "python-testresources")
1142 (propagated-inputs
1143 `(("python-pbr" ,python-pbr)))
1144 (arguments '())
1145 (native-inputs
1146 `(("python-fixtures" ,python-fixtures)
1147 ("python-testtols" ,python-testtools)))
1148 (description
1149 "Testresources is an extension to Python's unittest to allow declarative
1150 use of resources by test cases.")))
1151
1152 (define-public python2-testresources
1153 (package-with-python2 python-testresources))
1154
1155 (define-public python-subunit-bootstrap
1156 (package
1157 (name "python-subunit-bootstrap")
1158 (version "1.3.0")
1159 (source
1160 (origin
1161 (method url-fetch)
1162 (uri (pypi-uri "python-subunit" version))
1163 (sha256
1164 (base32
1165 "1fsw8rsn1s3nklx06mayrg5rn2zbky6wwjc5z07s7rf1wjzfs1wn"))))
1166 (build-system python-build-system)
1167 (propagated-inputs
1168 `(("python-extras" ,python-extras)
1169 ("python-testtools" ,python-testtools-bootstrap)))
1170 (native-inputs
1171 `(("python-fixtures" ,python-fixtures-bootstrap)
1172 ("python-hypothesis" ,python-hypothesis)
1173 ("python-testscenarios" ,python-testscenarios-bootstrap)))
1174 (home-page "https://launchpad.net/subunit")
1175 (synopsis "Python implementation of the subunit protocol")
1176 (description
1177 "This package is here for bootstrapping purposes only. Use the regular
1178 python-subunit package instead.")
1179 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1180
1181 (define-public python2-subunit-bootstrap
1182 (package-with-python2 python-subunit-bootstrap))
1183
1184 (define-public python-subunit
1185 (package
1186 (inherit python-subunit-bootstrap)
1187 (name "python-subunit")
1188 (propagated-inputs
1189 `(("python-extras" ,python-extras)
1190 ("python-testtools" ,python-testtools)))
1191 (native-inputs
1192 `(("python-fixtures" ,python-fixtures)
1193 ("python-hypothesis" ,python-hypothesis)
1194 ("python-testscenarios" ,python-testscenarios)))
1195 (description
1196 "Python-subunit is a Python implementation of the subunit test streaming
1197 protocol.")))
1198
1199 (define-public python2-subunit
1200 (package-with-python2 python-subunit))
1201
1202 ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
1203 ;; own tests. Hence this bootstrap variant.
1204 (define-public python-fixtures-bootstrap
1205 (package
1206 (name "python-fixtures-bootstrap")
1207 (version "3.0.0")
1208 (source (origin
1209 (method url-fetch)
1210 (uri (pypi-uri "fixtures" version))
1211 (sha256
1212 (base32
1213 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
1214 (build-system python-build-system)
1215 (arguments `(#:tests? #f))
1216 (propagated-inputs
1217 `(("python-pbr-minimal" ,python-pbr-minimal)
1218 ("python-six" ,python-six)))
1219 (home-page "https://launchpad.net/python-fixtures")
1220 (synopsis "Python test fixture library")
1221 (description
1222 "This package is only used for bootstrapping. Use the regular
1223 python-fixtures package instead.")
1224 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1225
1226 (define-public python2-fixtures-bootstrap
1227 (package-with-python2 python-fixtures-bootstrap))
1228
1229 (define-public python-fixtures
1230 (package
1231 (inherit python-fixtures-bootstrap)
1232 (name "python-fixtures")
1233 (arguments
1234 '(#:phases
1235 (modify-phases %standard-phases
1236 (replace 'check
1237 (lambda _
1238 (invoke "python" "-m" "testtools.run"
1239 "fixtures.test_suite"))))))
1240 (propagated-inputs
1241 ;; Fixtures uses pbr at runtime to check versions, etc.
1242 `(("python-pbr" ,python-pbr)
1243 ("python-six" ,python-six)))
1244 (native-inputs
1245 `(("python-mock" ,python-mock)
1246 ("python-testtools" ,python-testtools-bootstrap)))
1247 (description
1248 "Fixtures provides a way to create reusable state, useful when writing
1249 Python tests.")))
1250
1251 (define-public python2-fixtures
1252 (package-with-python2 python-fixtures))
1253
1254 (define-public python-testrepository-bootstrap
1255 (package
1256 (name "python-testrepository-bootstrap")
1257 (version "0.0.20")
1258 (source
1259 (origin
1260 (method url-fetch)
1261 (uri (pypi-uri "testrepository" version))
1262 (sha256
1263 (base32
1264 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1265 (build-system python-build-system)
1266 (arguments '(#:tests? #f))
1267 (propagated-inputs
1268 `(("python-fixtures" ,python-fixtures-bootstrap)
1269 ("python-subunit" ,python-subunit-bootstrap)
1270 ("python-testtools" ,python-testtools-bootstrap)))
1271 (native-inputs
1272 `(("python-mimeparse" ,python-mimeparse)))
1273 (home-page "https://launchpad.net/testrepository")
1274 (synopsis "Database for Python test results")
1275 (description
1276 "Bootstrap package for python-testrepository. Don't use this.")
1277 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1278
1279 (define-public python2-testrepository-bootstrap
1280 (package-with-python2 python-testrepository-bootstrap))
1281
1282 (define-public python-testrepository
1283 (package
1284 (inherit python-testrepository-bootstrap)
1285 (name "python-testrepository")
1286 (arguments
1287 ;; FIXME: Many tests are failing.
1288 '(#:tests? #f))
1289 (propagated-inputs
1290 `(("python-fixtures" ,python-fixtures)
1291 ("python-subunit" ,python-subunit)
1292 ("python-testtools" ,python-testtools)))
1293 (native-inputs
1294 `(("python-mimeparse" ,python-mimeparse)))
1295 (description "Testrepository provides a database of test results which can
1296 be used as part of a developer's workflow to check things such as what tests
1297 have failed since the last commit or what tests are currently failing.")))
1298
1299 (define-public python2-testrepository
1300 (package-with-python2 python-testrepository))
1301
1302 (define-public python-coverage
1303 (package
1304 (name "python-coverage")
1305 (version "4.5.3")
1306 (source
1307 (origin
1308 (method url-fetch)
1309 (uri (pypi-uri "coverage" version))
1310 (sha256
1311 (base32
1312 "02f6m073qdispn96rc616hg0rnmw1pgqzw3bgxwiwza4zf9hirlx"))))
1313 (build-system python-build-system)
1314 (arguments
1315 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1316 '(#:tests? #f))
1317 (home-page "http://nedbatchelder.com/code/coverage")
1318 (synopsis "Code coverage measurement for Python")
1319 (description
1320 "Coverage measures code coverage, typically during test execution. It
1321 uses the code analysis tools and tracing hooks provided in the Python standard
1322 library to determine which lines are executable, and which have been
1323 executed.")
1324 (license license:bsd-3)))
1325
1326 (define-public python2-coverage
1327 (package-with-python2 python-coverage))
1328
1329 (define-public python-cov-core
1330 (package
1331 (name "python-cov-core")
1332 (version "1.15.0")
1333 (source
1334 (origin
1335 (method url-fetch)
1336 (uri (pypi-uri "cov-core" version))
1337 (sha256
1338 (base32
1339 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1340 (build-system python-build-system)
1341 (propagated-inputs
1342 `(("python-coverage" ,python-coverage)))
1343 (home-page "https://github.com/schlamar/cov-core")
1344 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
1345 (description
1346 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1347 and @code{nose2-cov}. It is useful for developing coverage plugins for these
1348 testing frameworks.")
1349 (license license:expat)))
1350
1351 (define-public python2-cov-core
1352 (package-with-python2 python-cov-core))
1353
1354 (define-public python-codecov
1355 (package
1356 (name "python-codecov")
1357 (version "2.0.15")
1358 (source
1359 (origin
1360 (method url-fetch)
1361 (uri (pypi-uri "codecov" version))
1362 (sha256
1363 (base32
1364 "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1365 (build-system python-build-system)
1366 (native-inputs
1367 `(("python-unittest2" ,python-unittest2)))
1368 (propagated-inputs
1369 `(("python-coverage" ,python-coverage)
1370 ("python-requests" ,python-requests)))
1371 (home-page "http://github.com/codecov/codecov-python")
1372 (synopsis "Upload code coverage reports to @code{codecov.io}")
1373 (description
1374 "Codecov collects code coverage reports from code written in Python, Java,
1375 C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
1376 (license license:asl2.0)))
1377
1378 (define-public python-testpath
1379 (package
1380 (name "python-testpath")
1381 (version "0.2")
1382 (source
1383 (origin
1384 (method git-fetch)
1385 (uri (git-reference
1386 (url "https://github.com/jupyter/testpath")
1387 (commit version)))
1388 (file-name (git-file-name name version))
1389 (sha256
1390 (base32
1391 "0r4iiizjql6ny1ln7ciw7rrbjadz1s9zrf2hl0xkgnh3ypd8936f"))))
1392 (build-system python-build-system)
1393 (arguments
1394 `(#:tests? #f ; this package does not even have a setup.py
1395 #:modules ((guix build python-build-system)
1396 (guix build utils)
1397 (srfi srfi-1))
1398 #:imported-modules (,@%python-build-system-modules
1399 (srfi srfi-1))
1400 #:phases
1401 (modify-phases %standard-phases
1402 (delete 'install)
1403 (replace 'build
1404 (lambda* (#:key inputs outputs #:allow-other-keys)
1405 (let* ((version (last
1406 (string-split (assoc-ref inputs "python") #\-)))
1407 (x.y (string-join (take (string-split version #\.) 2)
1408 "."))
1409 (dir (string-append
1410 (assoc-ref outputs "out")
1411 "/lib/python" x.y "/site-packages/testpath")))
1412 (mkdir-p dir)
1413 (copy-recursively "testpath" dir))
1414 #t)))))
1415 (home-page "https://github.com/takluyver/testpath")
1416 (synopsis "Test utilities for code working with files and commands")
1417 (description
1418 "Testpath is a collection of utilities for Python code working with files
1419 and commands. It contains functions to check things on the file system, and
1420 tools for mocking system commands and recording calls to those.")
1421 (license license:expat)))
1422
1423 (define-public python2-testpath
1424 (package-with-python2 python-testpath))
1425
1426 (define-public python-testlib
1427 (package
1428 (name "python-testlib")
1429 (version "0.6.5")
1430 (source
1431 (origin
1432 (method url-fetch)
1433 (uri (pypi-uri "testlib" version ".zip"))
1434 (sha256
1435 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1436 (build-system python-build-system)
1437 (native-inputs
1438 `(("unzip" ,unzip))) ; for unpacking the source
1439 (synopsis "Python micro test suite harness")
1440 (description "A micro unittest suite harness for Python.")
1441 (home-page "https://github.com/trentm/testlib")
1442 (license license:expat)))
1443
1444 (define-public python2-testlib
1445 (package-with-python2 python-testlib))
1446
1447 ;;; The software provided by this package was integrated into pytest 2.8.
1448 (define-public python-pytest-cache
1449 (package
1450 (name "python-pytest-cache")
1451 (version "1.0")
1452 (source (origin
1453 (method url-fetch)
1454 (uri (pypi-uri "pytest-cache" version))
1455 (sha256
1456 (base32
1457 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1458 (build-system python-build-system)
1459 (propagated-inputs
1460 `(("python-apipkg" ,python-apipkg)
1461 ("python-execnet" ,python-execnet)
1462 ("python-py" ,python-py)
1463 ("python-pytest" ,python-pytest)))
1464 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1465 (description "The pytest-cache plugin provides tools to rerun failures from
1466 the last py.test invocation.")
1467 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1468 (license license:expat)))
1469
1470 (define-public python2-pytest-cache
1471 (package-with-python2 python-pytest-cache))
1472
1473 (define-public python-pytest-localserver
1474 (package
1475 (name "python-pytest-localserver")
1476 (version "0.5.0")
1477 (source (origin
1478 (method url-fetch)
1479 (uri (pypi-uri "pytest-localserver" version))
1480 (sha256
1481 (base32
1482 "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
1483 (build-system python-build-system)
1484 (arguments
1485 '(#:phases
1486 (modify-phases %standard-phases
1487 (replace 'check
1488 (lambda _
1489 (invoke "py.test" "-v"))))))
1490 (native-inputs
1491 `(("python-pytest" ,python-pytest)
1492 ("python-requests" ,python-requests)
1493 ("python-six" ,python-six)))
1494 (propagated-inputs
1495 `(("python-werkzeug" ,python-werkzeug)))
1496 (synopsis "Py.test plugin to test server connections locally")
1497 (description "Pytest-localserver is a plugin for the pytest testing
1498 framework which enables you to test server connections locally.")
1499 (home-page "https://pypi.python.org/pypi/pytest-localserver")
1500 (license license:expat)))
1501
1502 (define-public python-pytest-xprocess
1503 (package
1504 (name "python-pytest-xprocess")
1505 (version "0.9.1")
1506 (source (origin
1507 (method url-fetch)
1508 (uri (pypi-uri "pytest-xprocess" version))
1509 (sha256
1510 (base32
1511 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1512 (build-system python-build-system)
1513 (propagated-inputs
1514 `(("python-pytest" ,python-pytest)
1515 ("python-pytest-cache" ,python-pytest-cache)
1516 ("python-psutil" ,python-psutil)))
1517 (synopsis "Pytest plugin to manage external processes across test runs")
1518 (description "Pytest-xprocess is an experimental py.test plugin for managing
1519 processes across test runs.")
1520 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1521 (license license:expat)))
1522
1523 (define-public python-pytest-subtesthack
1524 (package
1525 (name "python-pytest-subtesthack")
1526 (version "0.1.1")
1527 (source (origin
1528 (method url-fetch)
1529 (uri (pypi-uri "pytest-subtesthack" version))
1530 (sha256
1531 (base32
1532 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1533 (build-system python-build-system)
1534 (propagated-inputs
1535 `(("python-pytest" ,python-pytest)))
1536 (synopsis "Set-up and tear-down fixtures for unit tests")
1537 (description "This plugin allows you to set up and tear down fixtures within
1538 unit test functions that use @code{py.test}. This is useful for using
1539 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1540 function multiple times, without setting up or tearing down fixture state as is
1541 normally the case.")
1542 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1543 (license license:unlicense)))
1544
1545 (define-public python2-pytest-subtesthack
1546 (package-with-python2 python-pytest-subtesthack))
1547
1548 (define-public python-pytest-sugar
1549 (package
1550 (name "python-pytest-sugar")
1551 (version "0.9.2")
1552 (source
1553 (origin
1554 (method url-fetch)
1555 (uri (pypi-uri "pytest-sugar" version))
1556 (sha256
1557 (base32
1558 "1asq7yc4g8bx2sn7yy974mhc9ywvaihasjab4inkirdwn9s7mn7w"))))
1559 (build-system python-build-system)
1560 (propagated-inputs
1561 `(("python-packaging" ,python-packaging)
1562 ("python-pytest" ,python-pytest)
1563 ("python-termcolor" ,python-termcolor)))
1564 (home-page "https://pivotfinland.com/pytest-sugar/")
1565 (synopsis "Plugin for pytest that changes the default look and feel")
1566 (description
1567 "@code{pytest-sugar} is a plugin for py.test that changes the default
1568 look and feel of py.test, using a progress bar and showing failures and errors
1569 instantly.")
1570 (license license:bsd-3)))
1571
1572 (define-public python-hypothesis
1573 (package
1574 (name "python-hypothesis")
1575 (version "4.18.3")
1576 (source (origin
1577 (method url-fetch)
1578 (uri (pypi-uri "hypothesis" version))
1579 (sha256
1580 (base32
1581 "0a35nwqyjnm4cphi43xracqpkws0ip61mndvqb1iqq7gkva83lb1"))))
1582 (build-system python-build-system)
1583 (native-inputs
1584 `(("python-flake8" ,python-flake8)
1585 ("python-pytest" ,python-pytest-bootstrap)))
1586 (propagated-inputs
1587 `(("python-attrs" ,python-attrs-bootstrap)
1588 ("python-coverage" ,python-coverage)))
1589 (synopsis "Library for property based testing")
1590 (description "Hypothesis is a library for testing your Python code against a
1591 much larger range of examples than you would ever want to write by hand. It’s
1592 based on the Haskell library, Quickcheck, and is designed to integrate
1593 seamlessly into your existing Python unit testing work flow.")
1594 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
1595 (license license:mpl2.0)
1596 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1597
1598 (define-public python2-hypothesis
1599 (let ((hypothesis (package-with-python2
1600 (strip-python2-variant python-hypothesis))))
1601 (package (inherit hypothesis)
1602 (propagated-inputs
1603 `(("python2-enum34" ,python2-enum34)
1604 ,@(package-propagated-inputs hypothesis))))))
1605
1606 (define-public python-lit
1607 (package
1608 (name "python-lit")
1609 (version "0.5.1")
1610 (source
1611 (origin
1612 (method url-fetch)
1613 (uri (pypi-uri "lit" version))
1614 (sha256
1615 (base32
1616 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
1617 (build-system python-build-system)
1618 (arguments
1619 `(#:phases
1620 (modify-phases %standard-phases
1621 (replace 'check
1622 (lambda _
1623 (invoke "python" "lit.py" "tests"))))))
1624 (native-inputs
1625 `(("llvm" ,llvm)))
1626 (home-page "https://llvm.org/")
1627 (synopsis "LLVM Software Testing Tool")
1628 (description "@code{lit} is a portable tool for executing LLVM and Clang
1629 style test suites, summarizing their results, and providing indication of
1630 failures.")
1631 (license license:ncsa)))
1632
1633 (define-public python2-lit
1634 (package-with-python2 python-lit))
1635
1636 (define-public python-pytest-pep8
1637 (package
1638 (name "python-pytest-pep8")
1639 (version "1.0.6")
1640 (source (origin
1641 (method url-fetch)
1642 (uri (pypi-uri "pytest-pep8" version))
1643 (sha256
1644 (base32
1645 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
1646 (build-system python-build-system)
1647 (arguments
1648 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
1649 (native-inputs
1650 `(("python-pytest" ,python-pytest)))
1651 (propagated-inputs
1652 `(("python-pep8" ,python-pep8)))
1653 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
1654 (synopsis "Py.test plugin to check PEP8 requirements")
1655 (description "Pytest plugin for checking PEP8 compliance.")
1656 (license license:expat)))
1657
1658 (define-public python2-pytest-pep8
1659 (package-with-python2 python-pytest-pep8))
1660
1661 (define-public python-pytest-flakes
1662 (package
1663 (name "python-pytest-flakes")
1664 (version "1.0.1")
1665 (source (origin
1666 (method url-fetch)
1667 (uri (pypi-uri "pytest-flakes" version))
1668 (sha256
1669 (base32
1670 "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
1671 (build-system python-build-system)
1672 (arguments
1673 `(#:phases
1674 (modify-phases %standard-phases
1675 (delete 'check)
1676 (add-after 'install 'check
1677 (lambda* (#:key outputs inputs #:allow-other-keys)
1678 ;; It's easier to run tests after install.
1679 ;; Make installed package available for running the tests
1680 (add-installed-pythonpath inputs outputs)
1681 (invoke "py.test" "-vv"))))))
1682 (native-inputs
1683 `(("python-coverage" ,python-coverage)
1684 ("python-pytest" ,python-pytest)
1685 ("python-pytest-cache" ,python-pytest-cache)
1686 ("python-pytest-pep8" ,python-pytest-pep8)))
1687 (propagated-inputs
1688 `(("python-pyflakes" ,python-pyflakes)))
1689 (home-page "https://github.com/fschulze/pytest-flakes")
1690 (synopsis "Py.test plugin to check source code with pyflakes")
1691 (description "Pytest plugin for checking Python source code with pyflakes.")
1692 (license license:expat)))
1693
1694 (define-public python2-pytest-flakes
1695 (package-with-python2 python-pytest-flakes))
1696
1697 (define-public python2-coverage-test-runner
1698 (package
1699 (name "python2-coverage-test-runner")
1700 (version "1.15")
1701 (source
1702 (origin
1703 (method url-fetch)
1704 (uri (string-append
1705 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
1706 "coverage-test-runner/snapshot/coverage-test-runner-"
1707 version ".tar.gz"))
1708 (sha256
1709 (base32
1710 "1kjjb9llckycnfxag8zcvqsn4z1s3dwyw6b1n0avxydihgf30rny"))))
1711 (build-system python-build-system)
1712 (arguments
1713 `(#:python ,python-2
1714 #:phases
1715 (modify-phases %standard-phases
1716 (replace 'check
1717 (lambda _
1718 (invoke "./testrun"))))))
1719 (propagated-inputs
1720 `(("python2-coverage" ,python2-coverage)))
1721 (home-page "https://liw.fi/coverage-test-runner/")
1722 (synopsis "Python module for running unit tests")
1723 (description "@code{CoverageTestRunner} is a python module for running
1724 unit tests and failing them if the unit test module does not exercise all
1725 statements in the module it tests.")
1726 (license license:gpl3+)))
1727
1728 ;; Further releases, up to 2.4.3, have failing unit tests. See:
1729 ;; https://github.com/PyCQA/pylint/issues/3198.
1730 (define-public python-pylint
1731 (package
1732 (name "python-pylint")
1733 (version "2.3.1")
1734 (source
1735 (origin
1736 (method git-fetch)
1737 (uri (git-reference
1738 (url "https://github.com/PyCQA/pylint")
1739 (commit (string-append "pylint-" version))))
1740 (file-name (git-file-name name version))
1741 (sha256
1742 (base32
1743 "17vvzbcqmkhr4icq5p3737nbiiyj1y3g1pa08n9mb1bsnvxmqq0z"))))
1744 (build-system python-build-system)
1745 (native-inputs
1746 `(("python-pytest" ,python-pytest)
1747 ("python-pytest-runner" ,python-pytest-runner)
1748 ("python-tox" ,python-tox)))
1749 (propagated-inputs
1750 `(("python-astroid" ,python-astroid)
1751 ("python-isort" ,python-isort)
1752 ("python-mccabe" ,python-mccabe)
1753 ("python-six" ,python-six)))
1754 (home-page "https://github.com/PyCQA/pylint")
1755 (synopsis "Python source code analyzer which looks for coding standard
1756 errors")
1757 (description "Pylint is a Python source code analyzer which looks
1758 for programming errors, helps enforcing a coding standard and sniffs
1759 for some code smells (as defined in Martin Fowler's Refactoring book).
1760
1761 Pylint has many rules enabled by default, way too much to silence them
1762 all on a minimally sized program. It's highly configurable and handle
1763 pragmas to control it from within your code. Additionally, it is
1764 possible to write plugins to add your own checks.")
1765 (properties `((python2-variant . ,(delay python2-pylint))))
1766 (license license:gpl2+)))
1767
1768 ;; Python2 is not supported anymore by Pylint. See:
1769 ;; https://github.com/PyCQA/pylint/issues/1763.
1770 (define-public python2-pylint
1771 (let ((pylint (package-with-python2
1772 (strip-python2-variant python-pylint))))
1773 (package (inherit pylint)
1774 (version "1.9.5")
1775 (source
1776 (origin
1777 (method git-fetch)
1778 (uri (git-reference
1779 (url "https://github.com/PyCQA/pylint")
1780 (commit (string-append "pylint-" version))))
1781 (file-name (git-file-name (package-name pylint) version))
1782 (sha256
1783 (base32
1784 "02a89d8a47s7nfiv1ady3j0sg2sbyja3np145brarfp5x9qxz9x2"))))
1785 (arguments
1786 `(,@(package-arguments pylint)
1787 #:phases
1788 (modify-phases %standard-phases
1789 (replace 'check
1790 (lambda _
1791 ;; Somehow, tests fail if run from the build directory.
1792 (let ((work "/tmp/work"))
1793 (mkdir-p work)
1794 (setenv "PYTHONPATH"
1795 (string-append (getenv "PYTHONPATH") ":" work))
1796 (copy-recursively "." work)
1797 (with-directory-excursion "/tmp"
1798 (invoke "python" "-m" "unittest" "discover"
1799 "-s" (string-append work "/pylint/test")
1800 "-p" "*test_*.py"))))))))
1801 (native-inputs
1802 `(("python2-futures" ,python2-futures)
1803 ,@(package-native-inputs pylint)))
1804 (propagated-inputs
1805 `(("python2-backports-functools-lru-cache"
1806 ,python2-backports-functools-lru-cache)
1807 ("python2-configparser" ,python2-configparser)
1808 ,@(package-propagated-inputs pylint))))))
1809
1810 (define-public python-paramunittest
1811 (package
1812 (name "python-paramunittest")
1813 (version "0.2")
1814 (source
1815 (origin
1816 (method url-fetch)
1817 (uri (pypi-uri "ParamUnittest" version))
1818 (sha256
1819 (base32
1820 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
1821 (build-system python-build-system)
1822 (home-page
1823 "https://github.com/rik0/ParamUnittest")
1824 (synopsis
1825 "Simple extension to have parametrized unit tests")
1826 (description
1827 "This package allows to create parametrized unit-tests that work with the standard
1828 unittest package. A parametrized test case is automatically converted to multiple test
1829 cases. Since they are TestCase subclasses, they work with other test suites that
1830 recognize TestCases.")
1831 (license license:bsd-2)))
1832
1833 (define-public python2-python-paramunittest
1834 (package-with-python2 python-paramunittest))
1835
1836 (define-public python-pytest-warnings
1837 (package
1838 (name "python-pytest-warnings")
1839 (version "0.2.0")
1840 (source
1841 (origin
1842 (method url-fetch)
1843 (uri (pypi-uri "pytest-warnings" version))
1844 (sha256
1845 (base32
1846 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
1847 (build-system python-build-system)
1848 (propagated-inputs
1849 `(("pytest" ,python-pytest)))
1850 (home-page "https://github.com/fschulze/pytest-warnings")
1851 (synopsis "Pytest plugin to list Python warnings in pytest report")
1852 (description
1853 "Python-pytest-warnings is a pytest plugin to list Python warnings in
1854 pytest report.")
1855 (license license:expat)
1856 (properties `((python2-variant . ,(delay python2-pytest-warnings))
1857 ;; This package is part of pytest as of version 3.1.0.
1858 (superseded . ,python-pytest)))))
1859
1860 (define-public python2-pytest-warnings
1861 (package (inherit (package-with-python2
1862 (strip-python2-variant python-pytest-warnings)))
1863 (properties `((superseded . ,python2-pytest)))))
1864
1865 (define-public python-pytest-capturelog
1866 (package
1867 (name "python-pytest-capturelog")
1868 (version "0.7")
1869 (source
1870 (origin
1871 (method url-fetch)
1872 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
1873 (sha256
1874 (base32
1875 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
1876 (build-system python-build-system)
1877 (propagated-inputs
1878 `(("pytest" ,python-pytest)))
1879 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
1880 (synopsis "Pytest plugin to catch log messages")
1881 (description
1882 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
1883 (license license:expat)))
1884
1885 (define-public python2-pytest-capturelog
1886 (package-with-python2 python-pytest-capturelog))
1887
1888 (define-public python-pytest-catchlog
1889 (package
1890 (name "python-pytest-catchlog")
1891 (version "1.2.2")
1892 (source
1893 (origin
1894 (method url-fetch)
1895 (uri (pypi-uri "pytest-catchlog" version ".zip"))
1896 (sha256
1897 (base32
1898 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
1899 (build-system python-build-system)
1900 (native-inputs
1901 `(("unzip" ,unzip)))
1902 (propagated-inputs
1903 `(("pytest" ,python-pytest)))
1904 (home-page "https://github.com/eisensheng/pytest-catchlog")
1905 (synopsis "Pytest plugin to catch log messages")
1906 (description
1907 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
1908 a fork of pytest-capturelog.")
1909 (license license:expat)))
1910
1911 (define-public python2-pytest-catchlog
1912 (package-with-python2 python-pytest-catchlog))
1913
1914 (define-public python-nosexcover
1915 (package
1916 (name "python-nosexcover")
1917 (version "1.0.11")
1918 (source (origin
1919 (method url-fetch)
1920 (uri (pypi-uri "nosexcover" version))
1921 (sha256
1922 (base32
1923 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
1924 (build-system python-build-system)
1925 (propagated-inputs
1926 `(("python-coverage" ,python-coverage)
1927 ("python-nose" ,python-nose)))
1928 (home-page "http://github.com/cmheisel/nose-xcover")
1929 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
1930 (description "Nose-xcover is a companion to the built-in
1931 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
1932 to a file named coverage.xml.
1933
1934 It will honor all the options you pass to the Nose coverage plugin,
1935 especially -cover-package.")
1936 (license license:expat)))
1937
1938 (define-public python2-nosexcover
1939 (package-with-python2 python-nosexcover))
1940
1941 (define-public python-discover
1942 (package
1943 (name "python-discover")
1944 (version "0.4.0")
1945 (source
1946 (origin
1947 (method url-fetch)
1948 (uri (pypi-uri "discover" version))
1949 (sha256
1950 (base32
1951 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
1952 (build-system python-build-system)
1953 (home-page "http://pypi.python.org/pypi/discover/")
1954 (synopsis
1955 "Python test discovery for unittest")
1956 (description
1957 "Discover provides test discovery for unittest, a feature that has been
1958 backported from Python 2.7 for Python 2.4+.")
1959 (license license:bsd-3)))
1960
1961 (define-public python2-discover
1962 (package-with-python2 python-discover))
1963
1964 (define-public behave
1965 (package
1966 (name "behave")
1967 (version "1.2.6")
1968 (source (origin
1969 (method url-fetch)
1970 (uri (pypi-uri "behave" version))
1971 (sha256
1972 (base32
1973 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))))
1974 (build-system python-build-system)
1975 (native-inputs
1976 `(("python-mock" ,python-mock)
1977 ("python-nose" ,python-nose)
1978 ("python-pathpy" ,python-pathpy)
1979 ("python-pyhamcrest" ,python-pyhamcrest)
1980 ("python-pytest" ,python-pytest)))
1981 (propagated-inputs
1982 `(("python-importlib-metadata" ,python-importlib-metadata)
1983 ("python-six" ,python-six)
1984 ("python-parse" ,python-parse)
1985 ("python-parse-type" ,python-parse-type)))
1986 (arguments
1987 '(#:test-target "behave_test"
1988 #:phases
1989 (modify-phases %standard-phases
1990 (add-before 'check 'fix-library-loading
1991 (lambda _
1992 ;; Otherwise, tests fail with no module named 'path'
1993 (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH") ":"
1994 (getcwd) "/tasks/_vendor"))
1995 #t)))))
1996 (home-page "https://github.com/behave/behave")
1997 (synopsis "Python behavior-driven development")
1998 (description
1999 "Behave is a tool for behavior-driven development in python.
2000 Behavior-driven development (or BDD) is an agile software development
2001 technique that encourages collaboration between developers, QA and
2002 non-technical or business participants in a software project. Behave uses
2003 tests written in a natural language style, backed up by Python code.")
2004 (license license:x11)))
2005
2006 (define-public python-behave-web-api
2007 (package
2008 (name "python-behave-web-api")
2009 (version "1.0.6")
2010 (source
2011 (origin
2012 (method url-fetch)
2013 (uri (pypi-uri "behave-web-api" version))
2014 (sha256
2015 (base32
2016 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
2017 (build-system python-build-system)
2018 (arguments
2019 `(#:phases
2020 (modify-phases %standard-phases
2021 (add-after 'unpack 'fix-dependencies
2022 (lambda _
2023 (substitute* "setup.py"
2024 (("'wheel'") "") ; We don't use it.
2025 (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
2026 #t)))))
2027 (propagated-inputs
2028 `(("behave" ,behave)
2029 ("python-requests" ,python-requests)))
2030 (home-page "https://github.com/jefersondaniel/behave-web-api")
2031 (synopsis "Provides testing for JSON APIs with Behave for Python")
2032 (description "This package provides testing utility modules for testing
2033 JSON APIs with Behave.")
2034 (license license:expat)))
2035
2036 (define-public python2-behave-web-api
2037 (package-with-python2 python-behave-web-api))
2038
2039 (define-public python-rednose
2040 (package
2041 (name "python-rednose")
2042 (version "1.2.3")
2043 (source
2044 (origin
2045 (method url-fetch)
2046 (uri (pypi-uri "rednose" version))
2047 (sha256
2048 (base32
2049 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
2050 (build-system python-build-system)
2051 (arguments
2052 `(#:phases (modify-phases %standard-phases
2053 (add-after 'unpack 'patch-setup.py
2054 (lambda _
2055 ;; Six is only required for tests and later versions
2056 ;; work fine.
2057 (substitute* "setup.py"
2058 (("six==1.10.0") "six"))
2059 #t)))))
2060 (propagated-inputs
2061 `(("python-colorama" ,python-colorama)
2062 ("python-termstyle" ,python-termstyle)))
2063 (native-inputs
2064 `(("python-six" ,python-six)
2065 ("python-nose" ,python-nose)))
2066 (home-page "https://github.com/JBKahn/rednose")
2067 (synopsis "Colored output for Python nosetests")
2068 (description "This package provides colored output for the
2069 @command{nosetests} command of the Python Nose unit test framework.")
2070 (license license:bsd-3)))
2071
2072 (define-public python2-rednose
2073 (package-with-python2 python-rednose))
2074
2075 (define-public python-nose-randomly
2076 (package
2077 (name "python-nose-randomly")
2078 (version "1.2.6")
2079 (source
2080 (origin
2081 (method url-fetch)
2082 (uri (pypi-uri "nose-randomly" version))
2083 (sha256
2084 (base32 "0z662rqhfk4bjmg806mn4frb8nz4gbh7mrddsrhfffp1g4yklj3y"))))
2085 (build-system python-build-system)
2086 (native-inputs
2087 `(("python-nose" ,python-nose)
2088 ("python-numpy" ,python-numpy)))
2089 (home-page "https://github.com/adamchainz/nose-randomly")
2090 (synopsis
2091 "Nose plugin to randomly order tests and control random.seed")
2092 (description
2093 "This is a @code{Nose} plugin to randomly order tests which can be quite
2094 powerful in discovering hidden flaws in the tests themselves, while helping to
2095 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
2096 by resetting it to a repeatable number for each test, enabling the tests to
2097 create data based on random numbers and yet remain repeatable.")
2098 (license license:bsd-3)))
2099
2100 (define-public python2-nose-randomly
2101 (package-with-python2 python-nose-randomly))
2102
2103 (define-public python-nose-timer
2104 (package
2105 (name "python-nose-timer")
2106 (version "0.7.5")
2107 (source
2108 (origin
2109 (method url-fetch)
2110 (uri (pypi-uri "nose-timer" version))
2111 (sha256
2112 (base32 "05wzkc88vbzw62pqkvhl33211b90kns0lny70b7qw62rcg4flzk4"))))
2113 (build-system python-build-system)
2114 (propagated-inputs
2115 `(("python-nose" ,python-nose)
2116 ("python-termcolor" ,python-termcolor)))
2117 (home-page "https://github.com/mahmoudimus/nose-timer")
2118 (synopsis "Timer plugin for nosetests")
2119 (description "Shows how much time was needed to run individual tests.")
2120 (license license:expat)))
2121
2122 (define-public python2-nose-timer
2123 (package-with-python2 python-nose-timer))
2124
2125 (define-public python-freezegun
2126 (package
2127 (name "python-freezegun")
2128 (version "0.3.12")
2129 (source
2130 (origin
2131 (method url-fetch)
2132 (uri (pypi-uri "freezegun" version))
2133 (sha256
2134 (base32 "1rx57v8ryjncjimg8hys9kx1r3rknvwcl4y340g20jn0sf69qk9a"))))
2135 (build-system python-build-system)
2136 (native-inputs
2137 `(("python-mock" ,python-mock)
2138 ("python-pytest" ,python-pytest)))
2139 (propagated-inputs
2140 `(("python-six" ,python-six)
2141 ("python-dateutil" ,python-dateutil)))
2142 (arguments
2143 `(#:phases
2144 (modify-phases %standard-phases
2145 ;; The tests are normally executed via `make test`, but the PyPi
2146 ;; package does not include the Makefile.
2147 (replace 'check
2148 (lambda _
2149 (invoke "pytest" "-vv"))))))
2150 (home-page "https://github.com/spulec/freezegun")
2151 (synopsis "Test utility for mocking the datetime module")
2152 (description
2153 "FreezeGun is a library that allows your python tests to travel through
2154 time by mocking the datetime module.")
2155 (license license:asl2.0)))
2156
2157 (define-public python2-freezegun
2158 (package-with-python2 python-freezegun))
2159
2160 (define-public python-flexmock
2161 (package
2162 (name "python-flexmock")
2163 (version "0.10.4")
2164 (source (origin
2165 (method url-fetch)
2166 (uri (pypi-uri "flexmock" version))
2167 (sha256
2168 (base32
2169 "0b6qw3grhgx58kxlkj7mdma7xdvlj02zabvcf7w2qifnfjwwwcsh"))))
2170 (build-system python-build-system)
2171 (home-page "https://flexmock.readthedocs.org")
2172 (synopsis "Testing library for Python")
2173 (description
2174 "flexmock is a testing library for Python that makes it easy to create
2175 mocks, stubs and fakes.")
2176 (license license:bsd-3)))
2177
2178 (define-public python2-flexmock
2179 (package-with-python2 python-flexmock))
2180
2181 (define-public python-flaky
2182 (package
2183 (name "python-flaky")
2184 (version "3.5.3")
2185 (source (origin
2186 (method url-fetch)
2187 (uri (pypi-uri "flaky" version))
2188 (sha256
2189 (base32
2190 "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j"))))
2191 (build-system python-build-system)
2192 (arguments
2193 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2194 '(#:tests? #f))
2195 (home-page "https://github.com/box/flaky")
2196 (synopsis "Automatically rerun flaky tests")
2197 (description
2198 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2199 reruns flaky tests.
2200
2201 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2202 on components that aren't 100% reliable. With flaky, instead of removing
2203 those tests or marking them to @code{@@skip}, they can be automatically
2204 retried.")
2205 (license license:asl2.0)))
2206
2207 (define-public python2-flaky
2208 (package-with-python2 python-flaky))
2209
2210 (define-public python-pyhamcrest
2211 ;; The latest release was in 2016 and its test suite does not work with recent
2212 ;; versions of Pytest. Just take the master branch for now, which seems stable.
2213 (let ((commit "25fdc5f00bdf3084335353bc9247253098ec4cf2")
2214 (revision "0"))
2215 (package
2216 (name "python-pyhamcrest")
2217 (version (git-version "1.9.0" revision commit))
2218 (source (origin
2219 ;; Tests not distributed from pypi release.
2220 (method git-fetch)
2221 (uri (git-reference
2222 (url "https://github.com/hamcrest/PyHamcrest")
2223 (commit commit)))
2224 (file-name (git-file-name name version))
2225 (sha256
2226 (base32
2227 "1miqmhhi68vaix8sqc1lvpvbm27bacffxh5anm5cbfsvk7g9n6f3"))))
2228 (native-inputs ;all native inputs are for tests
2229 `(("python-pytest-cov" ,python-pytest-cov)
2230 ("python-mock" ,python-mock)
2231 ("python-pytest" ,python-pytest)
2232 ("python-hypothesis" ,python-hypothesis)))
2233 (propagated-inputs
2234 `(("python-six" ,python-six)))
2235 (build-system python-build-system)
2236 (arguments
2237 `(#:phases (modify-phases %standard-phases
2238 (replace 'check
2239 (lambda _
2240 (setenv "PYTHONPATH"
2241 (string-append "build/lib:"
2242 (getenv "PYTHONPATH")))
2243 (invoke "pytest" "-vv"))))))
2244 (home-page "http://hamcrest.org/")
2245 (synopsis "Hamcrest matchers for Python")
2246 (description
2247 "PyHamcrest is a framework for writing matcher objects,
2248 allowing you to declaratively define \"match\" rules.")
2249 (license license:bsd-3))))
2250
2251 (define-public python2-pyhamcrest
2252 (package-with-python2 python-pyhamcrest))
2253
2254 (define-public unittest-cpp
2255 (package
2256 (name "unittest-cpp")
2257 (version "2.0.0")
2258 (source (origin
2259 (method git-fetch)
2260 (uri (git-reference
2261 (url "https://github.com/unittest-cpp/unittest-cpp")
2262 (commit (string-append "v" version))))
2263 (file-name (git-file-name name version))
2264 (sha256
2265 (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
2266 (arguments
2267 `(#:tests? #f)) ; It's run after build automatically.
2268 (build-system cmake-build-system)
2269 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2270 (synopsis "Lightweight unit testing framework for C++")
2271 (description "UnitTest++ is a lightweight unit testing framework for C++.
2272 It was designed to do test-driven development on a wide variety of platforms.
2273 Simplicity, portability, speed, and small footprint are all very important
2274 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2275 of advanced library and language features, which means it should be easily
2276 portable to just about any platform.")
2277 (license license:expat)))
2278
2279 (define-public libfaketime
2280 (package
2281 (name "libfaketime")
2282 (version "0.9.8")
2283 (home-page "https://github.com/wolfcw/libfaketime")
2284 (source (origin
2285 (method git-fetch)
2286 (uri (git-reference
2287 (url home-page)
2288 (commit (string-append "v" version))))
2289 (sha256
2290 (base32
2291 "1mfdl82ppgbdvy1ny8mb7xii7p0g7awvn4bn36jb8v4r545slmjc"))
2292 (file-name (git-file-name name version))))
2293 (build-system gnu-build-system)
2294 (arguments
2295 '(#:phases (modify-phases %standard-phases
2296 (replace 'configure
2297 (lambda* (#:key outputs #:allow-other-keys)
2298 (let ((out (assoc-ref outputs "out")))
2299 (setenv "CC" "gcc")
2300 (setenv "PREFIX" out)
2301 #t)))
2302 (add-before 'check 'pre-check
2303 (lambda _
2304 (substitute* "test/functests/test_exclude_mono.sh"
2305 (("/bin/bash") (which "bash")))
2306 #t)))
2307 #:test-target "test"))
2308 (native-inputs
2309 `(("perl" ,perl))) ;for tests
2310 (synopsis "Fake the system time for single applications")
2311 (description
2312 "The libfaketime library allows users to modify the system time that an
2313 application \"sees\". It is meant to be loaded using the dynamic linker's
2314 @code{LD_PRELOAD} environment variable. The @command{faketime} command
2315 provides a simple way to achieve this.")
2316 (license license:gpl2)))
2317
2318 (define-public umockdev
2319 (package
2320 (name "umockdev")
2321 (version "0.13.2")
2322 (source (origin
2323 (method url-fetch)
2324 (uri (string-append "https://github.com/martinpitt/umockdev/"
2325 "releases/download/" version "/"
2326 "umockdev-" version ".tar.xz"))
2327 (sha256
2328 (base32
2329 "095v3abc321s584sga04y16lcmdzsdi88h24wcrm78v7vq484g74"))))
2330 (build-system gnu-build-system)
2331 (arguments
2332 `(#:phases
2333 (modify-phases %standard-phases
2334 (add-after 'unpack 'skip-broken-test
2335 (lambda _
2336 (substitute* "tests/test-umockdev.c"
2337 (("/\\* sys/ in other dir")
2338 (string-append "return; // ")))
2339 #t)))))
2340 (native-inputs
2341 `(("vala" ,vala)
2342 ("gtk-doc" ,gtk-doc)
2343 ("pkg-config" ,pkg-config)
2344
2345 ;; For tests.
2346 ("python" ,python)
2347 ("which" ,which)))
2348 (inputs
2349 `(("glib" ,glib)
2350 ("eudev" ,eudev)
2351 ("libgudev" ,libgudev)
2352 ("gobject-introspection" ,gobject-introspection)))
2353 (home-page "https://github.com/martinpitt/umockdev/")
2354 (synopsis "Mock hardware devices for creating unit tests")
2355 (description "umockdev mocks hardware devices for creating integration
2356 tests for hardware related libraries and programs. It also provides tools to
2357 record the properties and behaviour of particular devices, and to run a
2358 program or test suite under a test bed with the previously recorded devices
2359 loaded.")
2360 (license license:lgpl2.1+)))
2361
2362 (define-public virtest
2363 ;; No releases yet, so we take the commit that "vc" expects.
2364 (let ((commit "f7d03ef39fceba168745bd29e1b20af6e7971e04")
2365 (revision "0"))
2366 (package
2367 (name "virtest")
2368 (version (git-version "0.0" revision commit))
2369 (home-page "https://github.com/mattkretz/virtest")
2370 (source (origin
2371 (method git-fetch)
2372 (uri (git-reference (url home-page) (commit commit)))
2373 (file-name (git-file-name name version))
2374 (sha256
2375 (base32
2376 "07pjyb0mk7y2w1dg1bhl26nb7416xa1mw16ifj6mmps5y6aq054l"))))
2377 (build-system cmake-build-system)
2378 (arguments
2379 `(#:phases (modify-phases %standard-phases
2380 (add-after 'unpack 'adjust-install-directory
2381 (lambda _
2382 ;; Vc is the only consumer of this library, and expects
2383 ;; to find it in "virtest/vir/" instead of "vir/vir/".
2384 (substitute* "CMakeLists.txt"
2385 (("DESTINATION include/vir")
2386 "DESTINATION include/virtest"))
2387 #t)))))
2388 (synopsis "Header-only test framework")
2389 (description
2390 "@code{virtest} is a small header-only test framework for C++. It
2391 grew out of the @dfn{Vc} project.")
2392 (license license:bsd-3))))
2393
2394 (define-public python-pyfakefs
2395 (package
2396 (name "python-pyfakefs")
2397 (version "3.5.8")
2398 (source (origin
2399 (method url-fetch)
2400 ;; We use the PyPI URL because there is no proper release
2401 ;; available from GitHub. The GitHub project only provides
2402 ;; autogenerated tarballs, which are known to change in place.
2403 (uri (pypi-uri "pyfakefs" version))
2404 (sha256
2405 (base32
2406 "0qb9jp0bqhc0dv0rn805fv99029fvx135f3bvka6scfkcl6jgllc"))
2407 (patches (search-patches
2408 "python-pyfakefs-remove-bad-test.patch"))
2409 (file-name (string-append name "-" version ".tar.gz"))))
2410 (arguments
2411 `(#:phases
2412 (modify-phases %standard-phases
2413 ;; The default test suite does not run these extra tests.
2414 (add-after 'check 'check-pytest-plugin
2415 (lambda _
2416 (invoke
2417 "python" "-m" "pytest"
2418 "pyfakefs/pytest_tests/pytest_plugin_test.py")
2419 #t)))))
2420 (native-inputs
2421 `(("python-pytest" ,python-pytest)))
2422 (build-system python-build-system)
2423 ;; Guix lint doesn't like that this is a permanent redirect to the GitHub
2424 ;; page, but the pyfakefs documentation asks us to use this specific URL
2425 ;; when linking to the project. Honor their request.
2426 (home-page "http://pyfakefs.org/")
2427 ;; TRANSLATORS: In the synopsis, "Mock" is a verb.
2428 (synopsis "Mock file system interactions in tests")
2429 (description
2430 "This package provides a Python library intended for use in automated
2431 tests. One difficulty when testing software is that the code under test might
2432 need to read or write to files in the local file system. If the file system
2433 is not set up in just the right way, it might cause a spurious error during
2434 the test. The pyfakefs library provides a solution to problems like this by
2435 mocking file system interactions. In other words, it arranges for the code
2436 under test to interact with a fake file system instead of the real file
2437 system. The code under test requires no modification to work with pyfakefs.")
2438 (license license:asl2.0)))
2439
2440 (define-public python2-pyfakefs
2441 (package-with-python2 python-pyfakefs))