File tree 2 files changed +3
-1
lines changed
2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ class TestcontainersConfiguration:
106
106
tc_properties : dict [str , str ] = field (default_factory = read_tc_properties )
107
107
_docker_auth_config : Optional [str ] = field (default_factory = lambda : environ .get ("DOCKER_AUTH_CONFIG" ))
108
108
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 )
110
110
111
111
"""
112
112
https://github.com/testcontainers/testcontainers-go/blob/dd76d1e39c654433a3d80429690d07abcec04424/docker.go#L644
Original file line number Diff line number Diff line change 3
3
from testcontainers .core .config import (
4
4
TestcontainersConfiguration as TCC ,
5
5
TC_FILE ,
6
+ TestcontainersConfiguration ,
6
7
get_user_overwritten_connection_mode ,
7
8
ConnectionMode ,
8
9
get_docker_socket ,
@@ -81,6 +82,7 @@ def test_invalid_connection_mode(monkeypatch: pytest.MonkeyPatch) -> None:
81
82
def test_valid_connection_mode (monkeypatch : pytest .MonkeyPatch , mode : str , use_mapped : bool ) -> None :
82
83
monkeypatch .setenv ("TESTCONTAINERS_CONNECTION_MODE" , mode )
83
84
assert get_user_overwritten_connection_mode ().use_mapped_port is use_mapped
85
+ assert TestcontainersConfiguration ().connection_mode_override .use_mapped_port is use_mapped
84
86
85
87
86
88
def test_no_connection_mode_given (monkeypatch : pytest .MonkeyPatch ) -> None :
You can’t perform that action at this time.
0 commit comments