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>
31 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
71 (uri (string-append "https://github.com/libcheck/check/releases/download/"
72 version "/check-" version ".tar.gz"))
75 "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6"))))
76 (build-system gnu-build-system)
77 (home-page "https://libcheck.github.io/check/")
78 (synopsis "Unit test framework for C")
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+)))
95 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
96 version "/CUnit-" version ".tar.bz2"))
99 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
100 (build-system gnu-build-system)
101 (arguments '(#:phases
102 (modify-phases %standard-phases
103 (add-before 'configure 'autoconf
105 (zero? (system* "autoreconf" "-vfi")))))))
107 `(("automake" ,automake)
108 ("autoconf" ,autoconf)
109 ("libtool" ,libtool)))
110 (home-page "http://cunit.sourceforge.net/")
111 (synopsis "Automated testing framework for C")
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+)))
118 (define-public cppunit
124 (uri (string-append "http://dev-www.libreoffice.org/src/"
125 name "-" version ".tar.gz"))
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.
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
141 (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
143 (define-public catch-framework
146 (version "1.3.5") ;Sub-minor is the build number
150 (url "https://github.com/philsquared/Catch")
152 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
153 (file-name (string-append name "-" version))
156 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
157 (build-system trivial-build-system)
159 `(#:modules ((guix build utils))
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-"
168 (for-each mkdir-p (list incdir docdir))
169 (install-file (string-append source
170 "/single_include/catch.hpp")
172 (copy-recursively (string-append source "/docs")
174 (home-page "http://catch-lib.net/")
175 (synopsis "Automated test framework for C++ and Objective-C")
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)))
181 (define-public cmdtest
187 (uri (string-append "http://git.liw.fi/cmdtest/snapshot/"
188 name "-" version ".tar.gz"))
191 "1i6gi4yp4qqx1liax098c7nwdb24pghh11xqlrcs7lnhh079rqhb"))))
192 (build-system python-build-system)
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,
201 (add-before 'build 'check
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")))))))
212 `(("python2-coverage-test-runner" ,python2-coverage-test-runner)))
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")
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+)))
226 (define-public cmocka
232 (uri (string-append "https://cmocka.org/files/"
233 (version-major+minor version) "/cmocka-"
237 "1283zi9qf5613g8iadm1fxmjh4rzxqd5np2j3lcpgairf25g8bph"))))
238 (build-system cmake-build-system)
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
248 (license license:asl2.0)))
250 (define-public cppcheck
256 (uri (string-append "https://github.com/danmar/cppcheck/archive/"
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+)))
271 (define-public googletest
278 (uri (string-append "https://github.com/google/googletest/archive/"
279 "release-" version ".tar.gz"))
280 (file-name (string-append name "-" version ".tar.gz"))
283 "1n5p1m2m3fjrjdj752lf92f9wq3pl5cbsfrb49jqbg52ghkz99jq"))))
284 (build-system cmake-build-system)
286 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
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
294 (license license:bsd-3)))
296 (define-public cpputest
303 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
304 version "/cpputest-" version ".tar.gz"))
307 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
308 (build-system gnu-build-system)
310 `(("googletest" ,googletest)))
311 (home-page "https://cpputest.github.io/")
312 (synopsis "Unit testing and mocking framework for C/C++")
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)))
319 (define-public python-parameterized
321 (name "python-parameterized")
326 (uri (pypi-uri "parameterized" version))
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")
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)))
339 (define-public python2-parameterized
340 (package-with-python2 python-parameterized))
342 (define-public python-mock
349 (uri (pypi-uri "mock" version))
352 "1flbpksir5sqrvq2z0dp8sl4bzbadg21sj4d42w3klpdfvgvcn5i"))))
354 `(("python-pbr" ,python-pbr-minimal)
355 ("python-six" ,python-six)))
356 (build-system python-build-system)
358 `(("python-unittest2" ,python-unittest2)))
361 (modify-phases %standard-phases
364 (zero? (system* "unit2")))))))
365 (home-page "https://github.com/testing-cabal/mock")
366 (synopsis "Python mocking and patching library for testing")
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
371 (properties `((python2-variant . ,(delay python2-mock))))
372 (license license:expat)))
374 (define-public python2-mock
375 (let ((base (package-with-python2
376 (strip-python2-variant python-mock))))
377 (package (inherit base)
379 `(("python2-functools32" ,python2-functools32)
380 ("python2-funcsigs" ,python2-funcsigs)
381 ,@(package-propagated-inputs base))))))
383 (define-public python-nose
390 (uri (pypi-uri "nose" version))
393 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
394 (build-system python-build-system)
396 '(#:tests? #f)) ; FIXME: test suite fails
397 (home-page "http://readthedocs.org/docs/nose/")
398 (synopsis "Python testing library")
400 "Nose extends the unittest library to make testing easier.")
401 (license license:lgpl2.0+)))
403 (define-public python2-nose
404 (package-with-python2 python-nose))
406 (define-public python-nose2
408 (name "python-nose2")
413 (uri (pypi-uri "nose2" version))
416 "1x4zjq1zlyrh8b9ba0cmafd3w94pxhid408kibyjd3s6h1lap6s7"))))
417 (build-system python-build-system)
418 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
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")
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)))
432 (define-public python2-nose2
433 (package-with-python2 python-nose2))
435 (define-public python-unittest2
437 (name "python-unittest2")
442 (uri (pypi-uri "unittest2" version))
444 (search-patches "python-unittest2-python3-compat.patch"
445 "python-unittest2-remove-argparse.patch"))
448 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
449 (build-system python-build-system)
452 (modify-phases %standard-phases
455 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
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")
462 "Unittest2 is a replacement for the unittest module in the Python
464 (license license:psfl)))
466 (define-public python2-unittest2
467 (package-with-python2 python-unittest2))
469 (define-public python-pytest
471 (name "python-pytest")
476 (uri (pypi-uri "pytest" version))
479 "0g6w86ks73fnrnsyib9ii2rbyx830vn7aglsjqz9v1n2xwbndyi7"))))
480 (build-system python-build-system)
483 (modify-phases %standard-phases
484 (add-before 'check 'disable-invalid-tests
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 "
497 `(("python-py" ,python-py)))
499 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
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")
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)))
513 (define-public python2-pytest
514 (package-with-python2 python-pytest))
516 (define-public python-pytest-bootstrap
518 (inherit python-pytest)
519 (name "python-pytest-bootstrap")
520 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
521 (arguments `(#:tests? #f))))
523 (define-public python2-pytest-bootstrap
524 (package-with-python2 python-pytest-bootstrap))
526 (define-public python-pytest-cov
528 (name "python-pytest-cov")
533 (uri (pypi-uri "pytest-cov" version))
536 "03c2qc42r4bczyw93gd7n0qi1h1jfhw7fnbhi33c3vp1hs81gm2k"))))
537 (build-system python-build-system)
540 (modify-phases %standard-phases
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")))))))
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")
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)))
559 (define-public python2-pytest-cov
560 (package-with-python2 python-pytest-cov))
562 (define-public python-pytest-runner
564 (name "python-pytest-runner")
569 (uri (pypi-uri "pytest-runner" version))
572 "1cw978kqqcq916b9gfns1qjqvg33c5ail5jhw9054dsynkm32flq"))))
573 (build-system python-build-system)
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
581 (substitute* "docs/conf.py"
582 (("version = setuptools_scm\\.get_version\\(root='\\.\\.')")
583 (string-append "version = \"" ,version "\"")))
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")
591 "This package provides a @command{pytest-runner} command that
592 @file{setup.py} files can use to run tests.")
593 (license license:expat)))
595 (define-public python2-pytest-runner
596 (package-with-python2 python-pytest-runner))
598 (define-public python-pytest-mock
600 (name "python-pytest-mock")
605 (uri (pypi-uri "pytest-mock" version ".zip"))
608 "03zxar5drzm7ksqyrwypjaza3cri6wqvpr6iam92djvg6znp32gp"))))
609 (build-system python-build-system)
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")
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
622 (properties `((python2-variant . ,(delay python2-pytest-mock))))
623 (license license:expat)))
625 (define-public python2-pytest-mock
626 (let ((base (package-with-python2
627 (strip-python2-variant python-pytest-mock))))
628 (package (inherit base)
630 `(("python2-mock" ,python2-mock)
631 ,@(package-propagated-inputs base))))))
633 (define-public python-pytest-xdist
635 (name "python-pytest-xdist")
640 (uri (pypi-uri "pytest-xdist" version ".zip"))
643 "08rn2l39ds60xshs4js787l84pfckksqklfq2wq9x8ig2aci2pja"))
644 (modules '((guix build utils)))
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$"))
652 (build-system python-build-system)
654 '(#:tests? #f)) ;FIXME: Some tests are failing.
656 ;; (modify-phases %standard-phases
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")))))
664 ("python-setuptools-scm" ,python-setuptools-scm)))
666 `(("python-execnet" ,python-execnet)
667 ("python-pytest" ,python-pytest)
668 ("python-py" ,python-py)))
670 "https://github.com/pytest-dev/pytest-xdist")
672 "Plugin for py.test with distributed testing and loop-on-failing modes")
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
680 (license license:expat)))
682 (define-public python2-pytest-xdist
683 (package-with-python2 python-pytest-xdist))
685 (define-public python-scripttest
687 (name "python-scripttest")
693 "https://pypi.python.org/packages/source/s/scripttest/scripttest-"
697 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
698 (build-system python-build-system)
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)))
708 (define-public python2-scripttest
709 (package-with-python2 python-scripttest))
711 (define-public python-testtools
713 (name "python-testtools")
718 (uri (pypi-uri "testtools" version))
721 "1vw8yljnd75d396hhw6s2hrf4cclzy845ifd5am0lxsl235z3i8c"))))
722 (build-system python-build-system)
725 (modify-phases %standard-phases
726 (add-after 'unpack 'fix-module-imports
728 (substitute* "setup.py"
729 (("'unittest2>=0.8.0',") ""))
730 (substitute* '("testtools/testcase.py"
731 "testtools/testsuite.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"))
745 `(("python-mimeparse" ,python-mimeparse)
746 ("python-extras" ,python-extras)))
747 (home-page "https://github.com/testing-cabal/testtools")
749 "Extensions to the Python standard library unit testing framework")
751 "Testtools extends the Python standard library unit testing framework to
752 provide matchers, more debugging information, and cross-Python
754 (license license:psfl)))
756 (define-public python2-testtools
757 (package-with-python2 python-testtools))
759 (define-public python-testscenarios
761 (name "python-testscenarios")
767 "https://pypi.python.org/packages/source/t/testscenarios/testscenarios-"
771 "1671jvrvqlmbnc42j7pc5y6vc37q44aiwrq0zic652pxyy2fxvjg"))))
772 (build-system python-build-system)
774 `(("python-testtools" ,python-testtools)))
775 (home-page "https://launchpad.net/testscenarios")
776 (synopsis "Pyunit extension for dependency injection")
778 "Testscenarios provides clean dependency injection for Python unittest
780 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
782 (define-public python2-testscenarios
783 (package-with-python2 python-testscenarios))
785 (define-public python-testresources
787 (name "python-testresources")
793 "https://pypi.python.org/packages/source/t/testresources/testresources-"
797 "0cbj3plbllyz42c4b5xxgwaa7mml54lakslrn4kkhinxhdri22md"))))
798 (build-system python-build-system)
799 (home-page "https://launchpad.net/testresources")
801 "Pyunit extension for managing test resources")
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
807 (define-public python2-testresources
808 (package-with-python2 python-testresources))
810 (define-public python-subunit
812 (name "python-subunit")
818 "https://pypi.python.org/packages/source/p/python-subunit/python-subunit-"
822 "1nkw9wfbvizmpajbj3in8ns07g7lwkiv8hip14jjlwk3cacls6jv"))))
823 (build-system python-build-system)
825 `(("python-extras" ,python-extras)
826 ("python-mimeparse" ,python-mimeparse)))
828 `(("python-testscenarios" ,python-testscenarios)))
829 (home-page "http://launchpad.net/subunit")
830 (synopsis "Python implementation of the subunit protocol")
832 "Python-subunit is a Python implementation of the subunit test streaming
834 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
836 (define-public python2-subunit
837 (package-with-python2 python-subunit))
839 (define-public python-fixtures
841 (name "python-fixtures")
846 (uri (pypi-uri "fixtures" version))
849 "0djxvdwm8s60dbfn7bhf40x6g818p3b3mlwijm1c3bqg7msn271y"))))
850 (build-system python-build-system)
853 (modify-phases %standard-phases
856 (zero? (system* "python" "-m" "testtools.run"
857 "fixtures.test_suite")))))))
859 `(("python-six" ,python-six)))
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")
867 "Fixtures provides a way to create reusable state, useful when writing
869 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
871 (define-public python2-fixtures
872 (package-with-python2 python-fixtures))
874 (define-public python-testrepository
876 (name "python-testrepository")
882 "https://pypi.python.org/packages/source/t/testrepository/testrepository-"
886 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
887 (build-system python-build-system)
889 ;; FIXME: Many tests are failing.
892 `(("python-fixtures" ,python-fixtures)
893 ("python-subunit" ,python-subunit)
894 ("python-testtools" ,python-testtools)))
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
905 (define-public python2-testrepository
906 (package-with-python2 python-testrepository))
908 (define-public python-coverage
910 (name "python-coverage")
915 (uri (pypi-uri "coverage" version))
918 "097l4s3ssxm1vncsn0nw3a1pbzah28773q36c1ab9wz01r04973s"))))
919 (build-system python-build-system)
921 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
923 (home-page "http://nedbatchelder.com/code/coverage")
924 (synopsis "Code coverage measurement for Python")
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
930 (license license:bsd-3)))
932 (define-public python2-coverage
933 (package-with-python2 python-coverage))
935 (define-public python-cov-core
937 (name "python-cov-core")
942 (uri (pypi-uri "cov-core" version))
945 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
946 (build-system python-build-system)
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")
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)))
957 (define-public python2-cov-core
958 (package-with-python2 python-cov-core))
960 (define-public python-testpath
962 (name "python-testpath")
967 (uri (string-append "https://github.com/jupyter/testpath/archive/"
969 (file-name (string-append name "-" version ".tar.gz"))
972 "04kh3fgvmqz6cfcw79q70qwjz7ib7lxm27cc548iy2rpr33qqf55"))))
973 (build-system python-build-system)
975 `(#:tests? #f ; this package does not even have a setup.py
976 #:modules ((guix build python-build-system)
979 #:imported-modules (,@%python-build-system-modules
982 (modify-phases %standard-phases
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)
991 (assoc-ref outputs "out")
992 "/lib/python" x.y "/site-packages/testpath")))
994 (copy-recursively "testpath" dir))
996 (home-page "https://github.com/takluyver/testpath")
997 (synopsis "Test utilities for code working with files and commands")
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)))
1004 (define-public python2-testpath
1005 (package-with-python2 python-testpath))
1007 (define-public python-testlib
1009 (name "python-testlib")
1015 "https://pypi.python.org/packages/source/t/testlib/testlib-"
1018 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1019 (build-system python-build-system)
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)))
1027 (define-public python2-testlib
1028 (package-with-python2 python-testlib))
1030 ;;; The software provided by this package was integrated into pytest 2.8.
1031 (define-public python-pytest-cache
1033 (name "python-pytest-cache")
1037 (uri (pypi-uri "pytest-cache" version))
1040 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1041 (build-system python-build-system)
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)))
1053 (define-public python2-pytest-cache
1054 (package-with-python2 python-pytest-cache))
1056 (define-public python-pytest-localserver
1058 (name "python-pytest-localserver")
1062 (uri (pypi-uri "pytest-localserver" version))
1065 "0dvqspjr6va55zwmnnc2mmpqc7mm65kxig9ya44x1z8aadzxpa4p"))))
1066 (build-system python-build-system)
1068 `(#:phases (modify-phases %standard-phases
1071 (zero? (system* "py.test" "--genscript=runtests.py"))
1072 (zero? (system* "py.test")))))))
1074 `(("python-pytest" ,python-pytest)
1075 ("python-requests" ,python-requests)
1076 ("python-six" ,python-six)))
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)))
1085 (define-public python-pytest-xprocess
1087 (name "python-pytest-xprocess")
1091 (uri (pypi-uri "pytest-xprocess" version))
1094 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1095 (build-system python-build-system)
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)))
1106 (define-public python-pytest-subtesthack
1108 (name "python-pytest-subtesthack")
1112 (uri (pypi-uri "pytest-subtesthack" version))
1115 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1116 (build-system python-build-system)
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)))
1128 (define-public python2-pytest-subtesthack
1129 (package-with-python2 python-pytest-subtesthack))
1131 (define-public python-hypothesis
1133 (name "python-hypothesis")
1137 (uri (pypi-uri "hypothesis" version))
1140 "0qyqq9akm4vshhn8cngjc1qykcvsn7cz6dlm6njfsgpbraqrmbbw"))))
1141 (build-system python-build-system)
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))))))
1154 (define-public python2-hypothesis
1155 (let ((hypothesis (package-with-python2
1156 (strip-python2-variant python-hypothesis))))
1157 (package (inherit hypothesis)
1159 `(("python2-enum34" ,python2-enum34)
1160 ,@(package-propagated-inputs hypothesis))))))
1162 (define-public python-lit
1169 (uri (pypi-uri "lit" version))
1172 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
1173 (build-system python-build-system)
1176 (modify-phases %standard-phases
1179 (invoke "py.test"))))))
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
1187 (license license:ncsa)))
1189 (define-public python2-lit
1190 (package-with-python2 python-lit))
1192 (define-public python-pytest-pep8
1194 (name "python-pytest-pep8")
1198 (uri (pypi-uri "pytest-pep8" version))
1201 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
1202 (build-system python-build-system)
1204 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
1206 `(("python-pytest" ,python-pytest)))
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)))
1214 (define-public python2-pytest-pep8
1215 (package-with-python2 python-pytest-pep8))
1217 (define-public python-pytest-flakes
1219 (name "python-pytest-flakes")
1223 (uri (pypi-uri "pytest-flakes" version))
1226 "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
1227 (build-system python-build-system)
1230 (modify-phases %standard-phases
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")))))))
1239 `(("python-coverage" ,python-coverage)
1240 ("python-pytest" ,python-pytest)
1241 ("python-pytest-cache" ,python-pytest-cache)
1242 ("python-pytest-pep8" ,python-pytest-pep8)))
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)))
1250 (define-public python2-pytest-flakes
1251 (package-with-python2 python-pytest-flakes))
1253 (define-public python2-coverage-test-runner
1255 (name "python2-coverage-test-runner")
1261 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
1262 "coverage-test-runner/snapshot/coverage-test-runner-"
1266 "0y1m7z3dl63kmhcmydl1mwg0hacnf6ghrx9dah17j9iasssfa3g7"))))
1267 (build-system python-build-system)
1269 `(#:python ,python-2
1271 (modify-phases %standard-phases
1274 (zero? (system* "./testrun")))))))
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+)))
1284 (define-public python-pylint
1286 (name "python-pylint")
1292 "https://github.com/PyCQA/pylint/archive/pylint-"
1296 "0mzn1czhf1mgr2wiqfihb274sja02h899b85kywdpivppa9nwrmp"))))
1297 (build-system python-build-system)
1299 `(("python-pytest" ,python-pytest)
1300 ("python-pytest-runner" ,python-pytest-runner)
1301 ("python-tox" ,python-tox)))
1303 `(("python-astroid" ,python-astroid)
1304 ("python-isort" ,python-isort)
1305 ("python-mccabe" ,python-mccabe)
1306 ("python-six" ,python-six)))
1309 (modify-phases %standard-phases
1312 ;; Somehow, tests for python2-pylint
1313 ;; fail if run from the build directory
1314 (let ((work "/tmp/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
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).
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+)))
1337 (define-public python2-pylint
1338 (let ((pylint (package-with-python2
1339 (strip-python2-variant python-pylint))))
1340 (package (inherit pylint)
1342 `(("python2-backports-functools-lru-cache"
1343 ,python2-backports-functools-lru-cache)
1344 ("python2-configparser" ,python2-configparser)
1345 ,@(package-propagated-inputs pylint))))))
1347 (define-public python-paramunittest
1349 (name "python-paramunittest")
1354 (uri (pypi-uri "ParamUnittest" version))
1357 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
1358 (build-system python-build-system)
1360 "https://github.com/rik0/ParamUnittest")
1362 "Simple extension to have parametrized unit tests")
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)))
1370 (define-public python2-python-paramunittest
1371 (package-with-python2 python-paramunittest))
1373 (define-public python-pytest-warnings
1375 (name "python-pytest-warnings")
1380 (uri (pypi-uri "pytest-warnings" version))
1383 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
1384 (build-system python-build-system)
1386 `(("pytest" ,python-pytest)))
1387 (home-page "https://github.com/fschulze/pytest-warnings")
1388 (synopsis "Pytest plugin to list Python warnings in pytest report")
1390 "Python-pytest-warnings is a pytest plugin to list Python warnings in
1392 (license license:expat)))
1394 (define-public python2-pytest-warnings
1395 (package-with-python2 python-pytest-warnings))
1397 (define-public python-pytest-capturelog
1399 (name "python-pytest-capturelog")
1404 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
1407 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
1408 (build-system python-build-system)
1410 `(("pytest" ,python-pytest)))
1411 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
1412 (synopsis "Pytest plugin to catch log messages")
1414 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
1415 (license license:expat)))
1417 (define-public python2-pytest-capturelog
1418 (package-with-python2 python-pytest-capturelog))
1420 (define-public python-pytest-catchlog
1422 (name "python-pytest-catchlog")
1427 (uri (pypi-uri "pytest-catchlog" version ".zip"))
1430 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
1431 (build-system python-build-system)
1433 `(("unzip" ,unzip)))
1435 `(("pytest" ,python-pytest)))
1436 (home-page "https://github.com/eisensheng/pytest-catchlog")
1437 (synopsis "Pytest plugin to catch log messages")
1439 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
1440 a fork of pytest-capturelog.")
1441 (license license:expat)))
1443 (define-public python2-pytest-catchlog
1444 (package-with-python2 python-pytest-catchlog))
1446 (define-public python-nosexcover
1448 (name "python-nosexcover")
1452 (uri (pypi-uri "nosexcover" version))
1455 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
1456 (build-system python-build-system)
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.
1466 It will honor all the options you pass to the Nose coverage plugin,
1467 especially -cover-package.")
1468 (license license:expat)))
1470 (define-public python2-nosexcover
1471 (package-with-python2 python-nosexcover))
1473 (define-public python-discover
1475 (name "python-discover")
1481 "https://pypi.python.org/packages/source/d/discover/discover-"
1485 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
1486 (build-system python-build-system)
1487 (home-page "http://pypi.python.org/pypi/discover/")
1489 "Python test discovery for unittest")
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)))
1495 (define-public python2-discover
1496 (package-with-python2 python-discover))
1498 (define-public behave
1504 (uri (pypi-uri "behave" version ".tar.bz2"))
1507 "1iypp6z46r19n4xmgx6m1lwmlpfjh8vapq8izigrqlaarvp2y64c"))))
1508 (build-system python-build-system)
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
1515 (home-page "https://github.com/behave/behave")
1516 (synopsis "Python behavior-driven development")
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)))
1525 (define-public python-behave-web-api
1527 (name "python-behave-web-api")
1532 (uri (pypi-uri "behave-web-api" version))
1535 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
1536 (build-system python-build-system)
1539 (modify-phases %standard-phases
1540 (add-after 'unpack 'fix-dependencies
1542 (substitute* "setup.py"
1543 (("'wheel'") "") ; We don't use it.
1544 (("'ordereddict==1.1'") ""))))))) ; Python >= 2.7 has it built-in.
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)))
1554 (define-public python2-behave-web-api
1555 (package-with-python2 python-behave-web-api))
1557 (define-public python-rednose
1559 (name "python-rednose")
1564 (uri (pypi-uri "rednose" version))
1567 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
1568 (build-system python-build-system)
1570 `(("python-colorama" ,python-colorama)
1571 ("python-termstyle" ,python-termstyle)))
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)))
1581 (define-public python2-rednose
1582 (package-with-python2 python-rednose))
1584 (define-public python-nose-randomly
1586 (name "python-nose-randomly")
1591 (uri (pypi-uri "nose-randomly" version))
1594 "1cw9dlr1zh3w4i438kin7z0rm8092ki52hayisyc43h9pcplq7rn"))))
1595 (build-system python-build-system)
1597 `(("python-nose" ,python-nose)
1598 ("python-numpy" ,python-numpy)))
1599 (home-page "https://github.com/adamchainz/nose-randomly")
1601 "Nose plugin to randomly order tests and control random.seed")
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)))
1610 (define-public python2-nose-randomly
1611 (package-with-python2 python-nose-randomly))
1613 (define-public python-nose-timer
1615 (name "python-nose-timer")
1620 (uri (pypi-uri "nose-timer" version))
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"))
1628 "1s32ymsnby8lz2qk55ifj9zi50dqcg6swnj5cz2rmwxg2jsslsxp"))))
1629 (build-system python-build-system)
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)))
1638 (define-public python2-nose-timer
1639 (package-with-python2 python-nose-timer))
1641 (define-public python-freezegun
1643 (name "python-freezegun")
1648 (uri (pypi-uri "freezegun" version))
1651 "1vhf3kgdy7gpy70n3bxa3y1n6aza316137md97z8p5k0gz6wqg3q"))))
1652 (build-system python-build-system)
1654 `(("python-mock" ,python-mock)
1655 ("python-nose" ,python-nose)
1656 ("python-coverage" ,python-coverage)))
1658 `(("python-six" ,python-six)
1659 ("python-dateutil" ,python-dateutil)))
1662 (modify-phases %standard-phases
1663 ;; The tests are normally executed via `make test`, but the PyPi
1664 ;; package does not include the Makefile.
1667 (zero? (system* "nosetests" "./tests/")))))))
1668 (home-page "https://github.com/spulec/freezegun")
1669 (synopsis "Test utility for mocking the datetime module")
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)))
1675 (define-public python2-freezegun
1676 (package-with-python2 python-freezegun))
1678 (define-public python-flexmock
1680 (name "python-flexmock")
1684 (uri (pypi-uri "flexmock" version))
1687 "0arc6njvs6i9v9hgvzk5m50296g7zy5m9d7pyb43vdsdgxrci5gy"))))
1688 (build-system python-build-system)
1689 (home-page "https://flexmock.readthedocs.org")
1690 (synopsis "Testing library for Python")
1692 "flexmock is a testing library for Python that makes it easy to create
1693 mocks, stubs and fakes.")
1694 (license license:bsd-3)))
1696 (define-public python2-flexmock
1697 (package-with-python2 python-flexmock))
1699 (define-public python-flaky
1701 (name "python-flaky")
1705 (uri (pypi-uri "flaky" version))
1708 "18pkmf79rfkfpy1d2rrx3v55nxj762ilyk9rvd6s6dccxw58imsa"))))
1709 (build-system python-build-system)
1711 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
1713 (home-page "https://github.com/box/flaky")
1714 (synopsis "Automatically rerun flaky tests")
1716 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
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
1723 (license license:asl2.0)))
1725 (define-public python2-flaky
1726 (package-with-python2 python-flaky))