arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject [arrow] branch master updated: ARROW-1739: [Python] Fix broken build due to using unittest.TestCase methods
Date Thu, 26 Oct 2017 17:39:09 GMT
This is an automated email from the ASF dual-hosted git repository.

wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new a385e2b  ARROW-1739: [Python] Fix broken build due to using unittest.TestCase methods
a385e2b is described below

commit a385e2b963c1141b3febc3e27c01b62ce35272cb
Author: Wes McKinney <wes.mckinney@twosigma.com>
AuthorDate: Thu Oct 26 13:39:05 2017 -0400

    ARROW-1739: [Python] Fix broken build due to using unittest.TestCase methods
    
    Author: Wes McKinney <wes.mckinney@twosigma.com>
    
    Closes #1255 from wesm/ARROW-1739 and squashes the following commits:
    
    f8d2457f [Wes McKinney] Fix flake
    101f236c [Wes McKinney] Use pytest.raises instead of self.assertRaises
---
 python/pyarrow/array.pxi                    |  3 ++-
 python/pyarrow/tests/test_convert_pandas.py | 14 +++++++-------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/python/pyarrow/array.pxi b/python/pyarrow/array.pxi
index c57eda1..7da5c3c 100644
--- a/python/pyarrow/array.pxi
+++ b/python/pyarrow/array.pxi
@@ -373,7 +373,8 @@ cdef class Array:
 
         return pyarrow_wrap_array(result)
 
-    def to_pandas(self, c_bool strings_to_categorical=False, zero_copy_only=False):
+    def to_pandas(self, c_bool strings_to_categorical=False,
+                  zero_copy_only=False):
         """
         Convert to an array object suitable for use in pandas
 
diff --git a/python/pyarrow/tests/test_convert_pandas.py b/python/pyarrow/tests/test_convert_pandas.py
index ddb7eb4..8360dae 100644
--- a/python/pyarrow/tests/test_convert_pandas.py
+++ b/python/pyarrow/tests/test_convert_pandas.py
@@ -218,31 +218,31 @@ class TestPandasConversion(object):
         npt.assert_array_equal(result, [0, 1, 2])
 
     def test_zero_copy_failure_on_object_types(self):
-        with self.assertRaises(pa.ArrowException):
+        with pytest.raises(pa.ArrowException):
             pa.array(['A', 'B', 'C']).to_pandas(zero_copy_only=True)
 
     def test_zero_copy_failure_with_int_when_nulls(self):
-        with self.assertRaises(pa.ArrowException):
+        with pytest.raises(pa.ArrowException):
             pa.array([0, 1, None]).to_pandas(zero_copy_only=True)
 
     def test_zero_copy_failure_with_float_when_nulls(self):
-        with self.assertRaises(pa.ArrowException):
+        with pytest.raises(pa.ArrowException):
             pa.array([0.0, 1.0, None]).to_pandas(zero_copy_only=True)
 
     def test_zero_copy_failure_on_bool_types(self):
-        with self.assertRaises(pa.ArrowException):
+        with pytest.raises(pa.ArrowException):
             pa.array([True, False]).to_pandas(zero_copy_only=True)
 
     def test_zero_copy_failure_on_list_types(self):
         arr = np.array([[1, 2], [8, 9]], dtype=object)
 
-        with self.assertRaises(pa.ArrowException):
+        with pytest.raises(pa.ArrowException):
             pa.array(arr).to_pandas(zero_copy_only=True)
 
     def test_zero_copy_failure_on_timestamp_types(self):
         arr = np.array(['2007-07-13'], dtype='datetime64[ns]')
 
-        with self.assertRaises(pa.ArrowException):
+        with pytest.raises(pa.ArrowException):
             pa.array(arr).to_pandas(zero_copy_only=True)
 
     def test_zero_copy_dictionaries(self):
@@ -250,7 +250,7 @@ class TestPandasConversion(object):
             np.array([0, 0]),
             np.array(['A']))
 
-        with self.assertRaises(pa.ArrowException):
+        with pytest.raises(pa.ArrowException):
             arr.to_pandas(zero_copy_only=True)
 
     def test_float_nulls(self):

-- 
To stop receiving notification emails like this one, please contact
['"commits@arrow.apache.org" <commits@arrow.apache.org>'].

Mime
View raw message