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