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