Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Internal] Fix ci test test_invoke_sync_function_in_process_set_env #3008

Merged
merged 1 commit into from
Apr 25, 2024
Merged
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
Expand Up @@ -34,6 +34,10 @@ def target_function(request: int):
return request


def target_function_get_env(environment_variable: str):
return os.getenv(environment_variable)


@pytest.mark.unittest
class TestProcessUtils:
@pytest.mark.asyncio
Expand Down Expand Up @@ -77,16 +81,13 @@ async def test_invoke_sync_function_in_process_unexpected_error(self):

@pytest.mark.asyncio
async def test_invoke_sync_function_in_process_set_env(self):
def target_function_get_env(environment_variable: str):
return os.getenv(environment_variable)

with patch("promptflow.executor._service.utils.process_utils.service_logger") as mock_logger:
environment_variables = {"test_env_name": "test_env_value"}
result = await invoke_sync_function_in_process(
target_function_get_env,
args=("test_env_name",),
context_dict=MOCK_CONTEXT_DICT,
environment_variables=environment_variables
environment_variables=environment_variables,
)
assert result == "test_env_value"
assert mock_logger.info.call_count == 2
Expand Down
Loading