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