From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E70A41381F3 for ; Fri, 12 Jun 2020 10:59:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 14A3EE0960; Fri, 12 Jun 2020 10:59:16 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EA08BE0960 for ; Fri, 12 Jun 2020 10:59:15 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C38BC34F020 for ; Fri, 12 Jun 2020 10:59:14 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B1E561C8 for ; Fri, 12 Jun 2020 10:59:12 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1591959543.4e9f07946a0f4dad151d38fe3089130c88c9c344.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/psycopg/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/psycopg/psycopg-2.8.4.ebuild X-VCS-Directories: dev-python/psycopg/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 4e9f07946a0f4dad151d38fe3089130c88c9c344 X-VCS-Branch: master Date: Fri, 12 Jun 2020 10:59:12 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 0502a958-b9f1-4e8d-8506-2ca85ce489a4 X-Archives-Hash: f97277ce25093d20e35047a3d8d1323c commit: 4e9f07946a0f4dad151d38fe3089130c88c9c344 Author: Michał Górny gentoo org> AuthorDate: Fri Jun 12 10:24:13 2020 +0000 Commit: Michał Górny gentoo org> CommitDate: Fri Jun 12 10:59:03 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4e9f0794 dev-python/psycopg: Enable tests Signed-off-by: Michał Górny gentoo.org> dev-python/psycopg/psycopg-2.8.4.ebuild | 25 +++++++++++++++++++++---- 1 file 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 f5b41a2bfa7..76f4141a292 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