commit: e580cd8f1440cd5e12d42017cc6c645ab7be71b1
Author: Andrey Utkin <andrey_utkin <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 15 01:16:44 2017 +0000
Commit: Andrey Utkin <andrey_utkin <AT> gentoo <DOT> org>
CommitDate: Fri Dec 15 10:09:08 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e580cd8f
dev-python/botocore: fix running tests
Functional tests suite, recently added to src_test phase, ended up using
library files already installed, and not what is to be installed.
This is handled now by passing custom PYTHONPATH, and patching tests
suite to not discard custom PYTHONPATH when launching child processes.
"nosetests" invocation for unit and functional test suites was split
into two as it doesn't work correctly when given two directory paths. It
looks like PYTHONPATH is not properly passed in that case. The reason is
unknown.
Fixes: e1fabdbdb95d ("dev-python/botocore: run also functional tests")
Bug: https://bugs.gentoo.org/640726
Package-Manager: Portage-2.3.17, Repoman-2.3.6
dev-python/botocore/botocore-1.8.6.ebuild | 5 +++-
...8.6-tests-pass-all-env-vars-to-cmd-runner.patch | 32 ++++++++++++++++++++++
2 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/dev-python/botocore/botocore-1.8.6.ebuild
b/dev-python/botocore/botocore-1.8.6.ebuild
index 8ec458cb067..08b1d49616c 100644
--- a/dev-python/botocore/botocore-1.8.6.ebuild
+++ b/dev-python/botocore/botocore-1.8.6.ebuild
@@ -38,12 +38,15 @@ DEPEND="
"
RDEPEND="${CDEPEND}"
+PATCHES=( "${FILESDIR}/1.8.6-tests-pass-all-env-vars-to-cmd-runner.patch" )
+
python_compile_all() {
use doc && emake -C docs html
}
python_test() {
- nosetests -v tests/unit tests/functional || die "tests failed under
${EPYTHON}"
+ PYTHONPATH="${BUILD_DIR}/lib" nosetests -v tests/unit || die "unit
tests failed under ${EPYTHON}"
+ PYTHONPATH="${BUILD_DIR}/lib" nosetests -v tests/functional || die
"functional tests failed under ${EPYTHON}"
}
python_install_all() {
diff --git
a/dev-python/botocore/files/1.8.6-tests-pass-all-env-vars-to-cmd-runner.patch
b/dev-python/botocore/files/1.8.6-tests-pass-all-env-vars-to-cmd-runner.patch
new file mode 100644
index 00000000000..49fd3adef37
--- /dev/null
+++
b/dev-python/botocore/files/1.8.6-tests-pass-all-env-vars-to-cmd-runner.patch
@@ -0,0 +1,32 @@
+From 78077a5e80c9ad5f909037a48100481ddfedc6b2 Mon Sep 17 00:00:00 2001
+From: Andrey Utkin <[email protected]>
+Date: Wed, 13 Dec 2017 01:50:03 +0000
+Subject: [PATCH] tests: pass all env vars to cmd-runner
+
+cmd-runner was started with no environment variables inherited.
+This breaks tests when run with custom PYTHONPATH, which is useful for
+testing botocore while not being installed in standard locations.
+
+One case when this is important is performing tests before installing
+the package in Gentoo Linux.
+
+Link: https://bugs.gentoo.org/640726
+---
+ tests/__init__.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tests/__init__.py b/tests/__init__.py
+index 74a2e4de..fa0b819b 100644
+--- a/tests/__init__.py
++++ b/tests/__init__.py
+@@ -145,6 +145,7 @@ class BaseClientDriverTest(unittest.TestCase):
+ if self.INJECT_DUMMY_CREDS:
+ env = {'AWS_ACCESS_KEY_ID': 'foo',
+ 'AWS_SECRET_ACCESS_KEY': 'bar'}
++ env.update(os.environ)
+ self.driver.start(env=env)
+
+ def cmd(self, *args):
+--
+2.15.1
+