diff options
author | Martin Weinelt <hexa@darmstadt.ccc.de> | 2021-01-16 13:03:51 +0100 |
---|---|---|
committer | Jonathan Ringer <jonringer@users.noreply.github.com> | 2021-01-19 10:14:41 -0800 |
commit | ec2c3053ded12c3dbfed1ccb93177c5ab572b07f (patch) | |
tree | 626ed14efb77140f0e27ea75bb096924aea5591b /pkgs | |
parent | 942b28dec0e9c1a18b99b570741d448dcb23f557 (diff) |
python3Packages.mocket: 3.9.35 -> 3.9.39
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/development/python-modules/mocket/default.nix | 52 |
1 files changed, 41 insertions, 11 deletions
diff --git a/pkgs/development/python-modules/mocket/default.nix b/pkgs/development/python-modules/mocket/default.nix index f7e97bb955c3..2102718ab6ef 100644 --- a/pkgs/development/python-modules/mocket/default.nix +++ b/pkgs/development/python-modules/mocket/default.nix @@ -5,23 +5,25 @@ , python , python_magic , six -, urllib3 }: +, urllib3 +, pytestCheckHook +, pytest-mock +, aiohttp +, gevent +, redis +, requests +, sure +}: buildPythonPackage rec { pname = "mocket"; - version = "3.9.35"; + version = "3.9.39"; src = fetchPypi { inherit pname version; - sha256 = "d822a2adfd8e028a2856785fbfe78e7dd8c7a3b623516298aef6d42a4c9149d1"; + sha256 = "1mbcgfy1vfwwzn54vkq8xmfzdyc28brfpqk4d55r3a6abwwsn6a4"; }; - patchPhase = '' - sed -iE "s,python-magic==.*,python-magic," requirements.txt - sed -iE "s,urllib3==.*,urllib3," requirements.txt - substituteInPlace setup.py --replace 'setup_requires=["pipenv"]' "setup_requires=[]" - ''; - propagatedBuildInputs = [ decorator http-parser @@ -30,8 +32,36 @@ buildPythonPackage rec { six ] ++ lib.optionals (isPy27) [ six ]; - # Pypi has no runtests.py, github has no requirements.txt. No way to test, no way to install. - doCheck = false; + checkInputs = [ + pytestCheckHook + pytest-mock + aiohttp + gevent + redis + requests + sure + ]; + + pytestFlagsArray = [ + "--ignore=tests/main/test_pook.py" # pook is not packaged + "--ignore=tests/main/test_redis.py" # requires a live redis instance + ] ++ lib.optionals (pythonOlder "3.8") [ + # uses IsolatedAsyncioTestCase which is only available >= 3.8 + "--ignore=tests/tests38/test_http_aiohttp.py" + ]; + + disabledTests = [ + # tests that require network access (like DNS lookups) + "test_truesendall" + "test_truesendall_with_chunk_recording" + "test_truesendall_with_gzip_recording" + "test_truesendall_with_recording" + "test_wrongpath_truesendall" + "test_truesendall_with_dump_from_recording" + "test_truesendall_with_recording_https" + "test_truesendall_after_mocket_session" + "test_real_request_session" + ]; pythonImportsCheck = [ "mocket" ]; |