Skip to content

Commit

Permalink
TST: fix broken test case on py3 and add assertRaises #3179
Browse files Browse the repository at this point in the history
  • Loading branch information
Chang She committed Mar 27, 2013
1 parent 193beb3 commit 77e2455
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pandas/tseries/tests/test_period.py
Original file line number Diff line number Diff line change
Expand Up @@ -1929,10 +1929,12 @@ def test_to_datetime_1703(self):
def test_get_loc_msg(self):
idx = period_range('2000-1-1', freq='A', periods=10)
bad_period = Period('2012', 'A')
self.assertRaises(KeyError, idx.get_loc, bad_period)

try:
idx.get_loc(bad_period)
except KeyError as inst:
self.assert_(inst.message == bad_period)
self.assert_(inst.args[0] == bad_period)

def test_append_concat(self):
# #1815
Expand Down

0 comments on commit 77e2455

Please sign in to comment.