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