diff --git a/pandas/tests/reshape/test_merge.py b/pandas/tests/reshape/test_merge.py index ba9ea6a4d93577..fedbbd9df6db27 100644 --- a/pandas/tests/reshape/test_merge.py +++ b/pandas/tests/reshape/test_merge.py @@ -1136,14 +1136,14 @@ def test_join_multi_levels(self): def f(): household.join(portfolio, how='inner') - self.assertRaises(ValueError, f) + pytest.raises(ValueError, f) portfolio2 = portfolio.copy() portfolio2.index.set_names(['household_id', 'foo']) def f(): portfolio2.join(portfolio, how='inner') - self.assertRaises(ValueError, f) + pytest.raises(ValueError, f) def test_join_multi_levels2(self): @@ -1332,7 +1332,7 @@ def test_join_multi_levels3(self): def f(): matrix.join(distances2, how='left') - self.assertRaises(TypeError, f) + pytest.raises(TypeError, f) #No-overlapping level names distances2 = ( @@ -1348,7 +1348,7 @@ def f(): def f(): matrix.join(distances2, how='left') - self.assertRaises(ValueError, f) + pytest.raises(ValueError, f) # Empty Level distances2 = (