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