1{ lib 2, buildPythonPackage 3, fetchPypi 4, tornado 5, requests 6, httplib2 7, sure 8, nose 9, nose-exclude 10, coverage 11, rednose 12, nose-randomly 13, six 14, mock 15, pytest 16, freezegun 17}: 18 19buildPythonPackage rec { 20 pname = "httpretty"; 21 version = "1.1.4"; 22 23 # drop this for version > 0.9.7 24 # Flaky tests: https://github.com/gabrielfalcao/HTTPretty/pull/394 25 doCheck = lib.versionAtLeast version "0.9.8"; 26 27 src = fetchPypi { 28 inherit pname version; 29 sha256 = "20de0e5dd5a18292d36d928cc3d6e52f8b2ac73daec40d41eb62dee154933b68"; 30 }; 31 32 propagatedBuildInputs = [ six ]; 33 34 checkInputs = [ nose sure coverage mock rednose pytest 35 # Following not declared in setup.py 36 nose-randomly requests tornado httplib2 nose-exclude freezegun 37 ]; 38 39 checkPhase = '' 40 nosetests tests/unit # functional tests cause trouble requiring /etc/protocol 41 ''; 42 43 __darwinAllowLocalNetworking = true; 44 45 # Those flaky tests are failing intermittently on all platforms 46 NOSE_EXCLUDE = lib.concatStringsSep "," [ 47 "tests.functional.test_httplib2.test_callback_response" 48 "tests.functional.test_requests.test_streaming_responses" 49 "tests.functional.test_httplib2.test_callback_response" 50 "tests.functional.test_requests.test_httpretty_should_allow_adding_and_overwritting_by_kwargs_u2" 51 ]; 52 53 meta = with lib; { 54 homepage = "https://httpretty.readthedocs.org/"; 55 description = "HTTP client request mocking tool"; 56 license = licenses.mit; 57 }; 58}