gnu: Add python-pytest-mock.

* gnu/packages/python.scm (python-pytest-mock): New variable.
This commit is contained in:
Efraim Flashner 2016-09-11 21:25:59 +03:00
parent 5cb2fe446b
commit 44547e5153
No known key found for this signature in database
GPG Key ID: F4C1D3917EACEE93
1 changed files with 39 additions and 0 deletions

View File

@ -1684,6 +1684,45 @@ supports coverage of subprocesses.")
(define-public python2-pytest-runner (define-public python2-pytest-runner
(package-with-python2 python-pytest-runner)) (package-with-python2 python-pytest-runner))
(define-public python-pytest-mock
(package
(name "python-pytest-mock")
(version "1.2")
(source
(origin
(method url-fetch)
(uri (pypi-uri "pytest-mock" version ".zip"))
(sha256
(base32
"03zxar5drzm7ksqyrwypjaza3cri6wqvpr6iam92djvg6znp32gp"))))
(build-system python-build-system)
(native-inputs
`(("unzip" ,unzip)))
(inputs
`(("python-py" ,python-py)
("python-pytest" ,python-pytest)))
(home-page "https://github.com/pytest-dev/pytest-mock/")
(synopsis "Thin-wrapper around the mock package for easier use with py.test")
(description
"This plugin installs a @code{mocker} fixture which is a thin-wrapper
around the patching API provided by the @code{mock} package, but with the
benefit of not having to worry about undoing patches at the end of a test.
The mocker fixture has the same API as @code{mock.patch}, supporting the
same arguments.")
(properties `((python2-variant . ,(delay python2-pytest-mock))))
(license license:expat)))
(define-public python2-pytest-mock
(let ((base (package-with-python2
(strip-python2-variant python-pytest-mock))))
(package (inherit base)
(native-inputs
`(("python2-setuptools" ,python2-setuptools)
,@(package-native-inputs base)))
(inputs
`(("python2-mock" ,python2-mock)
,@(package-inputs base))))))
(define-public python-pytest-xdist (define-public python-pytest-xdist
(package (package
(name "python-pytest-xdist") (name "python-pytest-xdist")