@@ -0,0 +1,40 @@
1+{ lib
2+, buildPythonPackage
3+, fetchFromGitHub
4+, pytestCheckHook
5+, httpcore
6+, httpx
7+, pytest-asyncio
8+, sanic
9+, websockets
10+}:
11+
12+buildPythonPackage rec {
13+ pname = "sanic-testing";
14+ version = "0.3.1";
15+
16+ src = fetchFromGitHub {
17+ owner = "sanic-org";
18+ repo = "sanic-testing";
19+ rev = "v${version}";
20+ hash = "sha256-hBAq+/BKs0a01M89Nb8HaClqxB+W5PTfjVzef/m9SWs=";
21+ };
22+
23+ propagatedBuildInputs = [ httpx sanic websockets httpcore ];
24+
25+ # `sanic` is explicitly set to null when building `sanic` itself
26+ # to prevent infinite recursion. In that case we skip running
27+ # the package at all.
28+ doCheck = sanic != null;
29+ dontUsePythonImportsCheck = sanic == null;
30+
31+ checkInputs = [ pytestCheckHook pytest-asyncio ];
32+ pythonImportsCheck = [ "sanic_testing" ];
33+
34+ meta = with lib; {
35+ description = "Core testing clients for the Sanic web framework";
36+ homepage = "https://github.com/sanic-org/sanic-testing";
37+ license = licenses.mit;
38+ maintainers = with maintainers; [ AluisioASG ];
39+ };
40+}