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