Skip to content

Commit 77e2455

Browse files
author
Chang She
committed
TST: fix broken test case on py3 and add assertRaises #3179
1 parent 193beb3 commit 77e2455

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/tseries/tests/test_period.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1929,10 +1929,12 @@ def test_to_datetime_1703(self):
19291929
def test_get_loc_msg(self):
19301930
idx = period_range('2000-1-1', freq='A', periods=10)
19311931
bad_period = Period('2012', 'A')
1932+
self.assertRaises(KeyError, idx.get_loc, bad_period)
1933+
19321934
try:
19331935
idx.get_loc(bad_period)
19341936
except KeyError as inst:
1935-
self.assert_(inst.message == bad_period)
1937+
self.assert_(inst.args[0] == bad_period)
19361938

19371939
def test_append_concat(self):
19381940
# #1815

0 commit comments

Comments
 (0)