Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use global var for testing
  • Loading branch information
nnegrey committed Mar 6, 2020
commit 2edf3e9075468eeaaeab91e91ca24987485b02d0
7 changes: 4 additions & 3 deletions automl/beta/video_object_tracking_create_dataset_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import video_object_tracking_create_dataset

PROJECT_ID = os.environ["AUTOML_PROJECT_ID"]
pytest.DATASET_ID = None
DATASET_ID = None


@pytest.fixture(scope="function", autouse=True)
Expand All @@ -31,7 +31,7 @@ def teardown():
# Delete the created dataset
client = automl.AutoMlClient()
dataset_full_id = client.dataset_path(
PROJECT_ID, "us-central1", pytest.DATASET_ID
PROJECT_ID, "us-central1", DATASET_ID
)
response = client.delete_dataset(dataset_full_id)
response.result()
Expand All @@ -47,4 +47,5 @@ def test_video_classification_create_dataset(capsys):
assert "Dataset id: " in out

# Get the dataset id for deletion
pytest.DATASET_ID = out.splitlines()[1].split()[2]
global DATASET_ID
DATASET_ID = out.splitlines()[1].split()[2]
7 changes: 4 additions & 3 deletions automl/beta/video_object_tracking_create_model_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

PROJECT_ID = os.environ["GCLOUD_PROJECT"]
DATASET_ID = "VOT2823376535338090496"
pytest.OPERATION_ID = None
OPERATION_ID = None


@pytest.fixture(scope="function", autouse=True)
Expand All @@ -31,7 +31,7 @@ def teardown():

# Cancel the training operation
client = automl.AutoMlClient()
client.transport._operations_client.cancel_operation(pytest.OPERATION_ID)
client.transport._operations_client.cancel_operation(OPERATION_ID)


def test_video_classification_create_model(capsys):
Expand All @@ -43,6 +43,7 @@ def test_video_classification_create_model(capsys):
assert "Training started" in out

# Cancel the operation
pytest.OPERATION_ID = out.split("Training operation name: ")[1].split(
global OPERATION_ID
OPERATION_ID = out.split("Training operation name: ")[1].split(
"\n"
)[0]