commit:     b45e55796b0bf4500ec7fd6c50f15cae5ff53e83
Author:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 20 17:03:45 2020 +0000
Commit:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Tue Oct 20 17:08:59 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b45e5579

dev-util/rosdep: fix tests

Closes: https://bugs.gentoo.org/637072
Closes: https://bugs.gentoo.org/675532
Package-Manager: Portage-3.0.8, Repoman-3.0.2
Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org>

 dev-util/rosdep/files/tests.patch       | 33 +++++++++++++++++++++++++++++++++
 dev-util/rosdep/rosdep-0.19.0-r1.ebuild |  4 ++--
 dev-util/rosdep/rosdep-9999.ebuild      |  4 ++--
 3 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/dev-util/rosdep/files/tests.patch 
b/dev-util/rosdep/files/tests.patch
new file mode 100644
index 00000000000..cd6e199b3cd
--- /dev/null
+++ b/dev-util/rosdep/files/tests.patch
@@ -0,0 +1,33 @@
+Index: rosdep-0.19.0/src/rosdep2/platforms/osx.py
+===================================================================
+--- rosdep-0.19.0.orig/src/rosdep2/platforms/osx.py
++++ rosdep-0.19.0/src/rosdep2/platforms/osx.py
+@@ -303,7 +303,7 @@ class HomebrewInstaller(PackageManagerIn
+ 
+             # make sure options is a list of list of strings
+             try:
+-                valid = all([isinstance(x, _basestring) for l in options for 
x in l])
++                valid = all([isinstance(x, _basestring) for option in options 
for x in option])
+             except Exception as e:
+                 raise InvalidData("Invalid list of options '%s', error: %s" % 
(options, e))
+             else:
+Index: rosdep-0.19.0/test/test_rosdep_gentoo.py
+===================================================================
+--- rosdep-0.19.0.orig/test/test_rosdep_gentoo.py
++++ rosdep-0.19.0/test/test_rosdep_gentoo.py
+@@ -183,13 +183,11 @@ def test_PortageInstaller():
+ 
+         mock_method.return_value = ['a', 'b']
+ 
+-        expected = [['sudo', '-H', 'emerge', 'a'],
+-                    ['sudo', '-H', 'emerge', 'b']]
++        expected = [['sudo', '-H', 'emerge', 'a', 'b']]
+         val = installer.get_install_command(['whatever'], interactive=False)
+         assert val == expected, val
+ 
+-        expected = [['sudo', '-H', 'emerge', '-a', 'a'],
+-                    ['sudo', '-H', 'emerge', '-a', 'b']]
++        expected = [['sudo', '-H', 'emerge', '-a', 'a', 'b']]
+         val = installer.get_install_command(['whatever'], interactive=True)
+         assert val == expected, val
+ 

diff --git a/dev-util/rosdep/rosdep-0.19.0-r1.ebuild 
b/dev-util/rosdep/rosdep-0.19.0-r1.ebuild
index 30059ea3b7c..85998e98ada 100644
--- a/dev-util/rosdep/rosdep-0.19.0-r1.ebuild
+++ b/dev-util/rosdep/rosdep-0.19.0-r1.ebuild
@@ -39,14 +39,14 @@ DEPEND="${RDEPEND}"
 BDEPEND="
        dev-python/nose[${PYTHON_USEDEP}]
        test? (
-               dev-python/coverage[${PYTHON_USEDEP}]
                dev-python/mock[${PYTHON_USEDEP}]
                dev-python/flake8[${PYTHON_USEDEP}]
        )
 "
+PATCHES=( "${FILESDIR}/tests.patch" )
 
 python_test() {
-       nosetests --with-coverage --cover-package=rosdep2 --with-xunit test || 
die
+       env -u ROS_DISTRO nosetests --with-xunit test || die
 }
 
 pkg_postrm() {

diff --git a/dev-util/rosdep/rosdep-9999.ebuild 
b/dev-util/rosdep/rosdep-9999.ebuild
index 30059ea3b7c..85998e98ada 100644
--- a/dev-util/rosdep/rosdep-9999.ebuild
+++ b/dev-util/rosdep/rosdep-9999.ebuild
@@ -39,14 +39,14 @@ DEPEND="${RDEPEND}"
 BDEPEND="
        dev-python/nose[${PYTHON_USEDEP}]
        test? (
-               dev-python/coverage[${PYTHON_USEDEP}]
                dev-python/mock[${PYTHON_USEDEP}]
                dev-python/flake8[${PYTHON_USEDEP}]
        )
 "
+PATCHES=( "${FILESDIR}/tests.patch" )
 
 python_test() {
-       nosetests --with-coverage --cover-package=rosdep2 --with-xunit test || 
die
+       env -u ROS_DISTRO nosetests --with-xunit test || die
 }
 
 pkg_postrm() {

Reply via email to