From e7d0d3c012675fa98f1a71fb29f010e5945efc65 Mon Sep 17 00:00:00 2001 From: kevingrismore <146098880+kevingrismore@users.noreply.github.com> Date: Fri, 19 Jan 2024 14:18:57 -0600 Subject: [PATCH] Update tests/deployments/test_steps.py Co-authored-by: Chris Guidry --- tests/deployments/test_steps.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/deployments/test_steps.py b/tests/deployments/test_steps.py index 6ed68815..15c4fc25 100644 --- a/tests/deployments/test_steps.py +++ b/tests/deployments/test_steps.py @@ -10,7 +10,15 @@ from prefect_aws import AwsCredentials from prefect_aws.deployments.steps import get_s3_client, pull_from_s3, push_to_s3 -os.environ["MOTO_S3_CUSTOM_ENDPOINTS"] = "http://custom.minio.endpoint:9000" + +@pytest.fixture(scope="module", autouse=True) +def set_custom_endpoint(): + original = os.environ.get("MOTO_S3_CUSTOM_ENDPOINTS") + os.environ["MOTO_S3_CUSTOM_ENDPOINTS"] = "http://custom.minio.endpoint:9000" + yield + os.environ.pop("MOTO_S3_CUSTOM_ENDPOINTS") + if original is not None: + os.environ["MOTO_S3_CUSTOM_ENDPOINTS"] = original @pytest.fixture