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