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
|
{ lib
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
|
, callPackage
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, flaky
|
, flaky
|
||||||
, hypothesis
|
, hypothesis
|
||||||
|
@ -23,6 +24,11 @@ buildPythonPackage rec {
|
||||||
hash = "sha256-eopKlDKiTvGmqcqw44MKlhvSKswKZd/VDYRpZbuyOqM=";
|
hash = "sha256-eopKlDKiTvGmqcqw44MKlhvSKswKZd/VDYRpZbuyOqM=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
outputs = [
|
||||||
|
"out"
|
||||||
|
"testout"
|
||||||
|
];
|
||||||
|
|
||||||
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
|
@ -33,15 +39,13 @@ buildPythonPackage rec {
|
||||||
pytest
|
pytest
|
||||||
];
|
];
|
||||||
|
|
||||||
checkInputs = [
|
postInstall = ''
|
||||||
flaky
|
mkdir $testout
|
||||||
hypothesis
|
cp -R tests $testout/tests
|
||||||
pytestCheckHook
|
'';
|
||||||
];
|
|
||||||
|
|
||||||
disabledTestPaths = [
|
doCheck = false;
|
||||||
"tests/trio" # pytest-trio causes infinite recursion
|
passthru.tests.pytest = callPackage ./tests.nix {};
|
||||||
];
|
|
||||||
|
|
||||||
pythonImportsCheck = [
|
pythonImportsCheck = [
|
||||||
"pytest_asyncio"
|
"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