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