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": "https://github.com/kevin1024/pytest-httpbin",
"name": "pytest-httpbin",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "pytest-httpbin testing pytest httpbin",
"author": "Kevin McCarthy",
"author_email": "me@kevinmccarthy.org",
"download_url": "https://files.pythonhosted.org/packages/f1/ef/84a42d941283ab6dd04a11743650abae40c1945ff8c3d6ea071426fb00bf/pytest-httpbin-2.0.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.0.0",
"project_urls": {
"Homepage": "https://github.com/kevin1024/pytest-httpbin"
},
"split_keywords": [
"pytest-httpbin",
"testing",
"pytest",
"httpbin"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2effaec307ae2a6193db3f87dd5fd75738007bbb212b5237d31a4ab638215f42",
"md5": "f48ca5d7869de1804393e9c1329c0b6a",
"sha256": "d977f8095796e27a45911bbafa3587c081c9025e060e2fdb559794db2d45e82d"
},
"downloads": -1,
"filename": "pytest_httpbin-2.0.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "f48ca5d7869de1804393e9c1329c0b6a",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.7",
"size": 9877,
"upload_time": "2023-05-08T20:12:03",
"upload_time_iso_8601": "2023-05-08T20:12:03.997489Z",
"url": "https://files.pythonhosted.org/packages/2e/ff/aec307ae2a6193db3f87dd5fd75738007bbb212b5237d31a4ab638215f42/pytest_httpbin-2.0.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f1ef84a42d941283ab6dd04a11743650abae40c1945ff8c3d6ea071426fb00bf",
"md5": "957241c636baeac61eff42089225afc5",
"sha256": "3e739cad9b8f8df58952df7329d9295fe17449d3a647f49c4ce634fd81d71b8e"
},
"downloads": -1,
"filename": "pytest-httpbin-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "957241c636baeac61eff42089225afc5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 16081,
"upload_time": "2023-05-08T20:12:08",
"upload_time_iso_8601": "2023-05-08T20:12:08.108942Z",
"url": "https://files.pythonhosted.org/packages/f1/ef/84a42d941283ab6dd04a11743650abae40c1945ff8c3d6ea071426fb00bf/pytest-httpbin-2.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-08 20:12:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kevin1024",
"github_project": "pytest-httpbin",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "pytest-httpbin"
}