diff options
| author | Efraim Flashner <efraim@flashner.co.il> | 2019-03-04 20:54:21 +0200 |
|---|---|---|
| committer | Efraim Flashner <efraim@flashner.co.il> | 2019-03-19 08:48:29 +0200 |
| commit | 9569db373c5139dab577cc88eeb47f734edda5c0 (patch) | |
| tree | 4bf83e9cc00c87219fb959411cc4161710c2bf74 /gnu/packages/python-check.scm | |
| parent | 5cfe7ad8704b104cc06ef715f7ff7e4c79b8c185 (diff) | |
gnu: Add python-vcrpy.
* gnu/packages/python-check.scm (python-vcrpy): New variable.
Diffstat (limited to 'gnu/packages/python-check.scm')
| -rw-r--r-- | gnu/packages/python-check.scm | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 2686425b512..58a1022bc24 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net> | 2 | ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net> |
| 3 | ;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr> | 3 | ;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr> |
| 4 | ;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il> | ||
| 4 | ;;; | 5 | ;;; |
| 5 | ;;; This file is part of GNU Guix. | 6 | ;;; This file is part of GNU Guix. |
| 6 | ;;; | 7 | ;;; |
| @@ -22,6 +23,7 @@ | |||
| 22 | #:use-module (gnu packages check) | 23 | #:use-module (gnu packages check) |
| 23 | #:use-module (gnu packages python-web) | 24 | #:use-module (gnu packages python-web) |
| 24 | #:use-module (gnu packages python-xyz) | 25 | #:use-module (gnu packages python-xyz) |
| 26 | #:use-module (gnu packages web) | ||
| 25 | #:use-module (guix utils) | 27 | #:use-module (guix utils) |
| 26 | #:use-module ((guix licenses) #:prefix license:) | 28 | #:use-module ((guix licenses) #:prefix license:) |
| 27 | #:use-module (guix packages) | 29 | #:use-module (guix packages) |
| @@ -57,3 +59,49 @@ | |||
| 57 | This package provides seamless integration with coverage.py (and thus pytest, | 59 | This package provides seamless integration with coverage.py (and thus pytest, |
| 58 | nosetests, etc...) in Python projects.") | 60 | nosetests, etc...) in Python projects.") |
| 59 | (license license:expat))) | 61 | (license license:expat))) |
| 62 | |||
| 63 | (define-public python-vcrpy | ||
| 64 | (package | ||
| 65 | (name "python-vcrpy") | ||
| 66 | (version "2.0.1") | ||
| 67 | (source | ||
| 68 | (origin | ||
| 69 | (method url-fetch) | ||
| 70 | (uri (pypi-uri "vcrpy" version)) | ||
| 71 | (sha256 | ||
| 72 | (base32 | ||
| 73 | "0kws7l3hci1dvjv01nxw3805q9v2mwldw58bgl8s90wqism69gjp")))) | ||
| 74 | (build-system python-build-system) | ||
| 75 | (arguments `(#:tests? #f)) ; tests require more packages for python-pytest-httpbin | ||
| 76 | (propagated-inputs | ||
| 77 | `(("python-pyyaml" ,python-pyyaml) | ||
| 78 | ("python-six" ,python-six) | ||
| 79 | ("python-wrapt" ,python-wrapt) | ||
| 80 | ("python-yarl" ,python-yarl))) | ||
| 81 | (native-inputs | ||
| 82 | `(("python-mock" ,python-mock) | ||
| 83 | ("python-pytest" ,python-pytest) | ||
| 84 | ("python-pytest-httpbin" ,python-pytest-httpbin))) | ||
| 85 | (home-page "https://github.com/kevin1024/vcrpy") | ||
| 86 | (synopsis "Automatically mock your HTTP interactions") | ||
| 87 | (description | ||
| 88 | "VCR.py simplifies and speeds up tests that make HTTP requests. The first | ||
| 89 | time you run code that is inside a VCR.py context manager or decorated function, | ||
| 90 | VCR.py records all HTTP interactions that take place through the libraries it | ||
| 91 | supports and serializes and writes them to a flat file (in yaml format by | ||
| 92 | default). This flat file is called a cassette. When the relevant piece of code | ||
| 93 | is executed again, VCR.py will read the serialized requests and responses from | ||
| 94 | the aforementioned cassette file, and intercept any HTTP requests that it | ||
| 95 | recognizes from the original test run and return the responses that corresponded | ||
| 96 | to those requests. This means that the requests will not actually result in | ||
| 97 | HTTP traffic, which confers several benefits including: | ||
| 98 | @enumerate | ||
| 99 | @item The ability to work offline | ||
| 100 | @item Completely deterministic tests | ||
| 101 | @item Increased test execution speed | ||
| 102 | @end enumerate | ||
| 103 | If the server you are testing against ever changes its API, all you need to do | ||
| 104 | is delete your existing cassette files, and run your tests again. VCR.py will | ||
| 105 | detect the absence of a cassette file and once again record all HTTP | ||
| 106 | interactions, which will update them to correspond to the new API.") | ||
| 107 | (license license:expat))) | ||
