pytest-responses


Namepytest-responses JSON
Version 0.5.1 PyPI version JSON
download
home_pagehttps://github.com/getsentry/pytest-responses
Summarypy.test integration for responses
upload_time2022-10-11 17:15:40
maintainer
docs_urlNone
authorDavid Cramer
requires_python
licenseApache 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            pytest-responses
================

.. image:: https://img.shields.io/pypi/v/pytest-responses.svg
    :target: https://pypi.python.org/pypi/pytest-responses/
    
.. image:: https://github.com/getsentry/pytest-responses/workflows/Test/badge.svg
    :target: https://github.com/getsentry/pytest-responses/actions/workflows/test.yml

Automatically activate responses across your py.test-powered test suite (thus preventing HTTP requests).

.. sourcecode:: shell

    $ pip install pytest-responses

If particular tests need access to external domains, you can use the ``withoutresponses`` marker:

.. sourcecode:: python

    @pytest.mark.withoutresponses
    def test_disabled():
        with pytest.raises(ConnectionError):
            requests.get('http://responses.invalid')

        assert len(responses.calls) == 0


Additionally, you can use the responses fixture:

.. sourcecode:: python

    def test_enabled(responses):
        with pytest.raises(ConnectionError):
            requests.get('http://responses.invalid')

        assert len(responses.calls) == 1



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/getsentry/pytest-responses",
    "name": "pytest-responses",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "David Cramer",
    "author_email": "dcramer@gmail.com",
    "download_url": "",
    "platform": null,
    "description": "pytest-responses\n================\n\n.. image:: https://img.shields.io/pypi/v/pytest-responses.svg\n    :target: https://pypi.python.org/pypi/pytest-responses/\n    \n.. image:: https://github.com/getsentry/pytest-responses/workflows/Test/badge.svg\n    :target: https://github.com/getsentry/pytest-responses/actions/workflows/test.yml\n\nAutomatically activate responses across your py.test-powered test suite (thus preventing HTTP requests).\n\n.. sourcecode:: shell\n\n    $ pip install pytest-responses\n\nIf particular tests need access to external domains, you can use the ``withoutresponses`` marker:\n\n.. sourcecode:: python\n\n    @pytest.mark.withoutresponses\n    def test_disabled():\n        with pytest.raises(ConnectionError):\n            requests.get('http://responses.invalid')\n\n        assert len(responses.calls) == 0\n\n\nAdditionally, you can use the responses fixture:\n\n.. sourcecode:: python\n\n    def test_enabled(responses):\n        with pytest.raises(ConnectionError):\n            requests.get('http://responses.invalid')\n\n        assert len(responses.calls) == 1\n\n\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "py.test integration for responses",
    "version": "0.5.1",
    "project_urls": {
        "Homepage": "https://github.com/getsentry/pytest-responses"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c40a81b8cc3cf4b6605d97ed37217af9e2f82c97ebe130f60cf85fe82edfe0e1",
                "md5": "ab189988bba0ed270930b95330a49d3d",
                "sha256": "4172e565b94ac1ea3b10aba6e40855ad60cd7f141476b2d8a47e4b5f250be734"
            },
            "downloads": -1,
            "filename": "pytest_responses-0.5.1-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ab189988bba0ed270930b95330a49d3d",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 6693,
            "upload_time": "2022-10-11T17:15:40",
            "upload_time_iso_8601": "2022-10-11T17:15:40.889008Z",
            "url": "https://files.pythonhosted.org/packages/c4/0a/81b8cc3cf4b6605d97ed37217af9e2f82c97ebe130f60cf85fe82edfe0e1/pytest_responses-0.5.1-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-10-11 17:15:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "getsentry",
    "github_project": "pytest-responses",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "pytest-responses"
}
        
Elapsed time: 0.08147s