f8d71ff7972f0f0656f2d32e0af113169ff1b564
[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 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 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 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 Kei Kebreau <kkebreau@posteo.net>
26 ;;; Copyright © 2017 ng0 <ng0@infotropique.org>
27 ;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@elephly.net>
28 ;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
29 ;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
30 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
31 ;;;
32 ;;; This file is part of GNU Guix.
33 ;;;
34 ;;; GNU Guix is free software; you can redistribute it and/or modify it
35 ;;; under the terms of the GNU General Public License as published by
36 ;;; the Free Software Foundation; either version 3 of the License, or (at
37 ;;; your option) any later version.
38 ;;;
39 ;;; GNU Guix is distributed in the hope that it will be useful, but
40 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
41 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42 ;;; GNU General Public License for more details.
43 ;;;
44 ;;; You should have received a copy of the GNU General Public License
45 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
46
47 (define-module (gnu packages check)
48 #:use-module (gnu packages)
49 #:use-module (gnu packages autotools)
50 #:use-module (gnu packages bash)
51 #:use-module (gnu packages compression)
52 #:use-module (gnu packages llvm)
53 #:use-module (gnu packages python)
54 #:use-module (gnu packages python-web)
55 #:use-module (gnu packages time)
56 #:use-module (guix utils)
57 #:use-module ((guix licenses) #:prefix license:)
58 #:use-module (guix packages)
59 #:use-module (guix download)
60 #:use-module (guix git-download)
61 #:use-module (guix build-system cmake)
62 #:use-module (guix build-system gnu)
63 #:use-module (guix build-system python)
64 #:use-module (guix build-system trivial))
65
66 (define-public check
67 (package
68 (name "check")
69 (version "0.12.0")
70 (source
71 (origin
72 (method url-fetch)
73 (uri (string-append "https://github.com/libcheck/check/releases/download/"
74 version "/check-" version ".tar.gz"))
75 (sha256
76 (base32
77 "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6"))))
78 (build-system gnu-build-system)
79 (home-page "https://libcheck.github.io/check/")
80 (synopsis "Unit test framework for C")
81 (description
82 "Check is a unit testing framework for C. It features a simple
83 interface for defining unit tests, putting little in the way of the
84 developer. Tests are run in a separate address space, so Check can
85 catch both assertion failures and code errors that cause segmentation
86 faults or other signals. The output from unit tests can be used within
87 source code editors and IDEs.")
88 (license license:lgpl2.1+)))
89
90 (define-public cunit
91 (package
92 (name "cunit")
93 (version "2.1-3")
94 (source
95 (origin
96 (method url-fetch)
97 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
98 version "/CUnit-" version ".tar.bz2"))
99 (sha256
100 (base32
101 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
102 (build-system gnu-build-system)
103 (arguments '(#:phases
104 (modify-phases %standard-phases
105 (add-before 'configure 'autoconf
106 (lambda _
107 (zero? (system* "autoreconf" "-vfi")))))))
108 (native-inputs
109 `(("automake" ,automake)
110 ("autoconf" ,autoconf)
111 ("libtool" ,libtool)))
112 (home-page "http://cunit.sourceforge.net/")
113 (synopsis "Automated testing framework for C")
114 (description
115 "CUnit is a lightweight system for writing, administering, and running
116 unit tests in C. It provides C programmers with basic testing functionality
117 with a flexible variety of user interfaces.")
118 (license license:gpl2+)))
119
120 (define-public cppunit
121 (package
122 (name "cppunit")
123 (version "1.13.2")
124 (source (origin
125 (method url-fetch)
126 (uri (string-append "http://dev-www.libreoffice.org/src/"
127 name "-" version ".tar.gz"))
128 (sha256
129 (base32
130 "17s2kzmkw3kfjhpp72rfppyd7syr7bdq5s69syj2nvrlwd3d4irz"))))
131 ;; Explicitly link with libdl. This is expected to be done by packages
132 ;; relying on cppunit for their tests. However, not all of them do.
133 ;; If we added the linker flag to such packages, we would pollute all
134 ;; binaries, not only those used for testing.
135 (arguments
136 `(#:make-flags '("LDFLAGS=-ldl")))
137 (build-system gnu-build-system)
138 (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
139 (synopsis "Unit testing framework for C++")
140 (description "CppUnit is the C++ port of the famous JUnit framework for
141 unit testing. Test output is in XML for automatic testing and GUI based for
142 supervised tests.")
143 (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
144
145 (define-public catch-framework
146 (package
147 (name "catch")
148 (version "1.3.5") ;Sub-minor is the build number
149 (source (origin
150 (method git-fetch)
151 (uri (git-reference
152 (url "https://github.com/philsquared/Catch")
153 ;; Semi-arbitrary.
154 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
155 (file-name (string-append name "-" version))
156 (sha256
157 (base32
158 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
159 (build-system trivial-build-system)
160 (arguments
161 `(#:modules ((guix build utils))
162 #:builder (begin
163 (use-modules (guix build utils))
164 (let* ((source (assoc-ref %build-inputs "source"))
165 (output (assoc-ref %outputs "out"))
166 (incdir (string-append output "/include"))
167 (docdir (string-append output "/share/doc/catch-"
168 ,version)))
169 (begin
170 (for-each mkdir-p (list incdir docdir))
171 (install-file (string-append source
172 "/single_include/catch.hpp")
173 incdir)
174 (copy-recursively (string-append source "/docs")
175 docdir))))))
176 (home-page "http://catch-lib.net/")
177 (synopsis "Automated test framework for C++ and Objective-C")
178 (description
179 "Catch stands for C++ Automated Test Cases in Headers and is a
180 multi-paradigm automated test framework for C++ and Objective-C.")
181 (license license:boost1.0)))
182
183 (define-public cmdtest
184 (package
185 (name "cmdtest")
186 (version "0.29")
187 (source (origin
188 (method url-fetch)
189 (uri (string-append "http://git.liw.fi/cmdtest/snapshot/"
190 name "-" version ".tar.gz"))
191 (sha256
192 (base32
193 "1i6gi4yp4qqx1liax098c7nwdb24pghh11xqlrcs7lnhh079rqhb"))))
194 (build-system python-build-system)
195 (arguments
196 `(#:python ,python-2
197 #:phases
198 (modify-phases %standard-phases
199 ;; check phase needs to be run before the build phase. If not, the
200 ;; coverage test runner looks for tests for the built source files,
201 ;; and fails.
202 (delete 'check)
203 (add-before 'build 'check
204 (lambda _
205 (substitute* "yarn"
206 (("/bin/sh") (which "sh")))
207 ;; yarn uses python2-ttystatus to print messages.
208 ;; python2-ttystatus requires /dev/tty which is not present in
209 ;; the build environment. Hence assuming-failure test fails.
210 (delete-file "yarn.tests/assuming-failure.script")
211 (delete-file "yarn.tests/assuming-failure.stdout")
212 (zero? (system* "python" "setup.py" "check")))))))
213 (native-inputs
214 `(("python2-coverage-test-runner" ,python2-coverage-test-runner)))
215 (propagated-inputs
216 `(("python2-cliapp" ,python2-cliapp)
217 ("python2-markdown" ,python2-markdown)
218 ("python2-ttystatus" ,python2-ttystatus)))
219 (home-page "https://liw.fi/cmdtest/")
220 (synopsis "Black box Unix program tester")
221 (description
222 "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
223 given a command line and input files, and the expected output, and it verifies
224 that the command line produces the expected output. If not, it reports a
225 problem, and shows the differences.")
226 (license license:gpl3+)))
227
228 (define-public cmocka
229 (package
230 (name "cmocka")
231 (version "1.1.1")
232 (source (origin
233 (method url-fetch)
234 (uri (string-append "https://cmocka.org/files/"
235 (version-major+minor version) "/cmocka-"
236 version ".tar.xz"))
237 (sha256
238 (base32
239 "1283zi9qf5613g8iadm1fxmjh4rzxqd5np2j3lcpgairf25g8bph"))))
240 (build-system cmake-build-system)
241 (arguments
242 `(#:tests? #f)) ; No test target
243 (home-page "https://cmocka.org/")
244 (synopsis "Unit testing framework for C")
245 (description "Cmocka is a unit testing framework for C with support for
246 mock objects. It only requires the standard C library, and works with
247 different compilers. Cmocka supports several different message output formats
248 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
249 format.")
250 (license license:asl2.0)))
251
252 (define-public cppcheck
253 (package
254 (name "cppcheck")
255 (version "1.81")
256 (source (origin
257 (method url-fetch)
258 (uri (string-append "https://github.com/danmar/cppcheck/archive/"
259 version ".tar.gz"))
260 (sha256
261 (base32 "0miamqk7pa2dzmnmi5wb6hjp2a3zya1x8afnlcxby8jb6gp6wf8j"))
262 (file-name (string-append name "-" version ".tar.gz"))))
263 (build-system cmake-build-system)
264 (home-page "http://cppcheck.sourceforge.net")
265 (synopsis "Static C/C++ code analyzer")
266 (description "Cppcheck is a static code analyzer for C and C++. Unlike
267 C/C++ compilers and many other analysis tools it does not detect syntax errors
268 in the code. Cppcheck primarily detects the types of bugs that the compilers
269 normally do not detect. The goal is to detect only real errors in the code
270 (i.e. have zero false positives).")
271 (license license:gpl3+)))
272
273 (define-public googletest
274 (package
275 (name "googletest")
276 (version "1.8.0")
277 (source
278 (origin
279 (method url-fetch)
280 (uri (string-append "https://github.com/google/googletest/archive/"
281 "release-" version ".tar.gz"))
282 (file-name (string-append name "-" version ".tar.gz"))
283 (sha256
284 (base32
285 "1n5p1m2m3fjrjdj752lf92f9wq3pl5cbsfrb49jqbg52ghkz99jq"))))
286 (build-system cmake-build-system)
287 (arguments
288 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
289 (native-inputs
290 `(("python-2" ,python-2)))
291 (home-page "https://github.com/google/googletest/")
292 (synopsis "Test discovery and XUnit test framework")
293 (description "Google Test features an XUnit test framework, automated test
294 discovery, death tests, assertions, parameterized tests and XML test report
295 generation.")
296 (license license:bsd-3)))
297
298 (define-public cpputest
299 (package
300 (name "cpputest")
301 (version "3.8")
302 (source
303 (origin
304 (method url-fetch)
305 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
306 version "/cpputest-" version ".tar.gz"))
307 (sha256
308 (base32
309 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
310 (build-system gnu-build-system)
311 (native-inputs
312 `(("googletest" ,googletest)))
313 (home-page "https://cpputest.github.io/")
314 (synopsis "Unit testing and mocking framework for C/C++")
315 (description
316 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
317 C++ but is used in C and C++ projects and frequently used in embedded systems
318 but it works for any C/C++ project.")
319 (license license:bsd-3)))
320
321 (define-public python-parameterized
322 (package
323 (name "python-parameterized")
324 (version "0.6.1")
325 (source
326 (origin
327 (method url-fetch)
328 (uri (pypi-uri "parameterized" version))
329 (sha256
330 (base32
331 "1qj1939shm48d9ql6fm1nrdy4p7sdyj8clz1szh5swwpf1qqxxfa"))))
332 (build-system python-build-system)
333 (arguments '(#:tests? #f)) ; there are no tests
334 (home-page "https://github.com/wolever/parameterized")
335 (synopsis "Parameterized testing with any Python test framework")
336 (description
337 "Parameterized is a Python library that aims to fix parameterized testing
338 for every Python test framework. It supports nose, py.test, and unittest.")
339 (license license:bsd-2)))
340
341 (define-public python2-parameterized
342 (package-with-python2 python-parameterized))
343
344 (define-public python-mock
345 (package
346 (name "python-mock")
347 (version "2.0.0")
348 (source
349 (origin
350 (method url-fetch)
351 (uri (pypi-uri "mock" version))
352 (sha256
353 (base32
354 "1flbpksir5sqrvq2z0dp8sl4bzbadg21sj4d42w3klpdfvgvcn5i"))))
355 (propagated-inputs
356 `(("python-pbr" ,python-pbr-minimal)
357 ("python-six" ,python-six)))
358 (build-system python-build-system)
359 (native-inputs
360 `(("python-unittest2" ,python-unittest2)))
361 (arguments
362 `(#:phases
363 (modify-phases %standard-phases
364 (replace 'check
365 (lambda _
366 (zero? (system* "unit2")))))))
367 (home-page "https://github.com/testing-cabal/mock")
368 (synopsis "Python mocking and patching library for testing")
369 (description
370 "Mock is a library for testing in Python. It allows you to replace parts
371 of your system under test with mock objects and make assertions about how they
372 have been used.")
373 (properties `((python2-variant . ,(delay python2-mock))))
374 (license license:expat)))
375
376 (define-public python2-mock
377 (let ((base (package-with-python2
378 (strip-python2-variant python-mock))))
379 (package (inherit base)
380 (propagated-inputs
381 `(("python2-functools32" ,python2-functools32)
382 ("python2-funcsigs" ,python2-funcsigs)
383 ,@(package-propagated-inputs base))))))
384
385 (define-public python-nose
386 (package
387 (name "python-nose")
388 (version "1.3.7")
389 (source
390 (origin
391 (method url-fetch)
392 (uri (pypi-uri "nose" version))
393 (sha256
394 (base32
395 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
396 (build-system python-build-system)
397 (arguments
398 '(#:tests? #f)) ; FIXME: test suite fails
399 (home-page "http://readthedocs.org/docs/nose/")
400 (synopsis "Python testing library")
401 (description
402 "Nose extends the unittest library to make testing easier.")
403 (license license:lgpl2.0+)))
404
405 (define-public python2-nose
406 (package-with-python2 python-nose))
407
408 (define-public python-nose2
409 (package
410 (name "python-nose2")
411 (version "0.6.5")
412 (source
413 (origin
414 (method url-fetch)
415 (uri (pypi-uri "nose2" version))
416 (sha256
417 (base32
418 "1x4zjq1zlyrh8b9ba0cmafd3w94pxhid408kibyjd3s6h1lap6s7"))))
419 (build-system python-build-system)
420 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
421 (propagated-inputs
422 `(("python-cov-core" ,python-cov-core)
423 ("python-pytest-cov" ,python-pytest-cov)
424 ("python-six" ,python-six)))
425 (home-page "https://github.com/nose-devs/nose2")
426 (synopsis "Next generation of nicer testing for Python")
427 (description
428 "Nose2 is the next generation of nicer testing for Python, based on the
429 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
430 better plugin api, being easier for users to configure, and simplifying internal
431 interfaces and processes.")
432 (license license:bsd-2)))
433
434 (define-public python2-nose2
435 (package-with-python2 python-nose2))
436
437 (define-public python-unittest2
438 (package
439 (name "python-unittest2")
440 (version "1.1.0")
441 (source
442 (origin
443 (method url-fetch)
444 (uri (pypi-uri "unittest2" version))
445 (patches
446 (search-patches "python-unittest2-python3-compat.patch"
447 "python-unittest2-remove-argparse.patch"))
448 (sha256
449 (base32
450 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
451 (build-system python-build-system)
452 (arguments
453 '(#:phases
454 (modify-phases %standard-phases
455 (replace 'check
456 (lambda _
457 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
458 (propagated-inputs
459 `(("python-six" ,python-six)
460 ("python-traceback2" ,python-traceback2)))
461 (home-page "http://pypi.python.org/pypi/unittest2")
462 (synopsis "Python unit testing library")
463 (description
464 "Unittest2 is a replacement for the unittest module in the Python
465 standard library.")
466 (license license:psfl)))
467
468 (define-public python2-unittest2
469 (package-with-python2 python-unittest2))
470
471 (define-public python-pytest
472 (package
473 (name "python-pytest")
474 (version "3.2.3")
475 (source
476 (origin
477 (method url-fetch)
478 (uri (pypi-uri "pytest" version))
479 (sha256
480 (base32
481 "0g6w86ks73fnrnsyib9ii2rbyx830vn7aglsjqz9v1n2xwbndyi7"))))
482 (build-system python-build-system)
483 (arguments
484 `(#:phases
485 (modify-phases %standard-phases
486 (add-before 'check 'disable-invalid-tests
487 (lambda _
488 ;; Some tests involves the /usr directory, and fails.
489 (substitute* "testing/test_argcomplete.py"
490 (("def test_remove_dir_prefix\\(self\\):")
491 "@pytest.mark.xfail\n def test_remove_dir_prefix(self):"))
492 (substitute* "testing/test_argcomplete.py"
493 (("def test_remove_dir_prefix" line)
494 (string-append "@pytest.mark.skip"
495 "(reason=\"Assumes that /usr exists.\")\n "
496 line)))
497 #t)))))
498 (propagated-inputs
499 `(("python-py" ,python-py)))
500 (native-inputs
501 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
502 ("bash" ,bash)
503 ("python-hypothesis" ,python-hypothesis)
504 ("python-nose" ,python-nose)
505 ("python-mock" ,python-mock)
506 ("python-setuptools-scm" ,python-setuptools-scm)))
507 (home-page "http://pytest.org")
508 (synopsis "Python testing library")
509 (description
510 "Pytest is a testing tool that provides auto-discovery of test modules
511 and functions, detailed info on failing assert statements, modular fixtures,
512 and many external plugins.")
513 (license license:expat)))
514
515 (define-public python2-pytest
516 (package-with-python2 python-pytest))
517
518 (define-public python-pytest-bootstrap
519 (package
520 (inherit python-pytest)
521 (name "python-pytest-bootstrap")
522 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
523 (arguments `(#:tests? #f))))
524
525 (define-public python2-pytest-bootstrap
526 (package-with-python2 python-pytest-bootstrap))
527
528 (define-public python-pytest-cov
529 (package
530 (name "python-pytest-cov")
531 (version "2.4.0")
532 (source
533 (origin
534 (method url-fetch)
535 (uri (pypi-uri "pytest-cov" version))
536 (sha256
537 (base32
538 "03c2qc42r4bczyw93gd7n0qi1h1jfhw7fnbhi33c3vp1hs81gm2k"))))
539 (build-system python-build-system)
540 (arguments
541 `(#:phases
542 (modify-phases %standard-phases
543 (replace 'check
544 (lambda _
545 ;; options taken from tox.ini
546 ;; TODO: make "--restructuredtext" tests pass. They currently fail
547 ;; with "Duplicate implicit target name"
548 (zero? (system* "python" "./setup.py" "check"
549 "--strict" "--metadata")))))))
550 (propagated-inputs
551 `(("python-coverage" ,python-coverage)
552 ("python-pytest" ,python-pytest)))
553 (home-page "https://github.com/pytest-dev/pytest-cov")
554 (synopsis "Pytest plugin for measuring coverage")
555 (description
556 "Pytest-cov produces coverage reports. It supports centralised testing and
557 distributed testing in both @code{load} and @code{each} modes. It also
558 supports coverage of subprocesses.")
559 (license license:expat)))
560
561 (define-public python2-pytest-cov
562 (package-with-python2 python-pytest-cov))
563
564 (define-public python-pytest-runner
565 (package
566 (name "python-pytest-runner")
567 (version "2.11.1")
568 (source
569 (origin
570 (method url-fetch)
571 (uri (pypi-uri "pytest-runner" version))
572 (sha256
573 (base32
574 "1cw978kqqcq916b9gfns1qjqvg33c5ail5jhw9054dsynkm32flq"))))
575 (build-system python-build-system)
576 (arguments
577 `(#:phases
578 (modify-phases %standard-phases
579 ;; The fancy way of setting the version with setuptools_scm does not
580 ;; seem to work here.
581 (add-after 'unpack 'set-version
582 (lambda _
583 (substitute* "docs/conf.py"
584 (("version = setuptools_scm\\.get_version\\(root='\\.\\.')")
585 (string-append "version = \"" ,version "\"")))
586 #t)))))
587 (native-inputs
588 `(("python-pytest" ,python-pytest-bootstrap)
589 ("python-setuptools-scm" ,python-setuptools-scm)))
590 (home-page "https://github.com/pytest-dev/pytest-runner")
591 (synopsis "Invoke py.test as a distutils command")
592 (description
593 "This package provides a @command{pytest-runner} command that
594 @file{setup.py} files can use to run tests.")
595 (license license:expat)))
596
597 (define-public python2-pytest-runner
598 (package-with-python2 python-pytest-runner))
599
600 (define-public python-pytest-mock
601 (package
602 (name "python-pytest-mock")
603 (version "1.2")
604 (source
605 (origin
606 (method url-fetch)
607 (uri (pypi-uri "pytest-mock" version ".zip"))
608 (sha256
609 (base32
610 "03zxar5drzm7ksqyrwypjaza3cri6wqvpr6iam92djvg6znp32gp"))))
611 (build-system python-build-system)
612 (native-inputs
613 `(("unzip" ,unzip)))
614 (propagated-inputs
615 `(("python-pytest" ,python-pytest)))
616 (home-page "https://github.com/pytest-dev/pytest-mock/")
617 (synopsis "Thin-wrapper around the mock package for easier use with py.test")
618 (description
619 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
620 around the patching API provided by the @code{mock} package, but with the
621 benefit of not having to worry about undoing patches at the end of a test.
622 The mocker fixture has the same API as @code{mock.patch}, supporting the
623 same arguments.")
624 (properties `((python2-variant . ,(delay python2-pytest-mock))))
625 (license license:expat)))
626
627 (define-public python2-pytest-mock
628 (let ((base (package-with-python2
629 (strip-python2-variant python-pytest-mock))))
630 (package (inherit base)
631 (propagated-inputs
632 `(("python2-mock" ,python2-mock)
633 ,@(package-propagated-inputs base))))))
634
635 (define-public python-pytest-xdist
636 (package
637 (name "python-pytest-xdist")
638 (version "1.14")
639 (source
640 (origin
641 (method url-fetch)
642 (uri (pypi-uri "pytest-xdist" version ".zip"))
643 (sha256
644 (base32
645 "08rn2l39ds60xshs4js787l84pfckksqklfq2wq9x8ig2aci2pja"))
646 (modules '((guix build utils)))
647 (snippet
648 '(begin
649 ;; Remove pre-compiled .pyc files from source.
650 (for-each delete-file-recursively
651 (find-files "." "__pycache__" #:directories? #t))
652 (for-each delete-file (find-files "." "\\.pyc$"))
653 #t))))
654 (build-system python-build-system)
655 (arguments
656 '(#:tests? #f)) ;FIXME: Some tests are failing.
657 ;; #:phases
658 ;; (modify-phases %standard-phases
659 ;; (delete 'check)
660 ;; (add-after 'install 'check
661 ;; (lambda* (#:key inputs outputs #:allow-other-keys)
662 ;; (add-installed-pythonpath inputs outputs)
663 ;; (zero? (system* "py.test" "-v")))))
664 (native-inputs
665 `(("unzip" ,unzip)
666 ("python-setuptools-scm" ,python-setuptools-scm)))
667 (propagated-inputs
668 `(("python-execnet" ,python-execnet)
669 ("python-pytest" ,python-pytest)
670 ("python-py" ,python-py)))
671 (home-page
672 "https://github.com/pytest-dev/pytest-xdist")
673 (synopsis
674 "Plugin for py.test with distributed testing and loop-on-failing modes")
675 (description
676 "The pytest-xdist plugin extends py.test with some unique test execution
677 modes: parallelization, running tests in boxed subprocesses, the ability
678 to run tests repeatedly when failed, and the ability to run tests on multiple
679 Python interpreters or platforms. It uses rsync to copy the existing
680 program code to a remote location, executes there, and then syncs the
681 result back.")
682 (license license:expat)))
683
684 (define-public python2-pytest-xdist
685 (package-with-python2 python-pytest-xdist))
686
687 (define-public python-scripttest
688 (package
689 (name "python-scripttest")
690 (version "1.3")
691 (source
692 (origin
693 (method url-fetch)
694 (uri (string-append
695 "https://pypi.python.org/packages/source/s/scripttest/scripttest-"
696 version ".tar.gz"))
697 (sha256
698 (base32
699 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
700 (build-system python-build-system)
701 (native-inputs
702 `(("python-pytest" ,python-pytest)))
703 (home-page "http://pythonpaste.org/scripttest/")
704 (synopsis "Python library to test command-line scripts")
705 (description "Scripttest is a Python helper library for testing
706 interactive command-line applications. With it you can run a script in a
707 subprocess and see the output as well as any file modifications.")
708 (license license:expat)))
709
710 (define-public python2-scripttest
711 (package-with-python2 python-scripttest))
712
713 (define-public python-testtools
714 (package
715 (name "python-testtools")
716 (version "1.4.0")
717 (source
718 (origin
719 (method url-fetch)
720 (uri (pypi-uri "testtools" version))
721 (sha256
722 (base32
723 "1vw8yljnd75d396hhw6s2hrf4cclzy845ifd5am0lxsl235z3i8c"))))
724 (build-system python-build-system)
725 (arguments
726 `(#:phases
727 (modify-phases %standard-phases
728 (add-after 'unpack 'fix-module-imports
729 (lambda _
730 (substitute* "setup.py"
731 (("'unittest2>=0.8.0',") ""))
732 (substitute* '("testtools/testcase.py"
733 "testtools/testsuite.py"
734 "testtools/run.py"
735 "testtools/tests/test_run.py"
736 "testtools/tests/test_testsuite.py"
737 "testtools/tests/test_deferredruntest.py")
738 ;; unittest2 is a backport of Python2.7 features to Python 2.4.
739 (("import unittest2 as unittest") "import unittest")
740 (("import unittest2") "import unittest as unittest2")
741 (("from unittest2 import") "from unittest import"))
742 (substitute* "testtools/tests/test_testresult.py"
743 ;; NUL in source code is not allowed (raises ValueError).
744 (("\\x00\\x04") "\\x04"))
745 #t)))))
746 (propagated-inputs
747 `(("python-mimeparse" ,python-mimeparse)
748 ("python-extras" ,python-extras)))
749 (home-page "https://github.com/testing-cabal/testtools")
750 (synopsis
751 "Extensions to the Python standard library unit testing framework")
752 (description
753 "Testtools extends the Python standard library unit testing framework to
754 provide matchers, more debugging information, and cross-Python
755 compatibility.")
756 (license license:psfl)))
757
758 (define-public python2-testtools
759 (package-with-python2 python-testtools))
760
761 (define-public python-testscenarios
762 (package
763 (name "python-testscenarios")
764 (version "0.4")
765 (source
766 (origin
767 (method url-fetch)
768 (uri (string-append
769 "https://pypi.python.org/packages/source/t/testscenarios/testscenarios-"
770 version ".tar.gz"))
771 (sha256
772 (base32
773 "1671jvrvqlmbnc42j7pc5y6vc37q44aiwrq0zic652pxyy2fxvjg"))))
774 (build-system python-build-system)
775 (propagated-inputs
776 `(("python-testtools" ,python-testtools)))
777 (home-page "https://launchpad.net/testscenarios")
778 (synopsis "Pyunit extension for dependency injection")
779 (description
780 "Testscenarios provides clean dependency injection for Python unittest
781 style tests.")
782 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
783
784 (define-public python2-testscenarios
785 (package-with-python2 python-testscenarios))
786
787 (define-public python-testresources
788 (package
789 (name "python-testresources")
790 (version "0.2.7")
791 (source
792 (origin
793 (method url-fetch)
794 (uri (string-append
795 "https://pypi.python.org/packages/source/t/testresources/testresources-"
796 version ".tar.gz"))
797 (sha256
798 (base32
799 "0cbj3plbllyz42c4b5xxgwaa7mml54lakslrn4kkhinxhdri22md"))))
800 (build-system python-build-system)
801 (home-page "https://launchpad.net/testresources")
802 (synopsis
803 "Pyunit extension for managing test resources")
804 (description
805 "Testresources is an extension to Python's unittest to allow declarative
806 use of resources by test cases.")
807 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
808
809 (define-public python2-testresources
810 (package-with-python2 python-testresources))
811
812 (define-public python-subunit
813 (package
814 (name "python-subunit")
815 (version "0.0.21")
816 (source
817 (origin
818 (method url-fetch)
819 (uri (string-append
820 "https://pypi.python.org/packages/source/p/python-subunit/python-subunit-"
821 version ".tar.gz"))
822 (sha256
823 (base32
824 "1nkw9wfbvizmpajbj3in8ns07g7lwkiv8hip14jjlwk3cacls6jv"))))
825 (build-system python-build-system)
826 (propagated-inputs
827 `(("python-extras" ,python-extras)
828 ("python-mimeparse" ,python-mimeparse)))
829 (native-inputs
830 `(("python-testscenarios" ,python-testscenarios)))
831 (home-page "http://launchpad.net/subunit")
832 (synopsis "Python implementation of the subunit protocol")
833 (description
834 "Python-subunit is a Python implementation of the subunit test streaming
835 protocol.")
836 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
837
838 (define-public python2-subunit
839 (package-with-python2 python-subunit))
840
841 (define-public python-fixtures
842 (package
843 (name "python-fixtures")
844 (version "1.4.0")
845 (source
846 (origin
847 (method url-fetch)
848 (uri (pypi-uri "fixtures" version))
849 (sha256
850 (base32
851 "0djxvdwm8s60dbfn7bhf40x6g818p3b3mlwijm1c3bqg7msn271y"))))
852 (build-system python-build-system)
853 (arguments
854 '(#:phases
855 (modify-phases %standard-phases
856 (replace 'check
857 (lambda _
858 (zero? (system* "python" "-m" "testtools.run"
859 "fixtures.test_suite")))))))
860 (propagated-inputs
861 `(("python-six" ,python-six)))
862 (native-inputs
863 `(("python-mock" ,python-mock)
864 ("python-pbr-minimal" ,python-pbr-minimal)
865 ("python-testtools" ,python-testtools)))
866 (home-page "https://launchpad.net/python-fixtures")
867 (synopsis "Python test fixture library")
868 (description
869 "Fixtures provides a way to create reusable state, useful when writing
870 Python tests.")
871 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
872
873 (define-public python2-fixtures
874 (package-with-python2 python-fixtures))
875
876 (define-public python-testrepository
877 (package
878 (name "python-testrepository")
879 (version "0.0.20")
880 (source
881 (origin
882 (method url-fetch)
883 (uri (string-append
884 "https://pypi.python.org/packages/source/t/testrepository/testrepository-"
885 version ".tar.gz"))
886 (sha256
887 (base32
888 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
889 (build-system python-build-system)
890 (arguments
891 ;; FIXME: Many tests are failing.
892 '(#:tests? #f))
893 (propagated-inputs
894 `(("python-fixtures" ,python-fixtures)
895 ("python-subunit" ,python-subunit)
896 ("python-testtools" ,python-testtools)))
897 (native-inputs
898 `(("python-pbr-minimal" ,python-pbr-minimal) ;; same as for building fixture
899 ("python-mimeparse" ,python-mimeparse)))
900 (home-page "https://launchpad.net/testrepository")
901 (synopsis "Database for Python test results")
902 (description "Testrepository provides a database of test results which can
903 be used as part of a developer's workflow to check things such as what tests
904 have failed since the last commit or what tests are currently failing.")
905 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
906
907 (define-public python2-testrepository
908 (package-with-python2 python-testrepository))
909
910 (define-public python-coverage
911 (package
912 (name "python-coverage")
913 (version "4.4.1")
914 (source
915 (origin
916 (method url-fetch)
917 (uri (pypi-uri "coverage" version))
918 (sha256
919 (base32
920 "097l4s3ssxm1vncsn0nw3a1pbzah28773q36c1ab9wz01r04973s"))))
921 (build-system python-build-system)
922 (arguments
923 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
924 '(#:tests? #f))
925 (home-page "http://nedbatchelder.com/code/coverage")
926 (synopsis "Code coverage measurement for Python")
927 (description
928 "Coverage measures code coverage, typically during test execution. It
929 uses the code analysis tools and tracing hooks provided in the Python standard
930 library to determine which lines are executable, and which have been
931 executed.")
932 (license license:bsd-3)))
933
934 (define-public python2-coverage
935 (package-with-python2 python-coverage))
936
937 (define-public python-cov-core
938 (package
939 (name "python-cov-core")
940 (version "1.15.0")
941 (source
942 (origin
943 (method url-fetch)
944 (uri (pypi-uri "cov-core" version))
945 (sha256
946 (base32
947 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
948 (build-system python-build-system)
949 (propagated-inputs
950 `(("python-coverage" ,python-coverage)))
951 (home-page "https://github.com/schlamar/cov-core")
952 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
953 (description
954 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
955 and @code{nose2-cov}. It is useful for developing coverage plugins for these
956 testing frameworks.")
957 (license license:expat)))
958
959 (define-public python2-cov-core
960 (package-with-python2 python-cov-core))
961
962 (define-public python-testpath
963 (package
964 (name "python-testpath")
965 (version "0.2")
966 (source
967 (origin
968 (method url-fetch)
969 (uri (string-append "https://github.com/jupyter/testpath/archive/"
970 version ".tar.gz"))
971 (file-name (string-append name "-" version ".tar.gz"))
972 (sha256
973 (base32
974 "04kh3fgvmqz6cfcw79q70qwjz7ib7lxm27cc548iy2rpr33qqf55"))))
975 (build-system python-build-system)
976 (arguments
977 `(#:tests? #f ; this package does not even have a setup.py
978 #:modules ((guix build python-build-system)
979 (guix build utils)
980 (srfi srfi-1))
981 #:imported-modules (,@%python-build-system-modules
982 (srfi srfi-1))
983 #:phases
984 (modify-phases %standard-phases
985 (delete 'install)
986 (replace 'build
987 (lambda* (#:key inputs outputs #:allow-other-keys)
988 (let* ((version (last
989 (string-split (assoc-ref inputs "python") #\-)))
990 (x.y (string-join (take (string-split version #\.) 2)
991 "."))
992 (dir (string-append
993 (assoc-ref outputs "out")
994 "/lib/python" x.y "/site-packages/testpath")))
995 (mkdir-p dir)
996 (copy-recursively "testpath" dir))
997 #t)))))
998 (home-page "https://github.com/takluyver/testpath")
999 (synopsis "Test utilities for code working with files and commands")
1000 (description
1001 "Testpath is a collection of utilities for Python code working with files
1002 and commands. It contains functions to check things on the file system, and
1003 tools for mocking system commands and recording calls to those.")
1004 (license license:expat)))
1005
1006 (define-public python2-testpath
1007 (package-with-python2 python-testpath))
1008
1009 (define-public python-testlib
1010 (package
1011 (name "python-testlib")
1012 (version "0.6.5")
1013 (source
1014 (origin
1015 (method url-fetch)
1016 (uri (string-append
1017 "https://pypi.python.org/packages/source/t/testlib/testlib-"
1018 version ".zip"))
1019 (sha256
1020 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1021 (build-system python-build-system)
1022 (native-inputs
1023 `(("unzip" ,unzip))) ; for unpacking the source
1024 (synopsis "Python micro test suite harness")
1025 (description "A micro unittest suite harness for Python.")
1026 (home-page "https://github.com/trentm/testlib")
1027 (license license:expat)))
1028
1029 (define-public python2-testlib
1030 (package-with-python2 python-testlib))
1031
1032 ;;; The software provided by this package was integrated into pytest 2.8.
1033 (define-public python-pytest-cache
1034 (package
1035 (name "python-pytest-cache")
1036 (version "1.0")
1037 (source (origin
1038 (method url-fetch)
1039 (uri (pypi-uri "pytest-cache" version))
1040 (sha256
1041 (base32
1042 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1043 (build-system python-build-system)
1044 (propagated-inputs
1045 `(("python-apipkg" ,python-apipkg)
1046 ("python-execnet" ,python-execnet)
1047 ("python-py" ,python-py)
1048 ("python-pytest" ,python-pytest)))
1049 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1050 (description "The pytest-cache plugin provides tools to rerun failures from
1051 the last py.test invocation.")
1052 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1053 (license license:expat)))
1054
1055 (define-public python2-pytest-cache
1056 (package-with-python2 python-pytest-cache))
1057
1058 (define-public python-pytest-localserver
1059 (package
1060 (name "python-pytest-localserver")
1061 (version "0.4.1")
1062 (source (origin
1063 (method url-fetch)
1064 (uri (pypi-uri "pytest-localserver" version))
1065 (sha256
1066 (base32
1067 "08f06rvj31wqf0vgmd1waya87r7vy6x8ck48lxl3dxy83q5gcam7"))))
1068 (build-system python-build-system)
1069 (arguments
1070 `(#:phases (modify-phases %standard-phases
1071 (replace 'check
1072 (lambda _
1073 (zero? (system* "py.test" "--genscript=runtests.py"))
1074 (zero? (system* "py.test")))))))
1075 (native-inputs
1076 `(("python-pytest" ,python-pytest)
1077 ("python-requests" ,python-requests)
1078 ("python-six" ,python-six)))
1079 (propagated-inputs
1080 `(("python-werkzeug" ,python-werkzeug)))
1081 (synopsis "Py.test plugin to test server connections locally")
1082 (description "Pytest-localserver is a plugin for the pytest testing
1083 framework which enables you to test server connections locally.")
1084 (home-page "https://pypi.python.org/pypi/pytest-localserver")
1085 (license license:expat)))
1086
1087 (define-public python-pytest-xprocess
1088 (package
1089 (name "python-pytest-xprocess")
1090 (version "0.9.1")
1091 (source (origin
1092 (method url-fetch)
1093 (uri (pypi-uri "pytest-xprocess" version))
1094 (sha256
1095 (base32
1096 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1097 (build-system python-build-system)
1098 (propagated-inputs
1099 `(("python-pytest" ,python-pytest)
1100 ("python-pytest-cache" ,python-pytest-cache)
1101 ("python-psutil" ,python-psutil)))
1102 (synopsis "Pytest plugin to manage external processes across test runs")
1103 (description "Pytest-xprocess is an experimental py.test plugin for managing
1104 processes across test runs.")
1105 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1106 (license license:expat)))
1107
1108 (define-public python-pytest-subtesthack
1109 (package
1110 (name "python-pytest-subtesthack")
1111 (version "0.1.1")
1112 (source (origin
1113 (method url-fetch)
1114 (uri (pypi-uri "pytest-subtesthack" version))
1115 (sha256
1116 (base32
1117 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1118 (build-system python-build-system)
1119 (propagated-inputs
1120 `(("python-pytest" ,python-pytest)))
1121 (synopsis "Set-up and tear-down fixtures for unit tests")
1122 (description "This plugin allows you to set up and tear down fixtures within
1123 unit test functions that use @code{py.test}. This is useful for using
1124 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1125 function multiple times, without setting up or tearing down fixture state as is
1126 normally the case.")
1127 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1128 (license license:unlicense)))
1129
1130 (define-public python2-pytest-subtesthack
1131 (package-with-python2 python-pytest-subtesthack))
1132
1133 (define-public python-hypothesis
1134 (package
1135 (name "python-hypothesis")
1136 (version "3.1.0")
1137 (source (origin
1138 (method url-fetch)
1139 (uri (pypi-uri "hypothesis" version))
1140 (sha256
1141 (base32
1142 "0qyqq9akm4vshhn8cngjc1qykcvsn7cz6dlm6njfsgpbraqrmbbw"))))
1143 (build-system python-build-system)
1144 (native-inputs
1145 `(("python-flake8" ,python-flake8)
1146 ("python-pytest" ,python-pytest-bootstrap)))
1147 (synopsis "Library for property based testing")
1148 (description "Hypothesis is a library for testing your Python code against a
1149 much larger range of examples than you would ever want to write by hand. It’s
1150 based on the Haskell library, Quickcheck, and is designed to integrate
1151 seamlessly into your existing Python unit testing work flow.")
1152 (home-page "https://github.com/DRMacIver/hypothesis")
1153 (license license:mpl2.0)
1154 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1155
1156 (define-public python2-hypothesis
1157 (let ((hypothesis (package-with-python2
1158 (strip-python2-variant python-hypothesis))))
1159 (package (inherit hypothesis)
1160 (propagated-inputs
1161 `(("python2-enum34" ,python2-enum34)
1162 ,@(package-propagated-inputs hypothesis))))))
1163
1164 (define-public python-lit
1165 (package
1166 (name "python-lit")
1167 (version "0.5.1")
1168 (source
1169 (origin
1170 (method url-fetch)
1171 (uri (pypi-uri "lit" version))
1172 (sha256
1173 (base32
1174 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
1175 (build-system python-build-system)
1176 (arguments
1177 `(#:phases
1178 (modify-phases %standard-phases
1179 (replace 'check
1180 (lambda _
1181 (invoke "python" "lit.py" "tests"))))))
1182 (native-inputs
1183 `(("llvm" ,llvm)))
1184 (home-page "https://llvm.org/")
1185 (synopsis "LLVM Software Testing Tool")
1186 (description "@code{lit} is a portable tool for executing LLVM and Clang
1187 style test suites, summarizing their results, and providing indication of
1188 failures.")
1189 (license license:ncsa)))
1190
1191 (define-public python2-lit
1192 (package-with-python2 python-lit))
1193
1194 (define-public python-pytest-pep8
1195 (package
1196 (name "python-pytest-pep8")
1197 (version "1.0.6")
1198 (source (origin
1199 (method url-fetch)
1200 (uri (pypi-uri "pytest-pep8" version))
1201 (sha256
1202 (base32
1203 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
1204 (build-system python-build-system)
1205 (arguments
1206 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
1207 (native-inputs
1208 `(("python-pytest" ,python-pytest)))
1209 (propagated-inputs
1210 `(("python-pep8" ,python-pep8)))
1211 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
1212 (synopsis "Py.test plugin to check PEP8 requirements")
1213 (description "Pytest plugin for checking PEP8 compliance.")
1214 (license license:expat)))
1215
1216 (define-public python2-pytest-pep8
1217 (package-with-python2 python-pytest-pep8))
1218
1219 (define-public python-pytest-flakes
1220 (package
1221 (name "python-pytest-flakes")
1222 (version "1.0.1")
1223 (source (origin
1224 (method url-fetch)
1225 (uri (pypi-uri "pytest-flakes" version))
1226 (sha256
1227 (base32
1228 "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
1229 (build-system python-build-system)
1230 (arguments
1231 `(#:phases
1232 (modify-phases %standard-phases
1233 (delete 'check)
1234 (add-after 'install 'check
1235 (lambda* (#:key outputs inputs #:allow-other-keys)
1236 ;; It's easier to run tests after install.
1237 ;; Make installed package available for running the tests
1238 (add-installed-pythonpath inputs outputs)
1239 (zero? (system* "py.test" "-vv")))))))
1240 (native-inputs
1241 `(("python-coverage" ,python-coverage)
1242 ("python-pytest" ,python-pytest)
1243 ("python-pytest-cache" ,python-pytest-cache)
1244 ("python-pytest-pep8" ,python-pytest-pep8)))
1245 (propagated-inputs
1246 `(("python-pyflakes" ,python-pyflakes)))
1247 (home-page "https://github.com/fschulze/pytest-flakes")
1248 (synopsis "Py.test plugin to check source code with pyflakes")
1249 (description "Pytest plugin for checking Python source code with pyflakes.")
1250 (license license:expat)))
1251
1252 (define-public python2-pytest-flakes
1253 (package-with-python2 python-pytest-flakes))
1254
1255 (define-public python2-coverage-test-runner
1256 (package
1257 (name "python2-coverage-test-runner")
1258 (version "1.11")
1259 (source
1260 (origin
1261 (method url-fetch)
1262 (uri (string-append
1263 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
1264 "coverage-test-runner/snapshot/coverage-test-runner-"
1265 version ".tar.gz"))
1266 (sha256
1267 (base32
1268 "0y1m7z3dl63kmhcmydl1mwg0hacnf6ghrx9dah17j9iasssfa3g7"))))
1269 (build-system python-build-system)
1270 (arguments
1271 `(#:python ,python-2
1272 #:phases
1273 (modify-phases %standard-phases
1274 (replace 'check
1275 (lambda _
1276 (zero? (system* "./testrun")))))))
1277 (propagated-inputs
1278 `(("python2-coverage" ,python2-coverage)))
1279 (home-page "https://liw.fi/coverage-test-runner/")
1280 (synopsis "Python module for running unit tests")
1281 (description "@code{CoverageTestRunner} is a python module for running
1282 unit tests and failing them if the unit test module does not exercise all
1283 statements in the module it tests.")
1284 (license license:gpl3+)))
1285
1286 (define-public python-pylint
1287 (package
1288 (name "python-pylint")
1289 (version "1.7.2")
1290 (source
1291 (origin
1292 (method url-fetch)
1293 (uri (string-append
1294 "https://github.com/PyCQA/pylint/archive/pylint-"
1295 version ".tar.gz"))
1296 (sha256
1297 (base32
1298 "0mzn1czhf1mgr2wiqfihb274sja02h899b85kywdpivppa9nwrmp"))))
1299 (build-system python-build-system)
1300 (native-inputs
1301 `(("python-pytest" ,python-pytest)
1302 ("python-pytest-runner" ,python-pytest-runner)
1303 ("python-tox" ,python-tox)))
1304 (propagated-inputs
1305 `(("python-astroid" ,python-astroid)
1306 ("python-isort" ,python-isort)
1307 ("python-mccabe" ,python-mccabe)
1308 ("python-six" ,python-six)))
1309 (arguments
1310 `(#:phases
1311 (modify-phases %standard-phases
1312 (replace 'check
1313 (lambda _
1314 ;; Somehow, tests for python2-pylint
1315 ;; fail if run from the build directory
1316 (let ((work "/tmp/work"))
1317 (mkdir-p work)
1318 (setenv "PYTHONPATH"
1319 (string-append (getenv "PYTHONPATH") ":" work))
1320 (copy-recursively "." work)
1321 (with-directory-excursion "/tmp"
1322 (zero? (system* "python" "-m" "unittest" "discover"
1323 "-s" (string-append work "/pylint/test")
1324 "-p" "*test_*.py")))))))))
1325 (home-page "https://github.com/PyCQA/pylint")
1326 (synopsis "Python source code analyzer which looks for coding standard
1327 errors")
1328 (description "Pylint is a Python source code analyzer which looks
1329 for programming errors, helps enforcing a coding standard and sniffs
1330 for some code smells (as defined in Martin Fowler's Refactoring book).
1331
1332 Pylint has many rules enabled by default, way too much to silence them
1333 all on a minimally sized program. It's highly configurable and handle
1334 pragmas to control it from within your code. Additionally, it is
1335 possible to write plugins to add your own checks.")
1336 (properties `((python2-variant . ,(delay python2-pylint))))
1337 (license license:gpl2+)))
1338
1339 (define-public python2-pylint
1340 (let ((pylint (package-with-python2
1341 (strip-python2-variant python-pylint))))
1342 (package (inherit pylint)
1343 (propagated-inputs
1344 `(("python2-backports-functools-lru-cache"
1345 ,python2-backports-functools-lru-cache)
1346 ("python2-configparser" ,python2-configparser)
1347 ,@(package-propagated-inputs pylint))))))
1348
1349 (define-public python-paramunittest
1350 (package
1351 (name "python-paramunittest")
1352 (version "0.2")
1353 (source
1354 (origin
1355 (method url-fetch)
1356 (uri (pypi-uri "ParamUnittest" version))
1357 (sha256
1358 (base32
1359 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
1360 (build-system python-build-system)
1361 (home-page
1362 "https://github.com/rik0/ParamUnittest")
1363 (synopsis
1364 "Simple extension to have parametrized unit tests")
1365 (description
1366 "This package allows to create parametrized unit-tests that work with the standard
1367 unittest package. A parametrized test case is automatically converted to multiple test
1368 cases. Since they are TestCase subclasses, they work with other test suites that
1369 recognize TestCases.")
1370 (license license:bsd-2)))
1371
1372 (define-public python2-python-paramunittest
1373 (package-with-python2 python-paramunittest))
1374
1375 (define-public python-pytest-warnings
1376 (package
1377 (name "python-pytest-warnings")
1378 (version "0.2.0")
1379 (source
1380 (origin
1381 (method url-fetch)
1382 (uri (pypi-uri "pytest-warnings" version))
1383 (sha256
1384 (base32
1385 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
1386 (build-system python-build-system)
1387 (propagated-inputs
1388 `(("pytest" ,python-pytest)))
1389 (home-page "https://github.com/fschulze/pytest-warnings")
1390 (synopsis "Pytest plugin to list Python warnings in pytest report")
1391 (description
1392 "Python-pytest-warnings is a pytest plugin to list Python warnings in
1393 pytest report.")
1394 (license license:expat)))
1395
1396 (define-public python2-pytest-warnings
1397 (package-with-python2 python-pytest-warnings))
1398
1399 (define-public python-pytest-capturelog
1400 (package
1401 (name "python-pytest-capturelog")
1402 (version "0.7")
1403 (source
1404 (origin
1405 (method url-fetch)
1406 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
1407 (sha256
1408 (base32
1409 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
1410 (build-system python-build-system)
1411 (propagated-inputs
1412 `(("pytest" ,python-pytest)))
1413 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
1414 (synopsis "Pytest plugin to catch log messages")
1415 (description
1416 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
1417 (license license:expat)))
1418
1419 (define-public python2-pytest-capturelog
1420 (package-with-python2 python-pytest-capturelog))
1421
1422 (define-public python-pytest-catchlog
1423 (package
1424 (name "python-pytest-catchlog")
1425 (version "1.2.2")
1426 (source
1427 (origin
1428 (method url-fetch)
1429 (uri (pypi-uri "pytest-catchlog" version ".zip"))
1430 (sha256
1431 (base32
1432 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
1433 (build-system python-build-system)
1434 (native-inputs
1435 `(("unzip" ,unzip)))
1436 (propagated-inputs
1437 `(("pytest" ,python-pytest)))
1438 (home-page "https://github.com/eisensheng/pytest-catchlog")
1439 (synopsis "Pytest plugin to catch log messages")
1440 (description
1441 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
1442 a fork of pytest-capturelog.")
1443 (license license:expat)))
1444
1445 (define-public python2-pytest-catchlog
1446 (package-with-python2 python-pytest-catchlog))
1447
1448 (define-public python-nosexcover
1449 (package
1450 (name "python-nosexcover")
1451 (version "1.0.11")
1452 (source (origin
1453 (method url-fetch)
1454 (uri (pypi-uri "nosexcover" version))
1455 (sha256
1456 (base32
1457 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
1458 (build-system python-build-system)
1459 (propagated-inputs
1460 `(("python-coverage" ,python-coverage)
1461 ("python-nose" ,python-nose)))
1462 (home-page "http://github.com/cmheisel/nose-xcover")
1463 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
1464 (description "Nose-xcover is a companion to the built-in
1465 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
1466 to a file named coverage.xml.
1467
1468 It will honor all the options you pass to the Nose coverage plugin,
1469 especially -cover-package.")
1470 (license license:expat)))
1471
1472 (define-public python2-nosexcover
1473 (package-with-python2 python-nosexcover))
1474
1475 (define-public python-discover
1476 (package
1477 (name "python-discover")
1478 (version "0.4.0")
1479 (source
1480 (origin
1481 (method url-fetch)
1482 (uri (string-append
1483 "https://pypi.python.org/packages/source/d/discover/discover-"
1484 version ".tar.gz"))
1485 (sha256
1486 (base32
1487 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
1488 (build-system python-build-system)
1489 (home-page "http://pypi.python.org/pypi/discover/")
1490 (synopsis
1491 "Python test discovery for unittest")
1492 (description
1493 "Discover provides test discovery for unittest, a feature that has been
1494 backported from Python 2.7 for Python 2.4+.")
1495 (license license:bsd-3)))
1496
1497 (define-public python2-discover
1498 (package-with-python2 python-discover))
1499
1500 (define-public behave
1501 (package
1502 (name "behave")
1503 (version "1.2.5")
1504 (source (origin
1505 (method url-fetch)
1506 (uri (pypi-uri "behave" version ".tar.bz2"))
1507 (sha256
1508 (base32
1509 "1iypp6z46r19n4xmgx6m1lwmlpfjh8vapq8izigrqlaarvp2y64c"))))
1510 (build-system python-build-system)
1511 (native-inputs
1512 `(("python-mock" ,python-mock)
1513 ("python-nose" ,python-nose)
1514 ("python-pyhamcrest" ,python-pyhamcrest)))
1515 (propagated-inputs
1516 `(("python-six" ,python-six)
1517 ("python-parse" ,python-parse)
1518 ("python-parse-type" ,python-parse-type)))
1519 (arguments
1520 '(#:test-target "behave_test"))
1521 (home-page "https://github.com/behave/behave")
1522 (synopsis "Python behavior-driven development")
1523 (description
1524 "Behave is a tool for behavior-driven development in python.
1525 Behavior-driven development (or BDD) is an agile software development
1526 technique that encourages collaboration between developers, QA and
1527 non-technical or business participants in a software project. Behave uses
1528 tests written in a natural language style, backed up by Python code.")
1529 (license license:x11)))
1530
1531 (define-public python-behave-web-api
1532 (package
1533 (name "python-behave-web-api")
1534 (version "1.0.6")
1535 (source
1536 (origin
1537 (method url-fetch)
1538 (uri (pypi-uri "behave-web-api" version))
1539 (sha256
1540 (base32
1541 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
1542 (build-system python-build-system)
1543 (arguments
1544 `(#:phases
1545 (modify-phases %standard-phases
1546 (add-after 'unpack 'fix-dependencies
1547 (lambda _
1548 (substitute* "setup.py"
1549 (("'wheel'") "") ; We don't use it.
1550 (("'ordereddict==1.1'") ""))))))) ; Python >= 2.7 has it built-in.
1551 (propagated-inputs
1552 `(("behave" ,behave)
1553 ("python-requests" ,python-requests)))
1554 (home-page "https://github.com/jefersondaniel/behave-web-api")
1555 (synopsis "Provides testing for JSON APIs with Behave for Python")
1556 (description "This package provides testing utility modules for testing
1557 JSON APIs with Behave.")
1558 (license license:expat)))
1559
1560 (define-public python2-behave-web-api
1561 (package-with-python2 python-behave-web-api))
1562
1563 (define-public python-rednose
1564 (package
1565 (name "python-rednose")
1566 (version "1.2.3")
1567 (source
1568 (origin
1569 (method url-fetch)
1570 (uri (pypi-uri "rednose" version))
1571 (sha256
1572 (base32
1573 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
1574 (build-system python-build-system)
1575 (propagated-inputs
1576 `(("python-colorama" ,python-colorama)
1577 ("python-termstyle" ,python-termstyle)))
1578 (native-inputs
1579 `(("python-six" ,python-six)
1580 ("python-nose" ,python-nose)))
1581 (home-page "https://github.com/JBKahn/rednose")
1582 (synopsis "Colored output for Python nosetests")
1583 (description "This package provides colored output for the
1584 @command{nosetests} command of the Python Nose unit test framework.")
1585 (license license:bsd-3)))
1586
1587 (define-public python2-rednose
1588 (package-with-python2 python-rednose))
1589
1590 (define-public python-nose-randomly
1591 (package
1592 (name "python-nose-randomly")
1593 (version "1.2.5")
1594 (source
1595 (origin
1596 (method url-fetch)
1597 (uri (pypi-uri "nose-randomly" version))
1598 (sha256
1599 (base32
1600 "1cw9dlr1zh3w4i438kin7z0rm8092ki52hayisyc43h9pcplq7rn"))))
1601 (build-system python-build-system)
1602 (native-inputs
1603 `(("python-nose" ,python-nose)
1604 ("python-numpy" ,python-numpy)))
1605 (home-page "https://github.com/adamchainz/nose-randomly")
1606 (synopsis
1607 "Nose plugin to randomly order tests and control random.seed")
1608 (description
1609 "This is a @code{Nose} plugin to randomly order tests which can be quite
1610 powerful in discovering hidden flaws in the tests themselves, while helping to
1611 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
1612 by resetting it to a repeatable number for each test, enabling the tests to
1613 create data based on random numbers and yet remain repeatable.")
1614 (license license:bsd-3)))
1615
1616 (define-public python2-nose-randomly
1617 (package-with-python2 python-nose-randomly))
1618
1619 (define-public python-nose-timer
1620 (package
1621 (name "python-nose-timer")
1622 (version "0.7.0")
1623 (source
1624 (origin
1625 (method url-fetch)
1626 (uri (pypi-uri "nose-timer" version))
1627 (patches
1628 (search-patches
1629 ;; This patch will not be needed in the next version.
1630 ;; It is taken from the master branch.
1631 "python-nose-timer-drop-ordereddict.patch"))
1632 (sha256
1633 (base32
1634 "1s32ymsnby8lz2qk55ifj9zi50dqcg6swnj5cz2rmwxg2jsslsxp"))))
1635 (build-system python-build-system)
1636 (propagated-inputs
1637 `(("python-nose" ,python-nose)
1638 ("python-termcolor" ,python-termcolor)))
1639 (home-page "https://github.com/mahmoudimus/nose-timer")
1640 (synopsis "Timer plugin for nosetests")
1641 (description "Shows how much time was needed to run individual tests.")
1642 (license license:expat)))
1643
1644 (define-public python2-nose-timer
1645 (package-with-python2 python-nose-timer))
1646
1647 (define-public python-freezegun
1648 (package
1649 (name "python-freezegun")
1650 (version "0.3.9")
1651 (source
1652 (origin
1653 (method url-fetch)
1654 (uri (pypi-uri "freezegun" version))
1655 (sha256
1656 (base32
1657 "1vhf3kgdy7gpy70n3bxa3y1n6aza316137md97z8p5k0gz6wqg3q"))))
1658 (build-system python-build-system)
1659 (native-inputs
1660 `(("python-mock" ,python-mock)
1661 ("python-nose" ,python-nose)
1662 ("python-coverage" ,python-coverage)))
1663 (propagated-inputs
1664 `(("python-six" ,python-six)
1665 ("python-dateutil" ,python-dateutil)))
1666 (arguments
1667 `(#:phases
1668 (modify-phases %standard-phases
1669 ;; The tests are normally executed via `make test`, but the PyPi
1670 ;; package does not include the Makefile.
1671 (replace 'check
1672 (lambda _
1673 (zero? (system* "nosetests" "./tests/")))))))
1674 (home-page "https://github.com/spulec/freezegun")
1675 (synopsis "Test utility for mocking the datetime module")
1676 (description
1677 "FreezeGun is a library that allows your python tests to travel through
1678 time by mocking the datetime module.")
1679 (license license:asl2.0)))
1680
1681 (define-public python2-freezegun
1682 (package-with-python2 python-freezegun))
1683
1684 (define-public python-flexmock
1685 (package
1686 (name "python-flexmock")
1687 (version "0.10.2")
1688 (source (origin
1689 (method url-fetch)
1690 (uri (pypi-uri "flexmock" version))
1691 (sha256
1692 (base32
1693 "0arc6njvs6i9v9hgvzk5m50296g7zy5m9d7pyb43vdsdgxrci5gy"))))
1694 (build-system python-build-system)
1695 (home-page "https://flexmock.readthedocs.org")
1696 (synopsis "Testing library for Python")
1697 (description
1698 "flexmock is a testing library for Python that makes it easy to create
1699 mocks, stubs and fakes.")
1700 (license license:bsd-3)))
1701
1702 (define-public python2-flexmock
1703 (package-with-python2 python-flexmock))
1704
1705 (define-public python-flaky
1706 (package
1707 (name "python-flaky")
1708 (version "3.4.0")
1709 (source (origin
1710 (method url-fetch)
1711 (uri (pypi-uri "flaky" version))
1712 (sha256
1713 (base32
1714 "18pkmf79rfkfpy1d2rrx3v55nxj762ilyk9rvd6s6dccxw58imsa"))))
1715 (build-system python-build-system)
1716 (arguments
1717 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
1718 '(#:tests? #f))
1719 (home-page "https://github.com/box/flaky")
1720 (synopsis "Automatically rerun flaky tests")
1721 (description
1722 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
1723 reruns flaky tests.
1724
1725 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
1726 on components that aren't 100% reliable. With flaky, instead of removing
1727 those tests or marking them to @code{@@skip}, they can be automatically
1728 retried.")
1729 (license license:asl2.0)))
1730
1731 (define-public python2-flaky
1732 (package-with-python2 python-flaky))
1733
1734 (define-public python-pyhamcrest
1735 (package
1736 (name "python-pyhamcrest")
1737 (version "1.9.0")
1738 (source (origin
1739 (method url-fetch)
1740 (uri
1741 (string-append
1742 "https://github.com/hamcrest/PyHamcrest/archive/V"
1743 version
1744 ".tar.gz"))
1745 (file-name
1746 (string-append name "-" version ".tar.gz"))
1747 (sha256
1748 (base32
1749 "1lqjajhwf7x7igvvnj5p1cm31y9njy07qby94w18kl6zwbdjqrwy"))))
1750 (native-inputs ; All native inputs are for tests
1751 `(("python-pytest-cov" ,python-pytest-cov)
1752 ("python-mock" ,python-mock)
1753 ("python-pytest" ,python-pytest)
1754 ("python-hypothesis" ,python-hypothesis)))
1755 (propagated-inputs
1756 `(("python-six" ,python-six)))
1757 (build-system python-build-system)
1758 (home-page "http://hamcrest.org/")
1759 (synopsis "Hamcrest matchers for Python")
1760 (description
1761 "PyHamcrest is a framework for writing matcher objects,
1762 allowing you to declaratively define \"match\" rules.")
1763 (license license:bsd-3)))
1764
1765 (define-public python2-pyhamcrest
1766 (package-with-python2 python-pyhamcrest))