Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, buildPythonPackage 3, fetchFromGitHub 4, httpbin 5, pytest 6, pytestCheckHook 7, pythonOlder 8, requests 9, six 10}: 11 12buildPythonPackage rec { 13 pname = "pytest-httpbin"; 14 version = "1.0.2"; 15 format = "setuptools"; 16 17 disabled = pythonOlder "3.7"; 18 19 src = fetchFromGitHub { 20 owner = "kevin1024"; 21 repo = "pytest-httpbin"; 22 rev = "v${version}"; 23 hash = "sha256-S4ThQx4H3UlKhunJo35esPClZiEn7gX/Qwo4kE1QMTI="; 24 }; 25 26 buildInputs = [ 27 pytest 28 ]; 29 30 propagatedBuildInputs = [ 31 httpbin 32 six 33 ]; 34 35 preCheck = '' 36 # Remove assertion that doesn't hold for Flask 2.1.0 37 substituteInPlace tests/test_server.py \ 38 --replace "assert response.headers['Location'].startswith('https://')" "" 39 ''; 40 41 nativeCheckInputs = [ 42 pytestCheckHook 43 requests 44 ]; 45 46 __darwinAllowLocalNetworking = true; 47 48 pythonImportsCheck = [ 49 "pytest_httpbin" 50 ]; 51 52 meta = with lib; { 53 description = "Test your HTTP library against a local copy of httpbin.org"; 54 homepage = "https://github.com/kevin1024/pytest-httpbin"; 55 license = licenses.mit; 56 maintainers = with maintainers; [ ]; 57 }; 58}