Skip to main content
pypi badge travis-ci status Code style: Black

webtest-asgi provides integration of WebTest with ASGI applications.

Disclaimer

You should probably use Starlette’s TestClient instead of this package for testing ASGI applications. This package was created to test webargs-starlette using webargs’ CommonTestCase, which uses WebTest to test common functionality across multiple web frameworks.

Installation

pip install webtest-asgi

Usage

You can use webtest-asgi with any ASGI application. Here is example usage with Starlette.

from starlette.applications import Starlette
from starlette.responses import JSONResponse
from webtest_asgi import TestApp as WebTestApp

app = Starlette()


@app.route("/")
async def homepage(request):
    return JSONResponse({"hello": "world"})


@pytest.fixture()
def testapp():
    return WebTestApp(app)


def test_get_homepage(testapp):
    assert testapp.get("/").json == {"hello": "world"}

License

MIT licensed. See the bundled LICENSE file for more details.

Release files for webtest-asgi 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for webtest-asgi 2.0.0
File Size Uploaded
webtest_asgi-2.0.0.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for webtest-asgi 2.0.0
File Interpreter ABI Platform
webtest_asgi-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.6 kB

Release files / webtest_asgi-2.0.0.tar.gz

Download URL webtest_asgi-2.0.0.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
086bd9dc602980e67bad9554cec9aa8a21aff783a3f8fdb9637b23d9c598d701
BLAKE2b-256 checksum
How to use checksums
e6bacd2a5629037a3f0d2414d5ad4a23ebdfb368190d6cdbcfe6965ff1424c9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 15, 2025.

Transparency log

Release files / webtest_asgi-2.0.0-py3-none-any.whl

Download URL webtest_asgi-2.0.0-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
314ada7dc5f096cd3b39c34555bfedd3e0f147aba43dc7d73e90ef38cbf8c26f
BLAKE2b-256 checksum
How to use checksums
6070c3f9d7b0c92a847c9d7ba828e000ee479f915bbc2aa8af895bf2c5110300
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 15, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page