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