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