@@ -298,6 +298,14 @@ def enable_filepath_feature(monkeypatch):
298298@pytest .fixture (scope = "session" )
299299def db_creds_test (mysql_container ) -> Dict :
300300 _ , host , port = mysql_container
301+ # Set environment variables for DataJoint at module level
302+ os .environ ["DJ_TEST_HOST" ] = host
303+ os .environ ["DJ_TEST_PORT" ] = str (port )
304+
305+ # Also update DataJoint's test configuration directly
306+ dj .config ["database.test.host" ] = host
307+ dj .config ["database.test.port" ] = port
308+
301309 return dict (
302310 host = f"{ host } :{ port } " ,
303311 user = os .getenv ("DJ_TEST_USER" , "datajoint" ),
@@ -308,6 +316,14 @@ def db_creds_test(mysql_container) -> Dict:
308316@pytest .fixture (scope = "session" )
309317def db_creds_root (mysql_container ) -> Dict :
310318 _ , host , port = mysql_container
319+ # Set environment variables for DataJoint at module level
320+ os .environ ["DJ_HOST" ] = host
321+ os .environ ["DJ_PORT" ] = str (port )
322+
323+ # Also update DataJoint's configuration directly
324+ dj .config ["database.host" ] = host
325+ dj .config ["database.port" ] = port
326+
311327 return dict (
312328 host = f"{ host } :{ port } " ,
313329 user = os .getenv ("DJ_USER" , "root" ),
@@ -434,6 +450,8 @@ def connection_test(connection_root, prefix, db_creds_test):
434450@pytest .fixture (scope = "session" )
435451def s3_creds (minio_container ) -> Dict :
436452 _ , host , port = minio_container
453+ # Set environment variable for S3 endpoint at module level
454+ os .environ ["S3_ENDPOINT" ] = f"{ host } :{ port } "
437455 return dict (
438456 endpoint = f"{ host } :{ port } " ,
439457 access_key = os .environ .get ("S3_ACCESS_KEY" , "datajoint" ),
0 commit comments