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

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'


@flask_httpretty.activate
def test_hello_world():
    flask_httpretty.register_app(app, 'http://hellotest.com')
    resp = urlopen('http://hellotest.com').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

Release History

Release History

This version
History Node

1.3.0

History Node

1.2.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
Flask_httpretty-1.3.0-py2.py3-none-any.whl (7.2 kB) Copy SHA256 Checksum SHA256 3.5 Wheel Nov 30, 2015
Flask-httpretty-1.3.0.tar.gz (4.4 kB) Copy SHA256 Checksum SHA256 Source Nov 30, 2015

Supported By

WebFaction WebFaction Technical Writing 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 Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting