File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ class TestcontainersConfiguration:
106106    tc_properties : dict [str , str ] =  field (default_factory = read_tc_properties )
107107    _docker_auth_config : Optional [str ] =  field (default_factory = lambda : environ .get ("DOCKER_AUTH_CONFIG" ))
108108    tc_host_override : Optional [str ] =  TC_HOST_OVERRIDE 
109-     connection_mode_override : Optional [ConnectionMode ] =  None 
109+     connection_mode_override : Optional [ConnectionMode ] =  field ( default_factory = get_user_overwritten_connection_mode ) 
110110
111111    """ 
112112    https://github.com/testcontainers/testcontainers-go/blob/dd76d1e39c654433a3d80429690d07abcec04424/docker.go#L644 
Original file line number Diff line number Diff line change 33from  testcontainers .core .config  import  (
44    TestcontainersConfiguration  as  TCC ,
55    TC_FILE ,
6+     TestcontainersConfiguration ,
67    get_user_overwritten_connection_mode ,
78    ConnectionMode ,
89    get_docker_socket ,
@@ -81,6 +82,7 @@ def test_invalid_connection_mode(monkeypatch: pytest.MonkeyPatch) -> None:
8182def  test_valid_connection_mode (monkeypatch : pytest .MonkeyPatch , mode : str , use_mapped : bool ) ->  None :
8283    monkeypatch .setenv ("TESTCONTAINERS_CONNECTION_MODE" , mode )
8384    assert  get_user_overwritten_connection_mode ().use_mapped_port  is  use_mapped 
85+     assert  TestcontainersConfiguration ().connection_mode_override .use_mapped_port  is  use_mapped 
8486
8587
8688def  test_no_connection_mode_given (monkeypatch : pytest .MonkeyPatch ) ->  None :
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments