Skip to content

Commit b64d944

Browse files
author
Takashi Matsuo
authored
fix(translate): fix a broken test [(#4360)](GoogleCloudPlatform/python-docs-samples#4360)
* fix(translate): fix a broken test fixes #4353 * use uuid * fix builds
1 parent 688a580 commit b64d944

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

samples/samples/snippets/dataset_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
import datetime
1817
import os
18+
import uuid
1919

2020
import pytest
2121

@@ -28,7 +28,7 @@
2828
@pytest.mark.slow
2929
def test_dataset_create_import_delete(capsys):
3030
# create dataset
31-
dataset_name = "test_" + datetime.datetime.now().strftime("%Y%m%d%H%M%S")
31+
dataset_name = f"test_{uuid.uuid4().hex[:27]}"
3232
automl_translation_dataset.create_dataset(
3333
project_id, compute_region, dataset_name, "en", "ja"
3434
)

samples/samples/snippets/model_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@ def test_model_list_get_evaluate(capsys):
7777
project_id, compute_region, model_id, model_evaluation_id
7878
)
7979
out, _ = capsys.readouterr()
80-
assert "evaluation_metric" in out
80+
assert model_evaluation_id in out

0 commit comments

Comments
 (0)