2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
2021-04-05 15:23:46 +00:00
|
|
|
, aiohttp
|
2021-03-12 07:09:13 +00:00
|
|
|
, async_generator
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2021-03-12 07:09:13 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, httpx
|
2020-04-24 23:36:52 +00:00
|
|
|
, pytest
|
2021-03-12 07:09:13 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, sanic
|
|
|
|
, websockets
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pytest-sanic";
|
2021-05-28 09:39:13 +00:00
|
|
|
version = "1.7.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-12 07:09:13 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "yunstanford";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-05-28 09:39:13 +00:00
|
|
|
sha256 = "sha256-OtyulpSHUWERtcIRT5j3YtHciIxFiIFYKqtlEd1NSFw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
buildInputs = [
|
|
|
|
pytest
|
|
|
|
];
|
2021-04-05 15:23:46 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
2021-04-05 15:23:46 +00:00
|
|
|
aiohttp
|
2020-04-24 23:36:52 +00:00
|
|
|
async_generator
|
2021-03-12 07:09:13 +00:00
|
|
|
httpx
|
|
|
|
pytest
|
|
|
|
websockets
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-03-12 07:09:13 +00:00
|
|
|
checkInputs = [
|
|
|
|
sanic
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
postPatch = ''
|
|
|
|
# https://github.com/yunstanford/pytest-sanic/issues/55
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "websockets>=8.1,<9.0" "websockets>=9.1,<10.0"
|
|
|
|
'';
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
disabledTests = [
|
|
|
|
# https://github.com/yunstanford/pytest-sanic/issues/51
|
|
|
|
"test_fixture_sanic_client_get"
|
|
|
|
"test_fixture_sanic_client_post"
|
|
|
|
"test_fixture_sanic_client_put"
|
|
|
|
"test_fixture_sanic_client_delete"
|
|
|
|
"test_fixture_sanic_client_patch"
|
|
|
|
"test_fixture_sanic_client_options"
|
|
|
|
"test_fixture_sanic_client_head"
|
|
|
|
"test_fixture_sanic_client_close"
|
|
|
|
"test_fixture_sanic_client_passing_headers"
|
|
|
|
"test_fixture_sanic_client_context_manager"
|
|
|
|
"test_fixture_test_client_context_manager"
|
|
|
|
];
|
2021-03-12 07:09:13 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "pytest_sanic" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A pytest plugin for Sanic";
|
|
|
|
homepage = "https://github.com/yunstanford/pytest-sanic/";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.costrouc ];
|
|
|
|
};
|
|
|
|
}
|