Skip to content

Commit

Permalink
[TST] Use tm.assert_produces_warning not pytest.warns
Browse files Browse the repository at this point in the history
* Add comment linking to pandas-gbq issue for change in default
  dialect.
  • Loading branch information
tswast committed Sep 11, 2018
1 parent 4029d97 commit 0de8d22
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pandas/tests/io/test_gbq.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down Expand Up @@ -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")


Expand Down

0 comments on commit 0de8d22

Please sign in to comment.