Skip to content

Commit 7fff88d

Browse files
Jon Wayne Parrottshollyman
authored andcommitted
Remove cloud config fixture [(#887)](GoogleCloudPlatform/python-docs-samples#887)
* Remove cloud config fixture * Fix client secrets * Fix bigtable instance
1 parent 9d18d0f commit 7fff88d

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

samples/snippets/async_query_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from async_query import async_query
1616

1717

18-
def test_async_query(cloud_config, capsys):
18+
def test_async_query(capsys):
1919
query = (
2020
'SELECT corpus FROM `publicdata.samples.shakespeare` '
2121
'GROUP BY corpus;')

samples/snippets/export_data_to_gcs_test.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,20 @@
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License.
1313

14-
import export_data_to_gcs
14+
import os
1515

16+
import export_data_to_gcs
1617

18+
BUCKET = os.environ['CLOUD_STORAGE_BUCKET']
1719
DATASET_ID = 'test_dataset'
1820
TABLE_ID = 'test_table'
1921

2022

21-
def test_export_data_to_gcs(cloud_config, capsys):
23+
def test_export_data_to_gcs(capsys):
2224
export_data_to_gcs.export_data_to_gcs(
2325
DATASET_ID,
2426
TABLE_ID,
25-
'gs://{}/test-export-data-to-gcs.csv'.format(
26-
cloud_config.storage_bucket))
27+
'gs://{}/test-export-data-to-gcs.csv'.format(BUCKET))
2728

2829
out, _ = capsys.readouterr()
2930

samples/snippets/load_data_from_gcs_test.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License.
1313

14+
import os
15+
1416
import load_data_from_gcs
1517

18+
BUCKET = os.environ['CLOUD_STORAGE_BUCKET']
1619
DATASET_ID = 'test_dataset'
1720
TABLE_ID = 'test_import_table'
1821

1922

20-
def test_load_table(cloud_config, capsys):
21-
cloud_storage_input_uri = 'gs://{}/data.csv'.format(
22-
cloud_config.storage_bucket)
23+
def test_load_table(capsys):
24+
cloud_storage_input_uri = 'gs://{}/data.csv'.format(BUCKET)
2325

2426
load_data_from_gcs.load_data_from_gcs(
2527
DATASET_ID,

samples/snippets/sync_query_params_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
import sync_query_params
1616

1717

18-
def test_sync_query_named_params(cloud_config, capsys):
18+
def test_sync_query_named_params(capsys):
1919
sync_query_params.sync_query_named_params(
2020
corpus='romeoandjuliet',
2121
min_word_count=100)
2222
out, _ = capsys.readouterr()
2323
assert 'love' in out
2424

2525

26-
def test_sync_query_positional_params(cloud_config, capsys):
26+
def test_sync_query_positional_params(capsys):
2727
sync_query_params.sync_query_positional_params(
2828
corpus='romeoandjuliet',
2929
min_word_count=100)

samples/snippets/sync_query_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from sync_query import sync_query
1616

1717

18-
def test_sync_query(cloud_config, capsys):
18+
def test_sync_query(capsys):
1919
query = (
2020
'SELECT corpus FROM `publicdata.samples.shakespeare` '
2121
'GROUP BY corpus;')

0 commit comments

Comments
 (0)