commit:     48d6128e4748e88bce06c1ab675ee69f80fe9b66
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 16 11:11:55 2015 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Mon Nov 16 11:12:45 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48d6128e

dev-python/pandas: Backport test fix

Package-Manager: portage-2.2.23
Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>

 .../files/pandas-0.17.0-testfix-backport.patch     | 28 ++++++++++++++++++++++
 dev-python/pandas/pandas-0.17.0.ebuild             |  4 ++++
 2 files changed, 32 insertions(+)

diff --git a/dev-python/pandas/files/pandas-0.17.0-testfix-backport.patch 
b/dev-python/pandas/files/pandas-0.17.0-testfix-backport.patch
new file mode 100644
index 0000000..c833192
--- /dev/null
+++ b/dev-python/pandas/files/pandas-0.17.0-testfix-backport.patch
@@ -0,0 +1,28 @@
+ pandas/tests/test_categorical.py | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/pandas/tests/test_categorical.py 
b/pandas/tests/test_categorical.py
+old mode 100755
+new mode 100644
+index e97010e..1d14323
+--- a/pandas/tests/test_categorical.py
++++ b/pandas/tests/test_categorical.py
+@@ -86,12 +86,14 @@ class TestCategorical(tm.TestCase):
+         factor = Categorical.from_array(arr, ordered=False)
+         self.assertFalse(factor.ordered)
+ 
+-        # this however will raise as cannot be sorted
+-        # but fixed in newer versions of numpy
+-        if LooseVersion(np.__version__) < "1.10":
++        if compat.PY3:
+             self.assertRaises(TypeError, lambda :  
Categorical.from_array(arr, ordered=True))
+         else:
+-            Categorical.from_array(arr, ordered=True)
++            # this however will raise as cannot be sorted (on PY3 or older 
numpies)
++            if LooseVersion(np.__version__) < "1.10":
++                self.assertRaises(TypeError, lambda :  
Categorical.from_array(arr, ordered=True))
++            else:
++                Categorical.from_array(arr, ordered=True)
+ 
+     def test_is_equal_dtype(self):
+ 

diff --git a/dev-python/pandas/pandas-0.17.0.ebuild 
b/dev-python/pandas/pandas-0.17.0.ebuild
index b5f984f..a3fd1ca 100644
--- a/dev-python/pandas/pandas-0.17.0.ebuild
+++ b/dev-python/pandas/pandas-0.17.0.ebuild
@@ -81,6 +81,10 @@ RDEPEND="${CDEPEND}
        )
        R? ( dev-python/rpy[${PYTHON_USEDEP}] )"
 
+PATCHES=(
+       "${FILESDIR}"/${P}-testfix-backport.patch
+)
+
 python_prepare_all() {
        # Prevent un-needed download during build
        sed -e "/^              'sphinx.ext.intersphinx',/d" -i 
doc/source/conf.py || die

Reply via email to