Skip to content

Commit ec152a2

Browse files
Jon Wayne Parrottbusunkim96
Jon Wayne Parrott
authored andcommitted
Remove cloud config fixture [(#887)](GoogleCloudPlatform/python-docs-samples#887)
* Remove cloud config fixture * Fix client secrets * Fix bigtable instance
1 parent d270cbf commit ec152a2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

samples/snippets/export_test.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import os
1516
import random
1617
import string
1718

@@ -21,6 +22,7 @@
2122

2223
import export
2324

25+
BUCKET = os.environ['CLOUD_STORAGE_BUCKET']
2426
TEST_SINK_NAME_TMPL = 'example_sink_{}'
2527
TEST_SINK_FILTER = 'severity>=CRITICAL'
2628

@@ -32,14 +34,13 @@ def _random_id():
3234

3335

3436
@pytest.yield_fixture
35-
def example_sink(cloud_config):
37+
def example_sink():
3638
client = logging.Client()
3739

3840
sink = client.sink(
3941
TEST_SINK_NAME_TMPL.format(_random_id()),
4042
TEST_SINK_FILTER,
41-
'storage.googleapis.com/{bucket}'.format(
42-
bucket=cloud_config.storage_bucket))
43+
'storage.googleapis.com/{bucket}'.format(bucket=BUCKET))
4344

4445
sink.create()
4546

@@ -59,13 +60,13 @@ def _():
5960
assert example_sink.name in out
6061

6162

62-
def test_create(cloud_config, capsys):
63+
def test_create(capsys):
6364
sink_name = TEST_SINK_NAME_TMPL.format(_random_id())
6465

6566
try:
6667
export.create_sink(
6768
sink_name,
68-
cloud_config.storage_bucket,
69+
BUCKET,
6970
TEST_SINK_FILTER)
7071
# Clean-up the temporary sink.
7172
finally:

0 commit comments

Comments
 (0)