Skip to content

Updated with match #24707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 16, 2019
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
2 changes: 1 addition & 1 deletion pandas/tests/io/test_excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ def test_excel_read_buffer(self, ext):

def test_bad_engine_raises(self, ext):
bad_engine = 'foo'
with pytest.raises(ValueError, message="Unknown engine: foo"):
with pytest.raises(ValueError, match="Unknown engine: foo"):
read_excel('', engine=bad_engine)

@tm.network
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/test_pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -3923,7 +3923,7 @@ def test_read_column(self):
# HDFStore.select_column should raise a KeyError
# exception if the key is not a valid store
with pytest.raises(KeyError,
message='No object named index in the file'):
match='No object named df in the file'):
store.select_column('df', 'index')

store.append('df', df)
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/scalar/timestamp/test_unary_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def test_round_dst_border_nonexistent(self, method, ts_str, freq):
assert result is NaT

with pytest.raises(pytz.NonExistentTimeError,
message='2018-03-11 02:00:00'):
match='2018-03-11 02:00:00'):
getattr(ts, method)(freq, nonexistent='raise')

@pytest.mark.parametrize('timestamp', [
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/series/test_datetime_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def test_dt_round_tz_nonexistent(self, method, ts_str, freq):
tm.assert_series_equal(result, expected)

with pytest.raises(pytz.NonExistentTimeError,
message='2018-03-11 02:00:00'):
match='2018-03-11 02:00:00'):
getattr(s.dt, method)(freq, nonexistent='raise')

def test_dt_namespace_accessor_categorical(self):
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/sparse/frame/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ def test_constructor_from_unknown_type(self):
class Unknown(object):
pass
with pytest.raises(TypeError,
message='SparseDataFrame called with unknown type '
'"Unknown" for data argument'):
match=('SparseDataFrame called with unknown type '
'"Unknown" for data argument')):
SparseDataFrame(Unknown())

def test_constructor_preserve_attr(self):
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def test_deprecate_option(self):
warnings.simplefilter('always')
with pytest.raises(
KeyError,
message="Nonexistent option didn't raise KeyError"):
match="No such keys.s.: 'foo'"):
self.cf.get_option('foo')
assert len(w) == 1 # should have raised one warning
assert 'deprecated' in str(w[-1]) # we get the default message
Expand Down