Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

flask-httpretty help you to mock http requests via flask.

Project description

Mock http request with flask!

flask-httpretty is built based on httpretty.

Hello world

from flask import Flask
from urllib.request import urlopen

import flask_httpretty

app = Flask(__name__)

@app.route('/', methods=['GET'])
def hello_world():
    return 'hello world'

def test_hello_world():
    flask_httpretty.register_app(app, '')
    resp = urlopen('').read()
    assert 'hello world' == resp.decode('utf-8')

Officially supported libraries

Since flask-httpretty use httpretty to monkey patches pythons’socket, it support same libraries httpretty do. these are

Project details

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
Flask_httpretty-1.3.0-py2.py3-none-any.whl (7.2 kB) Copy SHA256 hash SHA256 Wheel 3.5 Nov 30, 2015
Flask-httpretty-1.3.0.tar.gz (4.4 kB) Copy SHA256 hash SHA256 Source None Nov 30, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page