1{ lib
2, aiohttp
3, async_generator
4, buildPythonPackage
5, doCheck ? true
6, fetchFromGitHub
7, httpx
8, pytest
9, pytestCheckHook
10, sanic
11, websockets
12}:
13
14buildPythonPackage rec {
15 pname = "pytest-sanic";
16 version = "1.7.0";
17
18 src = fetchFromGitHub {
19 owner = "yunstanford";
20 repo = pname;
21 rev = "v${version}";
22 sha256 = "1zpgnw1lqbll59chv4hgcn31mdql1nv4gw9crbihky3ly3d3ncqi";
23 };
24
25 buildInputs = [ pytest ];
26
27 propagatedBuildInputs = [
28 aiohttp
29 async_generator
30 httpx
31 pytest
32 websockets
33 ];
34
35 checkInputs = [
36 sanic
37 pytestCheckHook
38 ];
39
40 inherit doCheck;
41
42 pythonImportsCheck = [ "pytest_sanic" ];
43
44 meta = with lib; {
45 description = "A pytest plugin for Sanic";
46 homepage = "https://github.com/yunstanford/pytest-sanic/";
47 license = licenses.asl20;
48 maintainers = [ maintainers.costrouc ];
49 # pytest-sanic is incompatible with Sanic 21.3, see
50 # https://github.com/sanic-org/sanic/issues/2095 and
51 # https://github.com/yunstanford/pytest-sanic/issues/50.
52 broken = lib.versionAtLeast sanic.version "21.3.0";
53 };
54}