diff options
author | Michał Górny <mgorny@gentoo.org> | 2020-06-12 12:24:13 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2020-06-12 12:59:03 +0200 |
commit | 4e9f07946a0f4dad151d38fe3089130c88c9c344 (patch) | |
tree | fa1274d6675466e2dbdd40e7473f550539c07b85 /dev-python | |
parent | mail-mta/postfix: bump to 3.6_pre20200610 (diff) | |
download | gentoo-4e9f07946a0f4dad151d38fe3089130c88c9c344.tar.gz gentoo-4e9f07946a0f4dad151d38fe3089130c88c9c344.tar.bz2 gentoo-4e9f07946a0f4dad151d38fe3089130c88c9c344.zip |
dev-python/psycopg: Enable tests
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python')
-rw-r--r-- | dev-python/psycopg/psycopg-2.8.4.ebuild | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/dev-python/psycopg/psycopg-2.8.4.ebuild b/dev-python/psycopg/psycopg-2.8.4.ebuild index f5b41a2bfa7d..76f4141a2922 100644 --- a/dev-python/psycopg/psycopg-2.8.4.ebuild +++ b/dev-python/psycopg/psycopg-2.8.4.ebuild @@ -13,6 +13,7 @@ MY_P="${MY_PN}-${PV}" DESCRIPTION="PostgreSQL database adapter for Python" HOMEPAGE="http://initd.org/psycopg/ https://pypi.org/project/psycopg2/" SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz" +S=${WORKDIR}/${MY_P} LICENSE="LGPL-3+" SLOT="2" @@ -26,15 +27,11 @@ DEPEND="${RDEPEND} >=dev-python/sphinx-1.6 )" -RESTRICT="test" - # Avoid using mxdatetime: https://bugs.gentoo.org/452028 PATCHES=( "${FILESDIR}"/psycopg-2.8.3-avoid-mxdatetime.patch ) -S="${WORKDIR}/${MY_P}" - python_compile() { local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS} @@ -55,6 +52,26 @@ python_compile_all() { use doc && emake -C doc/src -j1 html text } +src_test() { + initdb -D "${T}"/pgsql || die + # TODO: random port + pg_ctl -w -D "${T}"/pgsql start \ + -o "-h '' -k '${T}'" || die + createdb -h "${T}" psycopg2_test || die + + local -x PSYCOPG2_TESTDB_HOST="${T}" + distutils-r1_src_test + + pg_ctl -w -D "${T}"/pgsql stop || die +} + +python_test() { + "${EPYTHON}" -c " +import tests +tests.unittest.main(defaultTest='tests.test_suite') +" --verbose || die "Tests fail with ${EPYTHON}" +} + python_install_all() { if use doc; then dodoc -r doc/src/_build/html |