From 0930ca2c63fb57d9d7dba5bfb0f092ba3f09d961 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Thu, 14 Oct 2021 15:51:44 -0400 Subject: gnu: Add python-mockito. * gnu/packages/python-check.scm (python-mockito): New variable. --- gnu/packages/python-check.scm | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'gnu/packages/python-check.scm') diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 8252f02182..0421210c27 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -1415,6 +1415,38 @@ the implementation of that name.") (license (list license:asl2.0 license:lgpl3)))) ; only for setup_helpers.py +(define-public python-mockito + (package + (name "python-mockito") + (version "1.2.2") + (source + (origin + (method git-fetch) ;no tests in pypi archive + (uri (git-reference + (url "https://github.com/kaste/mockito-python") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0fg8jflcf4c929gd4zbcrk73d08waaqjfjmdjrgnv54mzl35pjxl")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "pytest"))))))) + (native-inputs + `(("python-numpy" ,python-numpy) + ("python-pytest" ,python-pytest))) + (home-page "https://github.com/kaste/mockito-python") + (synopsis "Mocking library for Python") + (description "This package provides a Python implementation of the Java +library of the same name. It eases monkey patching, for example to stub out +side effects when unit testing.") + (license license:expat))) + (define-public python-mypy-extensions (package (name "python-mypy-extensions") -- cgit v1.2.3 From ca3fea7636d07d3063b66158a8ca207cff53b0bb Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Thu, 14 Oct 2021 16:09:22 -0400 Subject: gnu: Add python-pytest-mockito. * gnu/packages/python-check.scm (python-pytest-mockito): New variable. --- gnu/packages/python-check.scm | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'gnu/packages/python-check.scm') diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 0421210c27..fc3c8f51af 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -611,6 +611,46 @@ enables repeating a single test, or multiple tests, a specific number of times.") (license license:mpl2.0))) +(define-public python-pytest-mockito + (package + (name "python-pytest-mockito") + (version "0.0.4") + (source + (origin + (method git-fetch) ;no tests in pypi archive + (uri (git-reference + (url "https://github.com/kaste/pytest-mockito") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0hnpazaw3mglx1c405z2hkavgan99rqb3wgrcqk8x5kmhpay53xx")))) + (build-system python-build-system) + (arguments + '(#:phases + (modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "python" "-m" "pytest" "-vv"))))))) + (propagated-inputs + `(("python-mockito" ,python-mockito) + ("python-pytest" ,python-pytest))) + (home-page "https://github.com/kaste/pytest-mockito") + (synopsis "Mockito base fixtures for Pytest") + (description "The @code{pytest-mockito} plugin provides base Mockito +fixtures for Pytest. It covers the main entry points of the Mockito mocking +framework and makes it easy to undo any monkey patching. The fixtures are: +@itemize +@item when +@item when2 +@item expect +@item patch +@item unstub +@item spy2 +@end itemize") + (license license:expat))) + (define-public python-pytest-mpl (package (name "python-pytest-mpl") -- cgit v1.2.3 From e769ff429bd0217f39208736f9638c1fe9e9c981 Mon Sep 17 00:00:00 2001 From: Sébastien Lerique Date: Fri, 15 Oct 2021 11:40:28 +0900 Subject: gnu: Add python-aioresponses. * gnu/packages/python-check.scm (python-aioresponses): New variable. Signed-off-by: Lars-Dominik Braun --- gnu/packages/python-check.scm | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'gnu/packages/python-check.scm') diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index fc3c8f51af..f321d0b0f6 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -1752,3 +1752,43 @@ or use cases. Design is based on supporting slow, io-bound testing with often tedious system under test configuration that can benefit from running several tests at one time.") (license license:expat))) + +(define-public python-aioresponses + (package + (name "python-aioresponses") + (version "0.7.2") + (source + (origin + (method url-fetch) + (uri (pypi-uri "aioresponses" version)) + (sha256 + (base32 "16p8mdyfirddrsay62ji7rwcrqmmzxzf2isdbfm9cj5p338rbr42")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke + "pytest" "-vv" "tests" "-k" + (string-append + ;; These tests require network access. + "not test_address_as_instance_of_url_combined_with_pass_through " + "and not test_pass_through_with_origin_params")))))))) + (native-inputs + `(("python-pbr" ,python-pbr) + ("python-ddt" ,python-ddt) + ("python-pytest" ,python-pytest))) + (propagated-inputs + `(("python-aiohttp" ,python-aiohttp))) + (home-page "https://github.com/pnuckowski/aioresponses") + (synopsis "Mock out requests made by ClientSession from aiohttp package") + (description + "Aioresponses is a helper to mock/fake web requests in python aiohttp +package. For requests module there are a lot of packages that help us with +testing (eg. httpretty, responses, requests-mock). When it comes to testing +asynchronous HTTP requests it is a bit harder (at least at the beginning). +The purpose of this package is to provide an easy way to test asynchronous +HTTP requests.") + (license license:expat))) -- cgit v1.2.3