python310Packages.psycopg: Test against a live postgresql instance
provided by postgresqlTestHook. Extends our test coverage on Linux from 250 to over 4000 tests, that run in a reasonable time.
This commit is contained in:
parent
42d82719f3
commit
66d4106a41
|
@ -30,6 +30,7 @@
|
|||
, pproxy
|
||||
, pytest-randomly
|
||||
, pytestCheckHook
|
||||
, postgresqlTestHook
|
||||
}:
|
||||
|
||||
let
|
||||
|
@ -165,10 +166,6 @@ buildPythonPackage rec {
|
|||
pool = [ psycopg-pool ];
|
||||
};
|
||||
|
||||
preCheck = ''
|
||||
cd ..
|
||||
'';
|
||||
|
||||
nativeCheckInputs = [
|
||||
anyio
|
||||
pproxy
|
||||
|
@ -176,9 +173,21 @@ buildPythonPackage rec {
|
|||
pytestCheckHook
|
||||
postgresql
|
||||
]
|
||||
++ lib.optional (stdenv.isLinux) postgresqlTestHook
|
||||
++ passthru.optional-dependencies.c
|
||||
++ passthru.optional-dependencies.pool;
|
||||
|
||||
env = {
|
||||
postgresqlEnableTCP = 1;
|
||||
PGUSER = "psycopg";
|
||||
};
|
||||
|
||||
preCheck = ''
|
||||
cd ..
|
||||
'' + lib.optionalString (stdenv.isLinux) ''
|
||||
export PSYCOPG_TEST_DSN="host=127.0.0.1 user=$PGUSER"
|
||||
'';
|
||||
|
||||
disabledTests = [
|
||||
# don't depend on mypy for tests
|
||||
"test_version"
|
||||
|
|
Loading…
Reference in a new issue