Skip to main content

A set of py.test fixtures for AWS Chalice

Project description

PyPI version Python versions See Build Status on Travis CI

A set of py.test fixtures for AWS Chalice


  • Launch the local gateway per test function
  • Provide an abstracted client fixture to access the local gateway
  • Expose an interface to overwrite response context with arbitrary objects
    • As of Chalice version 1.8.0, LocalGateway object doesn’t handle Cognito’s context
    • Not only for this purpose, it’s an interface provided to allow custom contexts in unit tests



You can install “pytest-chalice” via pip from PyPI:

$ pip install pytest-chalice


from chalice import Chalice

app = Chalice(__name__)

def index:
    return {'hello': 'world'}
from http import HTTPStatus

def test_index(client):
    response = client.get('/')
    assert response.status_code == HTTPStatus.OK
    assert response.json == {'hello': 'world'}

See examples for more detailed


Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.


Distributed under the terms of the MIT license, “pytest-chalice” is free and open source software


If you encounter any problems, please file an issue along with a detailed description.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pytest-chalice, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size pytest-chalice-0.0.4.tar.gz (14.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page