pytest-httpbin


Namepytest-httpbin JSON
Version 2.1.0 PyPI version JSON
download
home_pageNone
SummaryEasily test your HTTP library against a local copy of httpbin
upload_time2024-09-18 15:35:58
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords pytest-httpbin testing pytest httpbin
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            pytest-httpbin
==============

httpbin is an amazing web service for testing HTTP libraries. It has several
great endpoints that can test pretty much everything you need in a HTTP
library. The only problem is: maybe you don't want to wait for your tests to
travel across the Internet and back to make assertions against a remote web
service.

Enter pytest-httpbin. Pytest-httpbin creates a pytest "fixture" that is
dependency-injected into your tests. It automatically starts up a HTTP server
in a separate thread running httpbin and provides your test with the URL in the
fixture. Check out this example:

.. code-block:: python

    def test_that_my_library_works_kinda_ok(httpbin):
        assert requests.get(httpbin.url + '/get/').status_code == 200

This replaces a test that might have looked like this before:

.. code-block:: python

    def test_that_my_library_works_kinda_ok():
        assert requests.get('http://httpbin.org/get').status_code == 200

pytest-httpbin also supports https and includes its own CA cert you can use.
Check out `the full documentation`_ on the github page.

.. _the full documentation: https://github.com/kevin1024/pytest-httpbin

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pytest-httpbin",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "pytest-httpbin testing pytest httpbin",
    "author": null,
    "author_email": "Kevin McCarthy <me@kevinmccarthy.org>",
    "download_url": "https://files.pythonhosted.org/packages/43/83/23b510bb5f20b1982f010dbf82d17e21f701470033e2f4d952ce6cf7a1c6/pytest_httpbin-2.1.0.tar.gz",
    "platform": null,
    "description": "pytest-httpbin\n==============\n\nhttpbin is an amazing web service for testing HTTP libraries. It has several\ngreat endpoints that can test pretty much everything you need in a HTTP\nlibrary. The only problem is: maybe you don't want to wait for your tests to\ntravel across the Internet and back to make assertions against a remote web\nservice.\n\nEnter pytest-httpbin. Pytest-httpbin creates a pytest \"fixture\" that is\ndependency-injected into your tests. It automatically starts up a HTTP server\nin a separate thread running httpbin and provides your test with the URL in the\nfixture. Check out this example:\n\n.. code-block:: python\n\n    def test_that_my_library_works_kinda_ok(httpbin):\n        assert requests.get(httpbin.url + '/get/').status_code == 200\n\nThis replaces a test that might have looked like this before:\n\n.. code-block:: python\n\n    def test_that_my_library_works_kinda_ok():\n        assert requests.get('http://httpbin.org/get').status_code == 200\n\npytest-httpbin also supports https and includes its own CA cert you can use.\nCheck out `the full documentation`_ on the github page.\n\n.. _the full documentation: https://github.com/kevin1024/pytest-httpbin\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Easily test your HTTP library against a local copy of httpbin",
    "version": "2.1.0",
    "project_urls": {
        "Homepage": "https://github.com/kevin1024/pytest-httpbin"
    },
    "split_keywords": [
        "pytest-httpbin",
        "testing",
        "pytest",
        "httpbin"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0d97149289c7123f75e98edc94872545c2f597f349ee037b1e0a47aef0362fd4",
                "md5": "9643224ba94e177e6d7c13eeefea1275",
                "sha256": "b3bf7346cc2ad231447189cd85b458e341056684a7a69d69533dd29692209cdd"
            },
            "downloads": -1,
            "filename": "pytest_httpbin-2.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9643224ba94e177e6d7c13eeefea1275",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 8309,
            "upload_time": "2024-09-18T15:35:56",
            "upload_time_iso_8601": "2024-09-18T15:35:56.860076Z",
            "url": "https://files.pythonhosted.org/packages/0d/97/149289c7123f75e98edc94872545c2f597f349ee037b1e0a47aef0362fd4/pytest_httpbin-2.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "438323b510bb5f20b1982f010dbf82d17e21f701470033e2f4d952ce6cf7a1c6",
                "md5": "1397b53a60b10c5a8393a450583847c8",
                "sha256": "d40579838443228327f9fe4f08d9338bee8885c29fe933e5f2d58c20a26c33c6"
            },
            "downloads": -1,
            "filename": "pytest_httpbin-2.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1397b53a60b10c5a8393a450583847c8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 13664,
            "upload_time": "2024-09-18T15:35:58",
            "upload_time_iso_8601": "2024-09-18T15:35:58.222600Z",
            "url": "https://files.pythonhosted.org/packages/43/83/23b510bb5f20b1982f010dbf82d17e21f701470033e2f4d952ce6cf7a1c6/pytest_httpbin-2.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-18 15:35:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kevin1024",
    "github_project": "pytest-httpbin",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pytest-httpbin"
}
        
Elapsed time: 0.31307s