Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pandas/io/tests/test_json/test_ujson.py
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ def testFloatMax(self):
assert_approx_equal(np.float64(ujson.decode(ujson.encode(num, double_precision=15))), num, 15)

def testArrays(self):
arr = np.arange(100);
arr = np.arange(100)

arr = arr.reshape((10, 10))
tm.assert_numpy_array_equal(np.array(ujson.decode(ujson.encode(arr))), arr)
Expand All @@ -1018,7 +1018,7 @@ def testArrays(self):
tm.assert_numpy_array_equal(np.array(ujson.decode(ujson.encode(arr))), arr)
tm.assert_numpy_array_equal(ujson.decode(ujson.encode(arr), numpy=True), arr)

arr = np.arange(96);
arr = np.arange(96)
arr = arr.reshape((2, 2, 2, 2, 3, 2))
tm.assert_numpy_array_equal(np.array(ujson.decode(ujson.encode(arr))), arr)
tm.assert_numpy_array_equal(ujson.decode(ujson.encode(arr), numpy=True), arr)
Expand All @@ -1028,7 +1028,7 @@ def testArrays(self):
arr = np.array(l)
tm.assert_numpy_array_equal(np.array(ujson.decode(ujson.encode(arr))), arr)

arr = np.arange(100.202, 200.202, 1, dtype=np.float32);
arr = np.arange(100.202, 200.202, 1, dtype=np.float32)
arr = arr.reshape((5, 5, 4))
outp = np.array(ujson.decode(ujson.encode(arr)), dtype=np.float32)
assert_array_almost_equal_nulp(arr, outp)
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -6074,7 +6074,7 @@ def test_getitem_setitem_datetimeindex(self):
assert_series_equal(result, ts)

def test_getitem_setitem_datetime_tz_pytz(self):
tm._skip_if_no_pytz();
tm._skip_if_no_pytz()
from pytz import timezone as tz

from pandas import date_range
Expand Down Expand Up @@ -6110,7 +6110,7 @@ def test_getitem_setitem_datetime_tz_pytz(self):


def test_getitem_setitem_datetime_tz_dateutil(self):
tm._skip_if_no_dateutil();
tm._skip_if_no_dateutil()
from dateutil.tz import tzutc
from pandas.tslib import _dateutil_gettz as gettz

Expand Down
10 changes: 5 additions & 5 deletions pandas/util/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1886,7 +1886,7 @@ def assertRaises(_exception, _callable=None, *args, **kwargs):
In addition to using it as a contextmanager, you can also use it as a
function, just like the normal assertRaises

>>> assertRaises(TypeError, ",".join, [1, 3, 5]);
>>> assertRaises(TypeError, ",".join, [1, 3, 5])
"""
manager = _AssertRaisesContextmanager(exception=_exception)
# don't return anything if used in function form
Expand All @@ -1907,18 +1907,18 @@ def assertRaisesRegexp(_exception, _regexp, _callable=None, *args, **kwargs):

You can pass either a regular expression or a compiled regular expression object.
>>> assertRaisesRegexp(ValueError, 'invalid literal for.*XYZ',
... int, 'XYZ');
... int, 'XYZ')
>>> import re
>>> assertRaisesRegexp(ValueError, re.compile('literal'), int, 'XYZ');
>>> assertRaisesRegexp(ValueError, re.compile('literal'), int, 'XYZ')

If an exception of a different type is raised, it bubbles up.

>>> assertRaisesRegexp(TypeError, 'literal', int, 'XYZ');
>>> assertRaisesRegexp(TypeError, 'literal', int, 'XYZ')
Traceback (most recent call last):
...
ValueError: invalid literal for int() with base 10: 'XYZ'
>>> dct = dict()
>>> assertRaisesRegexp(KeyError, 'pear', dct.__getitem__, 'apple');
>>> assertRaisesRegexp(KeyError, 'pear', dct.__getitem__, 'apple')
Traceback (most recent call last):
...
AssertionError: "pear" does not match "'apple'"
Expand Down