diff --git a/pkgs/development/python-modules/pytest-asyncio/default.nix b/pkgs/development/python-modules/pytest-asyncio/default.nix index 8c368c50e32c..4ab6093947c4 100644 --- a/pkgs/development/python-modules/pytest-asyncio/default.nix +++ b/pkgs/development/python-modules/pytest-asyncio/default.nix @@ -1,5 +1,6 @@ { lib , buildPythonPackage +, callPackage , fetchFromGitHub , flaky , hypothesis @@ -23,6 +24,11 @@ buildPythonPackage rec { hash = "sha256-eopKlDKiTvGmqcqw44MKlhvSKswKZd/VDYRpZbuyOqM="; }; + outputs = [ + "out" + "testout" + ]; + SETUPTOOLS_SCM_PRETEND_VERSION = version; nativeBuildInputs = [ @@ -33,15 +39,13 @@ buildPythonPackage rec { pytest ]; - checkInputs = [ - flaky - hypothesis - pytestCheckHook - ]; + postInstall = '' + mkdir $testout + cp -R tests $testout/tests + ''; - disabledTestPaths = [ - "tests/trio" # pytest-trio causes infinite recursion - ]; + doCheck = false; + passthru.tests.pytest = callPackage ./tests.nix {}; pythonImportsCheck = [ "pytest_asyncio" diff --git a/pkgs/development/python-modules/pytest-asyncio/tests.nix b/pkgs/development/python-modules/pytest-asyncio/tests.nix new file mode 100644 index 000000000000..17e60e4369bd --- /dev/null +++ b/pkgs/development/python-modules/pytest-asyncio/tests.nix @@ -0,0 +1,28 @@ +{ buildPythonPackage +, flaky +, hypothesis +, pytest-asyncio +, pytest-trio +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "pytest-asyncio-tests"; + inherit (pytest-asyncio) version; + + src = pytest-asyncio.testout; + + dontBuild = true; + dontInstall = true; + + propagatedBuildInputs = [ + pytest-asyncio + ]; + + checkInputs = [ + flaky + hypothesis + pytest-trio + pytestCheckHook + ]; +}