diff --git a/tests/functional/adapter/test_external.py b/tests/functional/adapter/test_external.py index 65230767..b8643cc1 100644 --- a/tests/functional/adapter/test_external.py +++ b/tests/functional/adapter/test_external.py @@ -80,16 +80,18 @@ def extroot(self, tmp_path_factory, dest): extroot = str(tmp_path_factory.getbasetemp() / "external") if not os.path.exists(extroot): os.mkdir(extroot) + return extroot + elif dest == DEST_S3: extroot = os.path.join("dbt-duckdb", "test_external", f"pytest-{uuid4()}") - yield os.path.join("s3://", BUCKET_NAME, extroot) - session = boto3.Session( - aws_access_key_id=os.getenv("S3_MD_ORG_KEY"), - aws_secret_access_key=os.getenv("S3_MD_ORG_SECRET"), - ) - s3 = session.resource('s3') - bucket = s3.Bucket('md-ecosystem-public') - bucket.objects.filter(Prefix=extroot).delete() + yield os.path.join("s3://", BUCKET_NAME, extroot) + session = boto3.Session( + aws_access_key_id=os.getenv("S3_MD_ORG_KEY"), + aws_secret_access_key=os.getenv("S3_MD_ORG_SECRET"), + ) + s3 = session.resource('s3') + bucket = s3.Bucket('md-ecosystem-public') + bucket.objects.filter(Prefix=extroot).delete() @pytest.fixture(scope="class") def dbt_profile_target(self, profile_type, dbt_profile_target, extroot):