From 7b6aecc10ed355b7b81ceb7bbe56000ebc0dd778 Mon Sep 17 00:00:00 2001 From: Peter Lamut Date: Fri, 19 Jul 2019 23:23:28 +0200 Subject: [PATCH] Modify test - *all* warnings should be pyarrow's --- bigquery/tests/unit/test_client.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bigquery/tests/unit/test_client.py b/bigquery/tests/unit/test_client.py index 843406300b6e..2be40a52e1fc 100644 --- a/bigquery/tests/unit/test_client.py +++ b/bigquery/tests/unit/test_client.py @@ -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 + for warning in warned: + assert "pyarrow" in str(warning) + assert warning.category in (DeprecationWarning, PendingDeprecationWarning) load_table_from_file.assert_called_once_with( client,