Release Notes

Release 1.1.3

  • Bugfix: #430 Respect socket timeout.

Release 1.1.2

  • Bugfix: #426 Segmentation fault when running against a large amount of tests with pytest --mypy.

Release 1.1.1

  • Bugfix: httpretty.disable() injects pyopenssl into urllib3 even if it originally wasn’t #417

  • Bugfix: “Incompatibility with boto3 S3 put_object” #416

  • Bugfix: “Regular expression for URL -> TypeError: wrap_socket() missing 1 required” #413

  • Bugfix: “Making requests to non-stadard port throws TimeoutError “#387

Release 1.1.0

  • Feature: Display mismatched URL within UnmockedError whenever possible. #388

  • Feature: Display mismatched URL via logging. #419

  • Add new properties to httpretty.core.HTTPrettyRequest (protocol, host, url, path, method).

Example usage:

import httpretty
import requests

@httpretty.activate(verbose=True, allow_net_connect=False)
def test_mismatches():
    requests.get('http://sql-server.local')
    requests.get('https://redis.local')

Release 1.0.5

Release 1.0.4

  • Python 3.8 and 3.9 support. #407

Release 1.0.3

  • Fix compatibility with urllib3>=1.26. #410

Release 1.0.0

  • Drop Python 2 support.

  • Fix usage with redis and improve overall real-socket passthrough. #271.

  • Fix TypeError: wrap_socket() missing 1 required positional argument: ‘sock’ (#393)

  • Merge pull request #364

  • Merge pull request #371

  • Merge pull request #379

  • Merge pull request #386

  • Merge pull request #302

  • Merge pull request #373

  • Merge pull request #383

  • Merge pull request #385

  • Merge pull request #389

  • Merge pull request #391

  • Fix simple typo: neighter -> neither.

  • Updated documentation for register_uri concerning using ports.

  • Clarify relation between enabled and httprettized in API docs.

  • Align signature with builtin socket.

Release 0.9.4

Improvements:

  • Official Python 3.6 support

  • Normalized coding style to comform with PEP8 (partially)

  • Add more API reference coverage in docstrings of members such as httpretty.core.Entry

  • Continuous Integration building python 2.7 and 3.6

  • Migrate from pip to pipenv

Release 0.8.4

Improvements:

  • Refactored core.py and increased its unit test coverage to 80%. HTTPretty is slightly more robust now.

Bug fixes:

  • POST requests being called twice #100

Release 0.6.5

Applied pull requests:

  • continue on EAGAIN socket errors: #102 by kouk.

  • Fix fake_gethostbyname for requests 2.0: #101 by mgood

  • Add a way to match the querystrings: #98 by ametaireau

  • Use common string case for URIInfo hostname comparison: #95 by mikewaters

  • Expose httpretty.reset() to public API: #91 by imankulov

  • Don’t duplicate http ports number: #89 by mardiros

  • Adding parsed_body parameter to simplify checks: #88 by toumorokoshi

  • Use the real socket if it’s not HTTP: #87 by mardiros

Release 0.6.2

  • Fixing bug of lack of trailing slashes #73

  • Applied pull requests #71 and #72 by @andresriancho

  • Keyword arg coercion fix by @dupuy

  • @papaeye fixed content-length calculation.

Release 0.6.1

  • New API, no more camel case and everything is available through a simple import:

import httpretty

@httpretty.activate
def test_function():
    # httpretty.register_uri(...)
    # make request...
    pass
  • Re-organized module into submodules

Release 0.5.14

Release 0.5.12

  • HTTPretty doesn’t hang when using other application protocols under a @httprettified decorated test.

Release 0.5.11

  • Ability to know whether HTTPretty is or not enabled through httpretty.is_enabled()

Release 0.5.10

  • Support to multiple methods per registered URL. Thanks @hughsaunders

Release 0.5.9

  • Fixed python 3 support. Thanks @spulec

Release 0.5.8