From 0de8d221c8959f92ee1ae463b6ef553e2a97fc75 Mon Sep 17 00:00:00 2001 From: Tim Swast Date: Tue, 11 Sep 2018 11:22:57 -0700 Subject: [PATCH] [TST] Use tm.assert_produces_warning not pytest.warns * Add comment linking to pandas-gbq issue for change in default dialect. --- pandas/tests/io/test_gbq.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pandas/tests/io/test_gbq.py b/pandas/tests/io/test_gbq.py index d8919933f4a720..68413d610e6152 100644 --- a/pandas/tests/io/test_gbq.py +++ b/pandas/tests/io/test_gbq.py @@ -12,8 +12,9 @@ import numpy as np import pandas as pd from pandas import compat, DataFrame - from pandas.compat import range +import pandas.util.testing as tm + pandas_gbq = pytest.importorskip('pandas_gbq') @@ -99,10 +100,12 @@ def make_mixed_dataframe_v2(test_size): def test_read_gbq_without_dialect_warns_future_change(monkeypatch): + # Default dialect is changing to standard SQL. See: + # https://github.com/pydata/pandas-gbq/issues/195 mock_read_gbq = mock.Mock() mock_read_gbq.return_value = DataFrame([[1.0]]) monkeypatch.setattr(pandas_gbq, 'read_gbq', mock_read_gbq) - with pytest.warns(FutureWarning): + with tm.assert_produces_warning(FutureWarning): pd.read_gbq("SELECT 1")