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