From 286c3314ba0a8c564bb3b8451690b998de4b842d Mon Sep 17 00:00:00 2001 From: Rajib Mitra Date: Thu, 10 Jan 2019 18:39:47 +0530 Subject: [PATCH 1/4] Update test_ticks.py --- pandas/tests/tseries/offsets/test_ticks.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pandas/tests/tseries/offsets/test_ticks.py b/pandas/tests/tseries/offsets/test_ticks.py index dcc7afa797063..27ec7d9d9093a 100644 --- a/pandas/tests/tseries/offsets/test_ticks.py +++ b/pandas/tests/tseries/offsets/test_ticks.py @@ -59,6 +59,7 @@ def test_tick_add_sub(cls, n, m): @pytest.mark.parametrize('cls', tick_classes) +@settings(deadline=None) @example(n=2, m=3) @given(n=st.integers(-999, 999), m=st.integers(-999, 999)) def test_tick_equality(cls, n, m): From a2479b91db20f02796deda742140f0eff7f0bb5c Mon Sep 17 00:00:00 2001 From: Rajib Mitra Date: Thu, 10 Jan 2019 20:52:03 +0530 Subject: [PATCH 2/4] Update test_pytables.py --- pandas/tests/io/test_pytables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/io/test_pytables.py b/pandas/tests/io/test_pytables.py index 55b738a56f809..5ee5512b18cd7 100644 --- a/pandas/tests/io/test_pytables.py +++ b/pandas/tests/io/test_pytables.py @@ -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 index in the file'): store.select_column('df', 'index') store.append('df', df) From 13745d1ee7b6705b9d53963e850a111eadc6364b Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Wed, 16 Jan 2019 07:12:26 -0600 Subject: [PATCH 3/4] Additional warnings --- pandas/tests/io/test_excel.py | 2 +- pandas/tests/scalar/timestamp/test_unary_ops.py | 2 +- pandas/tests/series/test_datetime_values.py | 2 +- pandas/tests/sparse/frame/test_frame.py | 4 ++-- pandas/tests/test_config.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pandas/tests/io/test_excel.py b/pandas/tests/io/test_excel.py index 84383afed1d03..717e9bc23c6b1 100644 --- a/pandas/tests/io/test_excel.py +++ b/pandas/tests/io/test_excel.py @@ -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 diff --git a/pandas/tests/scalar/timestamp/test_unary_ops.py b/pandas/tests/scalar/timestamp/test_unary_ops.py index 6fc6aa98fe950..3f9a30d254126 100644 --- a/pandas/tests/scalar/timestamp/test_unary_ops.py +++ b/pandas/tests/scalar/timestamp/test_unary_ops.py @@ -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', [ diff --git a/pandas/tests/series/test_datetime_values.py b/pandas/tests/series/test_datetime_values.py index 52b72bcafe555..a916cf300653a 100644 --- a/pandas/tests/series/test_datetime_values.py +++ b/pandas/tests/series/test_datetime_values.py @@ -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): diff --git a/pandas/tests/sparse/frame/test_frame.py b/pandas/tests/sparse/frame/test_frame.py index f908c7b263dee..bfb5103c97adc 100644 --- a/pandas/tests/sparse/frame/test_frame.py +++ b/pandas/tests/sparse/frame/test_frame.py @@ -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): diff --git a/pandas/tests/test_config.py b/pandas/tests/test_config.py index 6e47f5543012f..54db3887850ea 100644 --- a/pandas/tests/test_config.py +++ b/pandas/tests/test_config.py @@ -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 From a32e8274ba66a5b168611c04ba60b3b880bfe325 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Wed, 16 Jan 2019 08:41:10 -0600 Subject: [PATCH 4/4] Fixed match --- pandas/tests/io/test_pytables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/io/test_pytables.py b/pandas/tests/io/test_pytables.py index 5ee5512b18cd7..517a3e059469c 100644 --- a/pandas/tests/io/test_pytables.py +++ b/pandas/tests/io/test_pytables.py @@ -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, - match='No object named index in the file'): + match='No object named df in the file'): store.select_column('df', 'index') store.append('df', df)