1111# See the License for the specific language governing permissions and
1212# limitations under the License.
1313
14+ import os
15+
1416from gcp .testing .flaky import flaky
1517
1618from export_data_to_cloud_storage import main
1719
20+ PROJECT = os .environ ['GCLOUD_PROJECT' ]
21+ BUCKET = os .environ ['CLOUD_STORAGE_BUCKET' ]
1822DATASET_ID = 'test_dataset'
1923TABLE_ID = 'test_table'
2024
2125
2226@flaky
23- def test_export_table_csv (cloud_config ):
24- cloud_storage_output_uri = \
25- 'gs://{}/output.csv' .format (cloud_config .storage_bucket )
27+ def test_export_table_csv ():
28+ cloud_storage_output_uri = 'gs://{}/output.csv' .format (BUCKET )
2629 main (
2730 cloud_storage_output_uri ,
28- cloud_config . project ,
31+ PROJECT ,
2932 DATASET_ID ,
3033 TABLE_ID ,
3134 num_retries = 5 ,
@@ -34,12 +37,11 @@ def test_export_table_csv(cloud_config):
3437
3538
3639@flaky
37- def test_export_table_json (cloud_config ):
38- cloud_storage_output_uri = \
39- 'gs://{}/output.json' .format (cloud_config .storage_bucket )
40+ def test_export_table_json ():
41+ cloud_storage_output_uri = 'gs://{}/output.json' .format (BUCKET )
4042 main (
4143 cloud_storage_output_uri ,
42- cloud_config . project ,
44+ PROJECT ,
4345 DATASET_ID ,
4446 TABLE_ID ,
4547 num_retries = 5 ,
@@ -48,12 +50,11 @@ def test_export_table_json(cloud_config):
4850
4951
5052@flaky
51- def test_export_table_avro (cloud_config ):
52- cloud_storage_output_uri = \
53- 'gs://{}/output.avro' .format (cloud_config .storage_bucket )
53+ def test_export_table_avro ():
54+ cloud_storage_output_uri = 'gs://{}/output.avro' .format (BUCKET )
5455 main (
5556 cloud_storage_output_uri ,
56- cloud_config . project ,
57+ PROJECT ,
5758 DATASET_ID ,
5859 TABLE_ID ,
5960 num_retries = 5 ,
0 commit comments