Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Pytest helpers for Falcon.

Project Description

[![Build Status](]( [![Pypi version](](

# Pytest-Falcon

Pytest helpers for the Falcon framework.

## Install

pip install pytest-falcon

## Usage

You must create an `app` fixture to expose the Falcon application you want to test:

import falcon
import pytest

application = falcon.API()
application.req_options.auto_parse_form_urlencoded = True

def app():
return application

## Fixtures

### client

Allows you to test your API:

class Resource:

def on_post(self, req, resp, **kwargs):
resp.body = json.dumps(req.params)

application.add_route('/route', Resource())

def test_post(client):
resp ='/route', {'myparam': 'myvalue'})
assert resp.status == falcon.HTTP_OK
assert resp.json['myparam'] == 'myvalue'

Response properties:
- `body` the body as `str`
- `json` the body parsed as json when the response content-type is 'application/json'
- `headers` the response headers
- `status` the response status, as `str` ('200 OK', '405 Method Not Allowed'…)
- `status_code` the response status code, as `int` (200, 201…)

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(6.1 kB) Copy SHA256 Hash SHA256
Wheel 3.5 Sep 7, 2016
(4.1 kB) Copy SHA256 Hash SHA256
Source None Sep 7, 2016

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting