Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------

"""Shared fixtures for deployment template E2E tests."""

from typing import Callable
import pytest
from azure.ai.ml import MLClient
from azure.ai.ml.entities import Environment


@pytest.fixture(scope="session")
def test_environment(registry_client: MLClient) -> str:
Comment on lines +10 to +14
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import 'Environment' is unused and should be removed. It appears to be left over from development but is not used anywhere in this file.

Suggested change
from azure.ai.ml.entities import Environment
@pytest.fixture(scope="session")
def test_environment(registry_client: MLClient) -> str:
@pytest.fixture(scope="session")
def test_environment(registry_client: MLClient) -> str:
def test_environment(registry_client: MLClient) -> str:

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fixture accepts a 'registry_client' parameter but doesn't use it. Since the function just returns a hardcoded string, this parameter should be removed.

Suggested change
def test_environment(registry_client: MLClient) -> str:
def test_environment() -> str:

Copilot uses AI. Check for mistakes.
"""Create or get a test environment in the registry for deployment templates.

Returns:
The environment ID string to use in deployment templates.
"""
# Use a simple environment ID that references a basic docker image
# This doesn't require the environment to exist in the registry
return "azureml://registries/testFeed/environments/test-sklearn-env/versions/1"


@pytest.fixture
def deployment_template_name(randstr: Callable[[str], str]) -> str:
"""Generate a unique deployment template name for testing."""
return randstr("dt-e2e-")


@pytest.fixture
def basic_deployment_template_yaml() -> str:
"""Path to basic deployment template YAML."""
return "./tests/test_configs/deployment_template/basic_deployment_template.yaml"


@pytest.fixture
def minimal_deployment_template_yaml() -> str:
"""Path to minimal deployment template YAML."""
return "./tests/test_configs/deployment_template/minimal_deployment_template.yaml"
Loading
Loading