3
0
Fork 0
forked from mirrors/nixpkgs

python3Packages.pytest-asyncio: extract tests into passthru

Necessary to escape infinite recursion with hypothesis.
This commit is contained in:
Martin Weinelt 2022-07-15 00:12:17 +02:00
parent fe12670469
commit 2742ea65c6
2 changed files with 40 additions and 8 deletions

View file

@ -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"

View 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
];
}