forked from mirrors/nixpkgs
python3Packages.pytest-asyncio: extract tests into passthru
Necessary to escape infinite recursion with hypothesis.
This commit is contained in:
parent
fe12670469
commit
2742ea65c6
|
@ -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"
|
||||
|
|
28
pkgs/development/python-modules/pytest-asyncio/tests.nix
Normal file
28
pkgs/development/python-modules/pytest-asyncio/tests.nix
Normal file
|
@ -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
|
||||
];
|
||||
}
|
Loading…
Reference in a new issue