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