From mboxrd@z Thu Jan 1 00:00:00 1970 From: Efraim Flashner Subject: [PATCH 04/16] gnu: Add python-pytest-mock. Date: Sun, 11 Sep 2016 21:58:45 +0300 Message-ID: <20160911185857.2123-5-efraim@flashner.co.il> References: <20160911185857.2123-1-efraim@flashner.co.il> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50189) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bj9yD-00030Q-KJ for guix-devel@gnu.org; Sun, 11 Sep 2016 14:59:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bj9yB-00089K-Mh for guix-devel@gnu.org; Sun, 11 Sep 2016 14:59:12 -0400 Received: from flashner.co.il ([178.62.234.194]:52847) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bj9yB-00085E-FI for guix-devel@gnu.org; Sun, 11 Sep 2016 14:59:11 -0400 Received: from localhost (85.64.232.168.dynamic.barak-online.net [85.64.232.168]) by flashner.co.il (Postfix) with ESMTPSA id 0857B40476 for ; Sun, 11 Sep 2016 18:59:03 +0000 (UTC) In-Reply-To: <20160911185857.2123-1-efraim@flashner.co.il> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * gnu/packages/python.scm (python-pytest-mock): New variable. --- gnu/packages/python.scm | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index a340604..0886c4f 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -1683,6 +1683,45 @@ supports coverage of subprocesses.") (define-public python2-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 (package (name "python-pytest-xdist") -- 2.10.0