Skip to content

Commit bc353ba

Browse files

31 files changed

+88
-3
lines changed

speech/snippets/adaptation_v2_custom_class_reference_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import re
1717
from uuid import uuid4
1818

19+
from google.api_core.retry import Retry
1920
from google.cloud.speech_v2 import SpeechClient
2021
from google.cloud.speech_v2.types import cloud_speech
2122

@@ -42,6 +43,7 @@ def delete_custom_class(name):
4243
client.delete_custom_class(request=request)
4344

4445

46+
@Retry()
4547
def test_adaptation_v2_custom_class_reference(capsys):
4648
project_id = os.getenv("GOOGLE_CLOUD_PROJECT")
4749

speech/snippets/adaptation_v2_inline_custom_class_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import re
1717
from uuid import uuid4
1818

19+
from google.api_core.retry import Retry
1920
from google.cloud.speech_v2 import SpeechClient
2021
from google.cloud.speech_v2.types import cloud_speech
2122

@@ -30,6 +31,7 @@ def delete_recognizer(name):
3031
client.delete_recognizer(request=request)
3132

3233

34+
@Retry()
3335
def test_adaptation_v2_inline_custom_class(capsys):
3436
project_id = os.getenv("GOOGLE_CLOUD_PROJECT")
3537

speech/snippets/adaptation_v2_inline_phrase_set_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import re
1717
from uuid import uuid4
1818

19+
from google.api_core.retry import Retry
1920
from google.cloud.speech_v2 import SpeechClient
2021
from google.cloud.speech_v2.types import cloud_speech
2122

@@ -30,6 +31,7 @@ def delete_recognizer(name):
3031
client.delete_recognizer(request=request)
3132

3233

34+
@Retry()
3335
def test_adaptation_v2_inline_phrase_set(capsys):
3436
project_id = os.getenv("GOOGLE_CLOUD_PROJECT")
3537

speech/snippets/adaptation_v2_phrase_set_reference_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import re
1717
from uuid import uuid4
1818

19+
from google.api_core.retry import Retry
1920
from google.cloud.speech_v2 import SpeechClient
2021
from google.cloud.speech_v2.types import cloud_speech
2122

@@ -36,6 +37,7 @@ def delete_phrase_set(name):
3637
client.delete_phrase_set(request=request)
3738

3839

40+
@Retry()
3941
def test_adaptation_v2_phrase_set_reference(capsys):
4042
project_id = os.getenv("GOOGLE_CLOUD_PROJECT")
4143

speech/snippets/beta_snippets_test.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
import os
1616

17+
from google.api_core.retry import Retry
18+
1719
from beta_snippets import (
1820
transcribe_file_with_auto_punctuation,
1921
transcribe_file_with_diarization,
@@ -28,27 +30,31 @@
2830
RESOURCES = os.path.join(os.path.dirname(__file__), "resources")
2931

3032

33+
@Retry()
3134
def test_transcribe_file_with_enhanced_model(capsys):
3235
transcribe_file_with_enhanced_model()
3336
out, _ = capsys.readouterr()
3437

3538
assert "Chrome" in out
3639

3740

41+
@Retry()
3842
def test_transcribe_file_with_metadata(capsys):
3943
transcribe_file_with_metadata()
4044
out, _ = capsys.readouterr()
4145

4246
assert "Chrome" in out
4347

4448

49+
@Retry()
4550
def test_transcribe_file_with_auto_punctuation(capsys):
4651
transcribe_file_with_auto_punctuation()
4752
out, _ = capsys.readouterr()
4853

4954
assert "First alternative of result " in out
5055

5156

57+
@Retry()
5258
def test_transcribe_diarization(capsys):
5359
transcribe_file_with_diarization()
5460
out, err = capsys.readouterr()
@@ -57,13 +63,15 @@ def test_transcribe_diarization(capsys):
5763
assert "speaker_tag:" in out
5864

5965

66+
@Retry()
6067
def test_transcribe_multichannel_file(capsys):
6168
transcribe_file_with_multichannel()
6269
out, err = capsys.readouterr()
6370

6471
assert "OK Google stream stranger things from Netflix to my TV" in out
6572

6673

74+
@Retry()
6775
def test_transcribe_multilanguage_file(capsys):
6876
transcribe_file_with_multilanguage()
6977
out, err = capsys.readouterr()
@@ -72,13 +80,15 @@ def test_transcribe_multilanguage_file(capsys):
7280
assert "Transcript" in out
7381

7482

83+
@Retry()
7584
def test_transcribe_word_level_confidence(capsys):
7685
transcribe_file_with_word_level_confidence()
7786
out, err = capsys.readouterr()
7887

7988
assert "OK Google stream stranger things from Netflix to my TV" in out
8089

8190

91+
@Retry()
8292
def test_transcribe_file_with_spoken_punctuation_end_emojis(capsys):
8393
transcribe_file_with_spoken_punctuation_end_emojis()
8494
out, err = capsys.readouterr()

speech/snippets/create_recognizer_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import os
1616
from uuid import uuid4
1717

18+
from google.api_core.retry import Retry
1819
from google.cloud.speech_v2 import SpeechClient
1920
from google.cloud.speech_v2.types import cloud_speech
2021

@@ -27,6 +28,7 @@ def delete_recognizer(name):
2728
client.delete_recognizer(request=request)
2829

2930

31+
@Retry()
3032
def test_create_recognizer(capsys):
3133
project_id = os.getenv("GOOGLE_CLOUD_PROJECT")
3234

speech/snippets/multi_region_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@
1313
# limitations under the License.
1414

1515

16+
from google.api_core.retry import Retry
17+
1618
import multi_region
1719

1820

21+
@Retry()
1922
def test_multi_region(capsys):
2023
multi_region.sync_recognize_with_multi_region_gcs()
2124
out, _ = capsys.readouterr()

speech/snippets/profanity_filter_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@
1414

1515
import re
1616

17+
from google.api_core.retry import Retry
18+
1719
import profanity_filter
1820

1921

22+
@Retry()
2023
def test_profanity_filter(capsys):
2124
profanity_filter.sync_recognize_with_profanity_filter_gcs(
2225
"gs://cloud-samples-tests/speech/brooklyn.flac"

speech/snippets/quickstart_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@
1313
# limitations under the License.
1414

1515

16+
from google.api_core.retry import Retry
17+
1618
import quickstart
1719

1820

21+
@Retry()
1922
def test_quickstart(capsys):
2023
quickstart.run_quickstart()
2124
out, _ = capsys.readouterr()

speech/snippets/quickstart_v2_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import re
1717
from uuid import uuid4
1818

19+
from google.api_core.retry import Retry
1920
from google.cloud.speech_v2 import SpeechClient
2021
from google.cloud.speech_v2.types import cloud_speech
2122

@@ -30,6 +31,7 @@ def delete_recognizer(name):
3031
client.delete_recognizer(request=request)
3132

3233

34+
@Retry()
3335
def test_quickstart_v2(capsys):
3436
project_id = os.getenv("GOOGLE_CLOUD_PROJECT")
3537

0 commit comments

Comments
 (0)