1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 fetchpatch,
7 poetry-core,
8 aiohttp,
9 pytest,
10 pytest-asyncio,
11 pytestCheckHook,
12}:
13
14buildPythonPackage rec {
15 pname = "pytest-mockservers";
16 version = "0.6.0";
17 format = "pyproject";
18 disabled = pythonOlder "3.6";
19
20 src = fetchFromGitHub {
21 owner = "Gr1N";
22 repo = "pytest-mockservers";
23 rev = version;
24 hash = "sha256-Mb3wSbambC1h+lFI+fafwZzm78IvADNAsF/Uw60DFHc=";
25 };
26
27 patches = [
28 # https://github.com/Gr1N/pytest-mockservers/pull/75
29 (fetchpatch {
30 name = "use-poetry-core.patch";
31 url = "https://github.com/Gr1N/pytest-mockservers/commit/c7731186a4e12851ab1c15ab56e652bb48ed59c4.patch";
32 hash = "sha256-/5X3xjJwt2gs3t6f/6n1QZ+CTBq/5+cQE+MgNWyz+Hs=";
33 })
34 ];
35
36 nativeBuildInputs = [ poetry-core ];
37
38 buildInputs = [ pytest ];
39
40 propagatedBuildInputs = [
41 aiohttp
42 pytest-asyncio
43 ];
44
45 __darwinAllowLocalNetworking = true;
46
47 nativeCheckInputs = [ pytestCheckHook ];
48
49 # relies on the removed event_loop fixture
50 disabledTests = [ "test_udp_server_factory" ];
51
52 pythonImportsCheck = [ "pytest_mockservers" ];
53
54 meta = with lib; {
55 description = "Set of fixtures to test your requests to HTTP/UDP servers";
56 homepage = "https://github.com/Gr1N/pytest-mockservers";
57 license = licenses.mit;
58 maintainers = with maintainers; [ fab ];
59 };
60}