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