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