1
1
# -*- coding: utf-8 -*-
2
2
3
3
import pytest
4
+ import warnings
4
5
5
6
import re
6
7
from datetime import datetime
@@ -174,7 +175,7 @@ def make_mixed_dataframe_v2(test_size):
174
175
175
176
def test_generate_bq_schema_deprecated ():
176
177
# 11121 Deprecation of generate_bq_schema
177
- with tm . assert_produces_warning (FutureWarning ):
178
+ with pytest . warns (FutureWarning ):
178
179
df = make_mixed_dataframe_v2 (10 )
179
180
gbq .generate_bq_schema (df )
180
181
@@ -1447,7 +1448,7 @@ def test_upload_data_with_invalid_user_schema_raises_error(self):
1447
1448
{'name' : 'C' , 'type' : 'FLOAT' },
1448
1449
{'name' : 'D' , 'type' : 'FLOAT' }]
1449
1450
destination_table = self .destination_table + test_id
1450
- with tm . assertRaises (gbq .GenericGBQException ):
1451
+ with pytest . raises (gbq .GenericGBQException ):
1451
1452
gbq .to_gbq (df , destination_table , _get_project_id (),
1452
1453
private_key = _get_private_key_path (),
1453
1454
table_schema = test_schema )
@@ -1459,7 +1460,7 @@ def test_upload_data_with_missing_schema_fields_raises_error(self):
1459
1460
{'name' : 'B' , 'type' : 'FLOAT' },
1460
1461
{'name' : 'C' , 'type' : 'FLOAT' }]
1461
1462
destination_table = self .destination_table + test_id
1462
- with tm . assertRaises (gbq .GenericGBQException ):
1463
+ with pytest . raises (gbq .GenericGBQException ):
1463
1464
gbq .to_gbq (df , destination_table , _get_project_id (),
1464
1465
private_key = _get_private_key_path (),
1465
1466
table_schema = test_schema )
0 commit comments