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

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