Skip to content

Commit

Permalink
Modify test - *all* warnings should be pyarrow's
Browse files Browse the repository at this point in the history
  • Loading branch information
plamut committed Jul 19, 2019
1 parent 52624b2 commit a6c8a88
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions bigquery/tests/unit/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5353,11 +5353,10 @@ def test_load_table_from_dataframe_w_schema_wo_pyarrow(self):
dataframe, self.TABLE_REF, job_config=job_config, location=self.LOCATION
)

# there might be other warnings unrelated to the expected pyarrow warning,
# thus some filtering is necessary
pyarrow_warning = next((w for w in warned if "pyarrow" in str(w)), None)
assert pyarrow_warning is not None
assert pyarrow_warning.category is PendingDeprecationWarning
assert warned # there should be at least one warning
assert all("pyarrow" in str(w) for w in warned)
for warning in warned:
assert warning.category in (DeprecationWarning, PendingDeprecationWarning)

load_table_from_file.assert_called_once_with(
client,
Expand Down

0 comments on commit a6c8a88

Please sign in to comment.