gnu: Add python-black.
[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 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.2")
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 "1p9b6ccv939wjsgapn7wx24xw278awsw9h81lm0g4zw257hx276i"))))
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.84")
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 "1ibz07dgs1dpfb8bmjh3qsma37wl5p6s6b4qlv5ccpshj4yjk9ma"))
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-codecov
1227 (package
1228 (name "python-codecov")
1229 (version "2.0.15")
1230 (source
1231 (origin
1232 (method url-fetch)
1233 (uri (pypi-uri "codecov" version))
1234 (sha256
1235 (base32
1236 "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1237 (build-system python-build-system)
1238 (native-inputs
1239 `(("python-unittest2" ,python-unittest2)))
1240 (propagated-inputs
1241 `(("python-coverage" ,python-coverage)
1242 ("python-requests" ,python-requests)))
1243 (home-page "http://github.com/codecov/codecov-python")
1244 (synopsis "Upload code coverage reports to @code{codecov.io}")
1245 (description
1246 "Codecov collects code coverage reports from code written in Python, Java,
1247 C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
1248 (license license:asl2.0)))
1249
1250 (define-public python-testpath
1251 (package
1252 (name "python-testpath")
1253 (version "0.2")
1254 (source
1255 (origin
1256 (method url-fetch)
1257 (uri (string-append "https://github.com/jupyter/testpath/archive/"
1258 version ".tar.gz"))
1259 (file-name (string-append name "-" version ".tar.gz"))
1260 (sha256
1261 (base32
1262 "04kh3fgvmqz6cfcw79q70qwjz7ib7lxm27cc548iy2rpr33qqf55"))))
1263 (build-system python-build-system)
1264 (arguments
1265 `(#:tests? #f ; this package does not even have a setup.py
1266 #:modules ((guix build python-build-system)
1267 (guix build utils)
1268 (srfi srfi-1))
1269 #:imported-modules (,@%python-build-system-modules
1270 (srfi srfi-1))
1271 #:phases
1272 (modify-phases %standard-phases
1273 (delete 'install)
1274 (replace 'build
1275 (lambda* (#:key inputs outputs #:allow-other-keys)
1276 (let* ((version (last
1277 (string-split (assoc-ref inputs "python") #\-)))
1278 (x.y (string-join (take (string-split version #\.) 2)
1279 "."))
1280 (dir (string-append
1281 (assoc-ref outputs "out")
1282 "/lib/python" x.y "/site-packages/testpath")))
1283 (mkdir-p dir)
1284 (copy-recursively "testpath" dir))
1285 #t)))))
1286 (home-page "https://github.com/takluyver/testpath")
1287 (synopsis "Test utilities for code working with files and commands")
1288 (description
1289 "Testpath is a collection of utilities for Python code working with files
1290 and commands. It contains functions to check things on the file system, and
1291 tools for mocking system commands and recording calls to those.")
1292 (license license:expat)))
1293
1294 (define-public python2-testpath
1295 (package-with-python2 python-testpath))
1296
1297 (define-public python-testlib
1298 (package
1299 (name "python-testlib")
1300 (version "0.6.5")
1301 (source
1302 (origin
1303 (method url-fetch)
1304 (uri (string-append
1305 "https://pypi.python.org/packages/source/t/testlib/testlib-"
1306 version ".zip"))
1307 (sha256
1308 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1309 (build-system python-build-system)
1310 (native-inputs
1311 `(("unzip" ,unzip))) ; for unpacking the source
1312 (synopsis "Python micro test suite harness")
1313 (description "A micro unittest suite harness for Python.")
1314 (home-page "https://github.com/trentm/testlib")
1315 (license license:expat)))
1316
1317 (define-public python2-testlib
1318 (package-with-python2 python-testlib))
1319
1320 ;;; The software provided by this package was integrated into pytest 2.8.
1321 (define-public python-pytest-cache
1322 (package
1323 (name "python-pytest-cache")
1324 (version "1.0")
1325 (source (origin
1326 (method url-fetch)
1327 (uri (pypi-uri "pytest-cache" version))
1328 (sha256
1329 (base32
1330 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1331 (build-system python-build-system)
1332 (propagated-inputs
1333 `(("python-apipkg" ,python-apipkg)
1334 ("python-execnet" ,python-execnet)
1335 ("python-py" ,python-py)
1336 ("python-pytest" ,python-pytest)))
1337 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1338 (description "The pytest-cache plugin provides tools to rerun failures from
1339 the last py.test invocation.")
1340 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1341 (license license:expat)))
1342
1343 (define-public python2-pytest-cache
1344 (package-with-python2 python-pytest-cache))
1345
1346 (define-public python-pytest-localserver
1347 (package
1348 (name "python-pytest-localserver")
1349 (version "0.4.1")
1350 (source (origin
1351 (method url-fetch)
1352 (uri (pypi-uri "pytest-localserver" version))
1353 (sha256
1354 (base32
1355 "08f06rvj31wqf0vgmd1waya87r7vy6x8ck48lxl3dxy83q5gcam7"))))
1356 (build-system python-build-system)
1357 (arguments
1358 `(#:phases (modify-phases %standard-phases
1359 (replace 'check
1360 (lambda _
1361 (zero? (system* "py.test" "--genscript=runtests.py"))
1362 (zero? (system* "py.test")))))))
1363 (native-inputs
1364 `(("python-pytest" ,python-pytest)
1365 ("python-requests" ,python-requests)
1366 ("python-six" ,python-six)))
1367 (propagated-inputs
1368 `(("python-werkzeug" ,python-werkzeug)))
1369 (synopsis "Py.test plugin to test server connections locally")
1370 (description "Pytest-localserver is a plugin for the pytest testing
1371 framework which enables you to test server connections locally.")
1372 (home-page "https://pypi.python.org/pypi/pytest-localserver")
1373 (license license:expat)))
1374
1375 (define-public python-pytest-xprocess
1376 (package
1377 (name "python-pytest-xprocess")
1378 (version "0.9.1")
1379 (source (origin
1380 (method url-fetch)
1381 (uri (pypi-uri "pytest-xprocess" version))
1382 (sha256
1383 (base32
1384 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1385 (build-system python-build-system)
1386 (propagated-inputs
1387 `(("python-pytest" ,python-pytest)
1388 ("python-pytest-cache" ,python-pytest-cache)
1389 ("python-psutil" ,python-psutil)))
1390 (synopsis "Pytest plugin to manage external processes across test runs")
1391 (description "Pytest-xprocess is an experimental py.test plugin for managing
1392 processes across test runs.")
1393 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1394 (license license:expat)))
1395
1396 (define-public python-pytest-subtesthack
1397 (package
1398 (name "python-pytest-subtesthack")
1399 (version "0.1.1")
1400 (source (origin
1401 (method url-fetch)
1402 (uri (pypi-uri "pytest-subtesthack" version))
1403 (sha256
1404 (base32
1405 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1406 (build-system python-build-system)
1407 (propagated-inputs
1408 `(("python-pytest" ,python-pytest)))
1409 (synopsis "Set-up and tear-down fixtures for unit tests")
1410 (description "This plugin allows you to set up and tear down fixtures within
1411 unit test functions that use @code{py.test}. This is useful for using
1412 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1413 function multiple times, without setting up or tearing down fixture state as is
1414 normally the case.")
1415 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1416 (license license:unlicense)))
1417
1418 (define-public python2-pytest-subtesthack
1419 (package-with-python2 python-pytest-subtesthack))
1420
1421 (define-public python-hypothesis
1422 (package
1423 (name "python-hypothesis")
1424 (version "3.52.0")
1425 (source (origin
1426 (method url-fetch)
1427 (uri (pypi-uri "hypothesis" version))
1428 (sha256
1429 (base32
1430 "0g54cypfi5qj6cgxfr7l1nb41r1cqhhngx4qxn4ga9h720rcsbr8"))))
1431 (build-system python-build-system)
1432 (native-inputs
1433 `(("python-flake8" ,python-flake8)
1434 ("python-pytest" ,python-pytest-bootstrap)))
1435 (propagated-inputs
1436 `(("python-attrs" ,python-attrs-bootstrap)
1437 ("python-coverage" ,python-coverage)))
1438 (synopsis "Library for property based testing")
1439 (description "Hypothesis is a library for testing your Python code against a
1440 much larger range of examples than you would ever want to write by hand. It’s
1441 based on the Haskell library, Quickcheck, and is designed to integrate
1442 seamlessly into your existing Python unit testing work flow.")
1443 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
1444 (license license:mpl2.0)
1445 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1446
1447 (define-public python2-hypothesis
1448 (let ((hypothesis (package-with-python2
1449 (strip-python2-variant python-hypothesis))))
1450 (package (inherit hypothesis)
1451 (propagated-inputs
1452 `(("python2-enum34" ,python2-enum34)
1453 ,@(package-propagated-inputs hypothesis))))))
1454
1455 (define-public python-lit
1456 (package
1457 (name "python-lit")
1458 (version "0.5.1")
1459 (source
1460 (origin
1461 (method url-fetch)
1462 (uri (pypi-uri "lit" version))
1463 (sha256
1464 (base32
1465 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
1466 (build-system python-build-system)
1467 (arguments
1468 `(#:phases
1469 (modify-phases %standard-phases
1470 (replace 'check
1471 (lambda _
1472 (invoke "python" "lit.py" "tests"))))))
1473 (native-inputs
1474 `(("llvm" ,llvm)))
1475 (home-page "https://llvm.org/")
1476 (synopsis "LLVM Software Testing Tool")
1477 (description "@code{lit} is a portable tool for executing LLVM and Clang
1478 style test suites, summarizing their results, and providing indication of
1479 failures.")
1480 (license license:ncsa)))
1481
1482 (define-public python2-lit
1483 (package-with-python2 python-lit))
1484
1485 (define-public python-pytest-pep8
1486 (package
1487 (name "python-pytest-pep8")
1488 (version "1.0.6")
1489 (source (origin
1490 (method url-fetch)
1491 (uri (pypi-uri "pytest-pep8" version))
1492 (sha256
1493 (base32
1494 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
1495 (build-system python-build-system)
1496 (arguments
1497 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
1498 (native-inputs
1499 `(("python-pytest" ,python-pytest)))
1500 (propagated-inputs
1501 `(("python-pep8" ,python-pep8)))
1502 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
1503 (synopsis "Py.test plugin to check PEP8 requirements")
1504 (description "Pytest plugin for checking PEP8 compliance.")
1505 (license license:expat)))
1506
1507 (define-public python2-pytest-pep8
1508 (package-with-python2 python-pytest-pep8))
1509
1510 (define-public python-pytest-flakes
1511 (package
1512 (name "python-pytest-flakes")
1513 (version "1.0.1")
1514 (source (origin
1515 (method url-fetch)
1516 (uri (pypi-uri "pytest-flakes" version))
1517 (sha256
1518 (base32
1519 "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
1520 (build-system python-build-system)
1521 (arguments
1522 `(#:phases
1523 (modify-phases %standard-phases
1524 (delete 'check)
1525 (add-after 'install 'check
1526 (lambda* (#:key outputs inputs #:allow-other-keys)
1527 ;; It's easier to run tests after install.
1528 ;; Make installed package available for running the tests
1529 (add-installed-pythonpath inputs outputs)
1530 (zero? (system* "py.test" "-vv")))))))
1531 (native-inputs
1532 `(("python-coverage" ,python-coverage)
1533 ("python-pytest" ,python-pytest)
1534 ("python-pytest-cache" ,python-pytest-cache)
1535 ("python-pytest-pep8" ,python-pytest-pep8)))
1536 (propagated-inputs
1537 `(("python-pyflakes" ,python-pyflakes)))
1538 (home-page "https://github.com/fschulze/pytest-flakes")
1539 (synopsis "Py.test plugin to check source code with pyflakes")
1540 (description "Pytest plugin for checking Python source code with pyflakes.")
1541 (license license:expat)))
1542
1543 (define-public python2-pytest-flakes
1544 (package-with-python2 python-pytest-flakes))
1545
1546 (define-public python2-coverage-test-runner
1547 (package
1548 (name "python2-coverage-test-runner")
1549 (version "1.11")
1550 (source
1551 (origin
1552 (method url-fetch)
1553 (uri (string-append
1554 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
1555 "coverage-test-runner/snapshot/coverage-test-runner-"
1556 version ".tar.gz"))
1557 (sha256
1558 (base32
1559 "0y1m7z3dl63kmhcmydl1mwg0hacnf6ghrx9dah17j9iasssfa3g7"))))
1560 (build-system python-build-system)
1561 (arguments
1562 `(#:python ,python-2
1563 #:phases
1564 (modify-phases %standard-phases
1565 (replace 'check
1566 (lambda _
1567 (zero? (system* "./testrun")))))))
1568 (propagated-inputs
1569 `(("python2-coverage" ,python2-coverage)))
1570 (home-page "https://liw.fi/coverage-test-runner/")
1571 (synopsis "Python module for running unit tests")
1572 (description "@code{CoverageTestRunner} is a python module for running
1573 unit tests and failing them if the unit test module does not exercise all
1574 statements in the module it tests.")
1575 (license license:gpl3+)))
1576
1577 (define-public python-pylint
1578 (package
1579 (name "python-pylint")
1580 (version "1.7.2")
1581 (source
1582 (origin
1583 (method url-fetch)
1584 (uri (string-append
1585 "https://github.com/PyCQA/pylint/archive/pylint-"
1586 version ".tar.gz"))
1587 (sha256
1588 (base32
1589 "0mzn1czhf1mgr2wiqfihb274sja02h899b85kywdpivppa9nwrmp"))))
1590 (build-system python-build-system)
1591 (native-inputs
1592 `(("python-pytest" ,python-pytest)
1593 ("python-pytest-runner" ,python-pytest-runner)
1594 ("python-tox" ,python-tox)))
1595 (propagated-inputs
1596 `(("python-astroid" ,python-astroid)
1597 ("python-isort" ,python-isort)
1598 ("python-mccabe" ,python-mccabe)
1599 ("python-six" ,python-six)))
1600 (arguments
1601 `(#:phases
1602 (modify-phases %standard-phases
1603 (replace 'check
1604 (lambda _
1605 ;; Somehow, tests for python2-pylint
1606 ;; fail if run from the build directory
1607 (let ((work "/tmp/work"))
1608 (mkdir-p work)
1609 (setenv "PYTHONPATH"
1610 (string-append (getenv "PYTHONPATH") ":" work))
1611 (copy-recursively "." work)
1612 (with-directory-excursion "/tmp"
1613 (zero? (system* "python" "-m" "unittest" "discover"
1614 "-s" (string-append work "/pylint/test")
1615 "-p" "*test_*.py")))))))))
1616 (home-page "https://github.com/PyCQA/pylint")
1617 (synopsis "Python source code analyzer which looks for coding standard
1618 errors")
1619 (description "Pylint is a Python source code analyzer which looks
1620 for programming errors, helps enforcing a coding standard and sniffs
1621 for some code smells (as defined in Martin Fowler's Refactoring book).
1622
1623 Pylint has many rules enabled by default, way too much to silence them
1624 all on a minimally sized program. It's highly configurable and handle
1625 pragmas to control it from within your code. Additionally, it is
1626 possible to write plugins to add your own checks.")
1627 (properties `((python2-variant . ,(delay python2-pylint))))
1628 (license license:gpl2+)))
1629
1630 (define-public python2-pylint
1631 (let ((pylint (package-with-python2
1632 (strip-python2-variant python-pylint))))
1633 (package (inherit pylint)
1634 (propagated-inputs
1635 `(("python2-backports-functools-lru-cache"
1636 ,python2-backports-functools-lru-cache)
1637 ("python2-configparser" ,python2-configparser)
1638 ,@(package-propagated-inputs pylint))))))
1639
1640 (define-public python-paramunittest
1641 (package
1642 (name "python-paramunittest")
1643 (version "0.2")
1644 (source
1645 (origin
1646 (method url-fetch)
1647 (uri (pypi-uri "ParamUnittest" version))
1648 (sha256
1649 (base32
1650 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
1651 (build-system python-build-system)
1652 (home-page
1653 "https://github.com/rik0/ParamUnittest")
1654 (synopsis
1655 "Simple extension to have parametrized unit tests")
1656 (description
1657 "This package allows to create parametrized unit-tests that work with the standard
1658 unittest package. A parametrized test case is automatically converted to multiple test
1659 cases. Since they are TestCase subclasses, they work with other test suites that
1660 recognize TestCases.")
1661 (license license:bsd-2)))
1662
1663 (define-public python2-python-paramunittest
1664 (package-with-python2 python-paramunittest))
1665
1666 (define-public python-pytest-warnings
1667 (package
1668 (name "python-pytest-warnings")
1669 (version "0.2.0")
1670 (source
1671 (origin
1672 (method url-fetch)
1673 (uri (pypi-uri "pytest-warnings" version))
1674 (sha256
1675 (base32
1676 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
1677 (build-system python-build-system)
1678 (propagated-inputs
1679 `(("pytest" ,python-pytest)))
1680 (home-page "https://github.com/fschulze/pytest-warnings")
1681 (synopsis "Pytest plugin to list Python warnings in pytest report")
1682 (description
1683 "Python-pytest-warnings is a pytest plugin to list Python warnings in
1684 pytest report.")
1685 (license license:expat)
1686 (properties `((python2-variant . ,(delay python2-pytest-warnings))
1687 ;; This package is part of pytest as of version 3.1.0.
1688 (superseded . ,python-pytest)))))
1689
1690 (define-public python2-pytest-warnings
1691 (package (inherit (package-with-python2
1692 (strip-python2-variant python-pytest-warnings)))
1693 (properties `((superseded . ,python2-pytest)))))
1694
1695 (define-public python-pytest-capturelog
1696 (package
1697 (name "python-pytest-capturelog")
1698 (version "0.7")
1699 (source
1700 (origin
1701 (method url-fetch)
1702 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
1703 (sha256
1704 (base32
1705 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
1706 (build-system python-build-system)
1707 (propagated-inputs
1708 `(("pytest" ,python-pytest)))
1709 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
1710 (synopsis "Pytest plugin to catch log messages")
1711 (description
1712 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
1713 (license license:expat)))
1714
1715 (define-public python2-pytest-capturelog
1716 (package-with-python2 python-pytest-capturelog))
1717
1718 (define-public python-pytest-catchlog
1719 (package
1720 (name "python-pytest-catchlog")
1721 (version "1.2.2")
1722 (source
1723 (origin
1724 (method url-fetch)
1725 (uri (pypi-uri "pytest-catchlog" version ".zip"))
1726 (sha256
1727 (base32
1728 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
1729 (build-system python-build-system)
1730 (native-inputs
1731 `(("unzip" ,unzip)))
1732 (propagated-inputs
1733 `(("pytest" ,python-pytest)))
1734 (home-page "https://github.com/eisensheng/pytest-catchlog")
1735 (synopsis "Pytest plugin to catch log messages")
1736 (description
1737 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
1738 a fork of pytest-capturelog.")
1739 (license license:expat)))
1740
1741 (define-public python2-pytest-catchlog
1742 (package-with-python2 python-pytest-catchlog))
1743
1744 (define-public python-nosexcover
1745 (package
1746 (name "python-nosexcover")
1747 (version "1.0.11")
1748 (source (origin
1749 (method url-fetch)
1750 (uri (pypi-uri "nosexcover" version))
1751 (sha256
1752 (base32
1753 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
1754 (build-system python-build-system)
1755 (propagated-inputs
1756 `(("python-coverage" ,python-coverage)
1757 ("python-nose" ,python-nose)))
1758 (home-page "http://github.com/cmheisel/nose-xcover")
1759 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
1760 (description "Nose-xcover is a companion to the built-in
1761 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
1762 to a file named coverage.xml.
1763
1764 It will honor all the options you pass to the Nose coverage plugin,
1765 especially -cover-package.")
1766 (license license:expat)))
1767
1768 (define-public python2-nosexcover
1769 (package-with-python2 python-nosexcover))
1770
1771 (define-public python-discover
1772 (package
1773 (name "python-discover")
1774 (version "0.4.0")
1775 (source
1776 (origin
1777 (method url-fetch)
1778 (uri (string-append
1779 "https://pypi.python.org/packages/source/d/discover/discover-"
1780 version ".tar.gz"))
1781 (sha256
1782 (base32
1783 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
1784 (build-system python-build-system)
1785 (home-page "http://pypi.python.org/pypi/discover/")
1786 (synopsis
1787 "Python test discovery for unittest")
1788 (description
1789 "Discover provides test discovery for unittest, a feature that has been
1790 backported from Python 2.7 for Python 2.4+.")
1791 (license license:bsd-3)))
1792
1793 (define-public python2-discover
1794 (package-with-python2 python-discover))
1795
1796 (define-public behave
1797 (package
1798 (name "behave")
1799 (version "1.2.6")
1800 (source (origin
1801 (method url-fetch)
1802 (uri (pypi-uri "behave" version))
1803 (sha256
1804 (base32
1805 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))))
1806 (build-system python-build-system)
1807 (native-inputs
1808 `(("python-mock" ,python-mock)
1809 ("python-nose" ,python-nose)
1810 ("python-pathpy" ,python-pathpy)
1811 ("python-pyhamcrest" ,python-pyhamcrest)
1812 ("python-pytest" ,python-pytest)))
1813 (propagated-inputs
1814 `(("python-six" ,python-six)
1815 ("python-parse" ,python-parse)
1816 ("python-parse-type" ,python-parse-type)))
1817 (arguments
1818 '(#:test-target "behave_test"))
1819 (home-page "https://github.com/behave/behave")
1820 (synopsis "Python behavior-driven development")
1821 (description
1822 "Behave is a tool for behavior-driven development in python.
1823 Behavior-driven development (or BDD) is an agile software development
1824 technique that encourages collaboration between developers, QA and
1825 non-technical or business participants in a software project. Behave uses
1826 tests written in a natural language style, backed up by Python code.")
1827 (license license:x11)))
1828
1829 (define-public python-behave-web-api
1830 (package
1831 (name "python-behave-web-api")
1832 (version "1.0.6")
1833 (source
1834 (origin
1835 (method url-fetch)
1836 (uri (pypi-uri "behave-web-api" version))
1837 (sha256
1838 (base32
1839 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
1840 (build-system python-build-system)
1841 (arguments
1842 `(#:phases
1843 (modify-phases %standard-phases
1844 (add-after 'unpack 'fix-dependencies
1845 (lambda _
1846 (substitute* "setup.py"
1847 (("'wheel'") "") ; We don't use it.
1848 (("'ordereddict==1.1'") ""))))))) ; Python >= 2.7 has it built-in.
1849 (propagated-inputs
1850 `(("behave" ,behave)
1851 ("python-requests" ,python-requests)))
1852 (home-page "https://github.com/jefersondaniel/behave-web-api")
1853 (synopsis "Provides testing for JSON APIs with Behave for Python")
1854 (description "This package provides testing utility modules for testing
1855 JSON APIs with Behave.")
1856 (license license:expat)))
1857
1858 (define-public python2-behave-web-api
1859 (package-with-python2 python-behave-web-api))
1860
1861 (define-public python-rednose
1862 (package
1863 (name "python-rednose")
1864 (version "1.2.3")
1865 (source
1866 (origin
1867 (method url-fetch)
1868 (uri (pypi-uri "rednose" version))
1869 (sha256
1870 (base32
1871 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
1872 (build-system python-build-system)
1873 (arguments
1874 `(#:phases (modify-phases %standard-phases
1875 (add-after 'unpack 'patch-setup.py
1876 (lambda _
1877 ;; Six is only required for tests and later versions
1878 ;; work fine.
1879 (substitute* "setup.py"
1880 (("six==1.10.0") "six"))
1881 #t)))))
1882 (propagated-inputs
1883 `(("python-colorama" ,python-colorama)
1884 ("python-termstyle" ,python-termstyle)))
1885 (native-inputs
1886 `(("python-six" ,python-six)
1887 ("python-nose" ,python-nose)))
1888 (home-page "https://github.com/JBKahn/rednose")
1889 (synopsis "Colored output for Python nosetests")
1890 (description "This package provides colored output for the
1891 @command{nosetests} command of the Python Nose unit test framework.")
1892 (license license:bsd-3)))
1893
1894 (define-public python2-rednose
1895 (package-with-python2 python-rednose))
1896
1897 (define-public python-nose-randomly
1898 (package
1899 (name "python-nose-randomly")
1900 (version "1.2.5")
1901 (source
1902 (origin
1903 (method url-fetch)
1904 (uri (pypi-uri "nose-randomly" version))
1905 (sha256
1906 (base32
1907 "1cw9dlr1zh3w4i438kin7z0rm8092ki52hayisyc43h9pcplq7rn"))))
1908 (build-system python-build-system)
1909 (native-inputs
1910 `(("python-nose" ,python-nose)
1911 ("python-numpy" ,python-numpy)))
1912 (home-page "https://github.com/adamchainz/nose-randomly")
1913 (synopsis
1914 "Nose plugin to randomly order tests and control random.seed")
1915 (description
1916 "This is a @code{Nose} plugin to randomly order tests which can be quite
1917 powerful in discovering hidden flaws in the tests themselves, while helping to
1918 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
1919 by resetting it to a repeatable number for each test, enabling the tests to
1920 create data based on random numbers and yet remain repeatable.")
1921 (license license:bsd-3)))
1922
1923 (define-public python2-nose-randomly
1924 (package-with-python2 python-nose-randomly))
1925
1926 (define-public python-nose-timer
1927 (package
1928 (name "python-nose-timer")
1929 (version "0.7.2")
1930 (source
1931 (origin
1932 (method url-fetch)
1933 (uri (pypi-uri "nose-timer" version))
1934 (sha256
1935 (base32
1936 "0ywg223p528014z5s0vzck74r4xyw3kvcp2casfnc85dkvir1zj7"))))
1937 (build-system python-build-system)
1938 (propagated-inputs
1939 `(("python-nose" ,python-nose)
1940 ("python-termcolor" ,python-termcolor)))
1941 (home-page "https://github.com/mahmoudimus/nose-timer")
1942 (synopsis "Timer plugin for nosetests")
1943 (description "Shows how much time was needed to run individual tests.")
1944 (license license:expat)))
1945
1946 (define-public python2-nose-timer
1947 (package-with-python2 python-nose-timer))
1948
1949 (define-public python-freezegun
1950 (package
1951 (name "python-freezegun")
1952 (version "0.3.10")
1953 (source
1954 (origin
1955 (method url-fetch)
1956 (uri (pypi-uri "freezegun" version))
1957 (sha256
1958 (base32
1959 "08m6b42yxb9hk5lv747v9n2qsxyadmkb0k6yg0gxdanwap0slg3h"))))
1960 (build-system python-build-system)
1961 (native-inputs
1962 `(("python-mock" ,python-mock)
1963 ("python-nose" ,python-nose)
1964 ("python-coverage" ,python-coverage)))
1965 (propagated-inputs
1966 `(("python-six" ,python-six)
1967 ("python-dateutil" ,python-dateutil)))
1968 (arguments
1969 `(#:phases
1970 (modify-phases %standard-phases
1971 ;; The tests are normally executed via `make test`, but the PyPi
1972 ;; package does not include the Makefile.
1973 (replace 'check
1974 (lambda _
1975 (invoke "nosetests" "./tests/"))))))
1976 (home-page "https://github.com/spulec/freezegun")
1977 (synopsis "Test utility for mocking the datetime module")
1978 (description
1979 "FreezeGun is a library that allows your python tests to travel through
1980 time by mocking the datetime module.")
1981 (license license:asl2.0)))
1982
1983 (define-public python2-freezegun
1984 (package-with-python2 python-freezegun))
1985
1986 (define-public python-flexmock
1987 (package
1988 (name "python-flexmock")
1989 (version "0.10.2")
1990 (source (origin
1991 (method url-fetch)
1992 (uri (pypi-uri "flexmock" version))
1993 (sha256
1994 (base32
1995 "0arc6njvs6i9v9hgvzk5m50296g7zy5m9d7pyb43vdsdgxrci5gy"))))
1996 (build-system python-build-system)
1997 (home-page "https://flexmock.readthedocs.org")
1998 (synopsis "Testing library for Python")
1999 (description
2000 "flexmock is a testing library for Python that makes it easy to create
2001 mocks, stubs and fakes.")
2002 (license license:bsd-3)))
2003
2004 (define-public python2-flexmock
2005 (package-with-python2 python-flexmock))
2006
2007 (define-public python-flaky
2008 (package
2009 (name "python-flaky")
2010 (version "3.4.0")
2011 (source (origin
2012 (method url-fetch)
2013 (uri (pypi-uri "flaky" version))
2014 (sha256
2015 (base32
2016 "18pkmf79rfkfpy1d2rrx3v55nxj762ilyk9rvd6s6dccxw58imsa"))))
2017 (build-system python-build-system)
2018 (arguments
2019 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2020 '(#:tests? #f))
2021 (home-page "https://github.com/box/flaky")
2022 (synopsis "Automatically rerun flaky tests")
2023 (description
2024 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2025 reruns flaky tests.
2026
2027 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2028 on components that aren't 100% reliable. With flaky, instead of removing
2029 those tests or marking them to @code{@@skip}, they can be automatically
2030 retried.")
2031 (license license:asl2.0)))
2032
2033 (define-public python2-flaky
2034 (package-with-python2 python-flaky))
2035
2036 (define-public python-pyhamcrest
2037 (package
2038 (name "python-pyhamcrest")
2039 (version "1.9.0")
2040 (source (origin
2041 (method url-fetch)
2042 (uri
2043 (string-append
2044 "https://github.com/hamcrest/PyHamcrest/archive/V"
2045 version
2046 ".tar.gz"))
2047 (file-name
2048 (string-append name "-" version ".tar.gz"))
2049 (sha256
2050 (base32
2051 "1lqjajhwf7x7igvvnj5p1cm31y9njy07qby94w18kl6zwbdjqrwy"))))
2052 (native-inputs ; All native inputs are for tests
2053 `(("python-pytest-cov" ,python-pytest-cov)
2054 ("python-mock" ,python-mock)
2055 ("python-pytest" ,python-pytest)
2056 ("python-hypothesis" ,python-hypothesis)))
2057 (propagated-inputs
2058 `(("python-six" ,python-six)))
2059 (build-system python-build-system)
2060 (home-page "http://hamcrest.org/")
2061 (synopsis "Hamcrest matchers for Python")
2062 (description
2063 "PyHamcrest is a framework for writing matcher objects,
2064 allowing you to declaratively define \"match\" rules.")
2065 (license license:bsd-3)))
2066
2067 (define-public python2-pyhamcrest
2068 (package-with-python2 python-pyhamcrest))
2069
2070 (define-public unittest-cpp
2071 (package
2072 (name "unittest-cpp")
2073 (version "2.0.0")
2074 (source (origin
2075 (method url-fetch)
2076 (uri (string-append
2077 "https://github.com/unittest-cpp/unittest-cpp/archive/v"
2078 version ".tar.gz"))
2079 (file-name (string-append name "-" version ".tar.gz"))
2080 (sha256
2081 (base32 "1fgmna2la7z4pwwy2gd10gpgi2q1fk89npjfvkmzvhkxhyc231bl"))))
2082 (arguments
2083 `(#:tests? #f)) ; It's run after build automatically.
2084 (build-system cmake-build-system)
2085 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2086 (synopsis "Lightweight unit testing framework for C++")
2087 (description "UnitTest++ is a lightweight unit testing framework for C++.
2088 It was designed to do test-driven development on a wide variety of platforms.
2089 Simplicity, portability, speed, and small footprint are all very important
2090 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2091 of advanced library and language features, which means it should be easily
2092 portable to just about any platform.")
2093 (license license:expat)))