Skip to content

Commit 3582b12

Browse files
author
Takashi Matsuo
authored
[logging] chore: remove gcp-devrel-py-tools (#3477)
1 parent c36b631 commit 3582b12

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

logging/cloud-client/export_test.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@
1616
import random
1717
import string
1818

19-
from gcp_devrel.testing import eventually_consistent
19+
import backoff
2020
from google.cloud import logging
2121
import pytest
2222

2323
import export
2424

25+
2526
BUCKET = os.environ['CLOUD_STORAGE_BUCKET']
2627
TEST_SINK_NAME_TMPL = 'example_sink_{}'
2728
TEST_SINK_FILTER = 'severity>=CRITICAL'
@@ -53,12 +54,14 @@ def example_sink():
5354

5455

5556
def test_list(example_sink, capsys):
56-
@eventually_consistent.call
57-
def _():
57+
@backoff.on_exception(backoff.expo, AssertionError, max_time=60)
58+
def eventually_consistent_test():
5859
export.list_sinks()
5960
out, _ = capsys.readouterr()
6061
assert example_sink.name in out
6162

63+
eventually_consistent_test()
64+
6265

6366
def test_create(capsys):
6467
sink_name = TEST_SINK_NAME_TMPL.format(_random_id())
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1+
backoff==1.10.0
12
pytest==5.3.2
2-
gcp-devrel-py-tools==0.0.15

logging/cloud-client/snippets_test.py

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

15-
from gcp_devrel.testing import eventually_consistent
15+
import backoff
1616
from google.cloud import logging
1717
import pytest
1818

1919
import snippets
2020

21+
2122
TEST_LOGGER_NAME = 'example_log'
2223

2324

@@ -31,18 +32,20 @@ def example_log():
3132

3233

3334
def test_list(example_log, capsys):
34-
@eventually_consistent.call
35-
def _():
35+
@backoff.on_exception(backoff.expo, AssertionError, max_time=120)
36+
def eventually_consistent_test():
3637
snippets.list_entries(TEST_LOGGER_NAME)
3738
out, _ = capsys.readouterr()
3839
assert example_log in out
3940

41+
eventually_consistent_test()
42+
4043

4144
def test_write():
4245
snippets.write_entry(TEST_LOGGER_NAME)
4346

4447

45-
def test_delete(example_log):
46-
@eventually_consistent.call
47-
def _():
48-
snippets.delete_logger(TEST_LOGGER_NAME)
48+
def test_delete(example_log, capsys):
49+
snippets.delete_logger(TEST_LOGGER_NAME)
50+
out, _ = capsys.readouterr()
51+
assert TEST_LOGGER_NAME in out

0 commit comments

Comments
 (0)