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