pytest-vcr | Py.test integration with VCR.py | Plugin library

 by   ktosiek Python Version: 1.0.2 License: MIT

kandi X-RAY | pytest-vcr Summary

kandi X-RAY | pytest-vcr Summary

pytest-vcr is a Python library typically used in Plugin applications. pytest-vcr has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can install using 'pip install pytest-vcr' or download it from GitHub, PyPI.

Py.test integration with VCR.py
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              pytest-vcr has a low active ecosystem.
              It has 94 star(s) with 18 fork(s). There are 3 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 7 open issues and 13 have been closed. On average issues are closed in 67 days. There are 6 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of pytest-vcr is 1.0.2

            kandi-Quality Quality

              pytest-vcr has 0 bugs and 6 code smells.

            kandi-Security Security

              pytest-vcr has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              pytest-vcr code analysis shows 0 unresolved vulnerabilities.
              There are 1 security hotspots that need review.

            kandi-License License

              pytest-vcr is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              pytest-vcr releases are not available. You will need to build from source code and install.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              pytest-vcr saves you 215 person hours of effort in developing the same functionality from scratch.
              It has 527 lines of code, 37 functions and 4 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed pytest-vcr and discovered the below as its top functions. This is intended to give you an instant insight into pytest-vcr implemented functionality, and help decide if they suit your requirements.
            • Read the contents of a file .
            Get all kandi verified functions for this library.

            pytest-vcr Key Features

            No Key Features are available at this moment for pytest-vcr.

            pytest-vcr Examples and Code Snippets

            No Code Snippets are available at this moment for pytest-vcr.

            Community Discussions

            QUESTION

            Python pytest pytest_exception_interact customize exception information from VCR.py exception
            Asked 2019-Aug-10 at 21:07
            Context

            I have started using pytest-vcr which is a pytest plugin wrapping VCR.py which I have documented in this blog post on Advanced Python Testing.

            It records all HTTP traffic to cassettes/*.yml files on the first test run to save snapshots. Similar to Jest snapshot testing for web components.

            On subsequent test runs, if a request is malformed, it won't find a match and throws an exception saying that recording new requests is forbidden and it did not find an existing recording.

            Question

            VCR.py raises a CannotOverwriteExistingCassetteException which is not particularly informative as to why it didn't match.

            How do I leverage pytest pytest_exception_interact hooks to replace this exception with a more informative one leveraging fixture information?

            I dove into my site-packages where VCR.py is pip installed and rewrote how I want it to handle the exception. I just need to know how to get this pytest_exception_interact hook to work correctly to access the fixtures from that test node (before it gets cleaned up) and raise a different exception.

            Example

            Lets get the dependencies.

            ...

            ANSWER

            Answered 2019-Aug-10 at 21:07

            Thanks to comments and guidance in the comments from @hoefling.

            I could attach the cassette fixture to the request.node in a conftest.py local plugin overriding the pytest-vcr marker...

            Source https://stackoverflow.com/questions/56745834

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install pytest-vcr

            You can install using 'pip install pytest-vcr' or download it from GitHub, PyPI.
            You can use pytest-vcr like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • PyPI

            pip install pytest-vcr

          • CLONE
          • HTTPS

            https://github.com/ktosiek/pytest-vcr.git

          • CLI

            gh repo clone ktosiek/pytest-vcr

          • sshUrl

            git@github.com:ktosiek/pytest-vcr.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link