summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-03-27 16:23:07 +0100
committerMichał Górny <mgorny@gentoo.org>2020-03-27 16:24:30 +0100
commita0db8b99a3a944a1c6934360621b382ddbded75c (patch)
treec4426d2144362b48803cb930ca15bc111780b0e6 /dev-python/docker-py
parentdev-python/cliff-tablib: remove package (diff)
downloadgentoo-a0db8b99a3a944a1c6934360621b382ddbded75c.tar.gz
gentoo-a0db8b99a3a944a1c6934360621b382ddbded75c.tar.bz2
gentoo-a0db8b99a3a944a1c6934360621b382ddbded75c.zip
dev-python/docker-py: Use localhost instead of hostname in tests
Use 'localhost' in tests since it has a better chance of being resolvable (via /etc/hosts) inside network-sandbox than the system hostname. Closes: https://bugs.gentoo.org/715052 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/docker-py')
-rw-r--r--dev-python/docker-py/docker-py-4.2.0-r1.ebuild8
1 files changed, 8 insertions, 0 deletions
diff --git a/dev-python/docker-py/docker-py-4.2.0-r1.ebuild b/dev-python/docker-py/docker-py-4.2.0-r1.ebuild
index 3464896ea91a..33f23b604892 100644
--- a/dev-python/docker-py/docker-py-4.2.0-r1.ebuild
+++ b/dev-python/docker-py/docker-py-4.2.0-r1.ebuild
@@ -39,6 +39,14 @@ distutils_enable_sphinx docs \
'dev-python/recommonmark' \
'>=dev-python/sphinx-1.4.6'
+src_prepare() {
+ # localhost has a better chance of being in /etc/hosts
+ sed -e 's:socket[.]gethostname():"localhost":' \
+ -i tests/unit/api_test.py || die
+
+ distutils-r1_src_prepare
+}
+
python_test() {
pytest -vv tests/unit/ || die "tests failed under ${EPYTHON}"
}