Skip to content

Commit 4cfc00b

Browse files
author
Matti Remes
committed
fix tests by using pytest raise asserts
1 parent 6740634 commit 4cfc00b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas_gbq/tests/test_gbq.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def make_mixed_dataframe_v2(test_size):
174174

175175
def test_generate_bq_schema_deprecated():
176176
# 11121 Deprecation of generate_bq_schema
177-
with tm.assert_produces_warning(FutureWarning):
177+
with pytest.warns(FutureWarning):
178178
df = make_mixed_dataframe_v2(10)
179179
gbq.generate_bq_schema(df)
180180

@@ -1447,7 +1447,7 @@ def test_upload_data_with_invalid_user_schema_raises_error(self):
14471447
{'name': 'C', 'type': 'FLOAT'},
14481448
{'name': 'D', 'type': 'FLOAT'}]
14491449
destination_table = self.destination_table + test_id
1450-
with tm.assertRaises(gbq.GenericGBQException):
1450+
with pytest.raises(gbq.GenericGBQException):
14511451
gbq.to_gbq(df, destination_table, _get_project_id(),
14521452
private_key=_get_private_key_path(),
14531453
table_schema=test_schema)
@@ -1459,7 +1459,7 @@ def test_upload_data_with_missing_schema_fields_raises_error(self):
14591459
{'name': 'B', 'type': 'FLOAT'},
14601460
{'name': 'C', 'type': 'FLOAT'}]
14611461
destination_table = self.destination_table + test_id
1462-
with tm.assertRaises(gbq.GenericGBQException):
1462+
with pytest.raises(gbq.GenericGBQException):
14631463
gbq.to_gbq(df, destination_table, _get_project_id(),
14641464
private_key=_get_private_key_path(),
14651465
table_schema=test_schema)

0 commit comments

Comments
 (0)