@@ -111,11 +111,12 @@ def test_container_environment_variables(self):
111
111
)
112
112
self .containers .append (container )
113
113
114
- self . assertEqual (
115
- container .attrs .get ('Config' , {}).get ('Env' , []),
116
- [ f" { k } = { v } " for k , v in env_dict .items ()],
117
- )
114
+ # Verify that the user-provided environment variables are in the container's configuration
115
+ container_env = container .attrs .get ('Config' , {}).get ('Env' , [])
116
+ for key , value in env_dict .items ():
117
+ self . assertIn ( f" { key } = { value } " , container_env )
118
118
119
+ # Start the container and verify the environment variables are set
119
120
container .start ()
120
121
container .wait ()
121
122
logs = b"\n " .join (container .logs ()).decode ()
@@ -130,11 +131,12 @@ def test_container_environment_variables(self):
130
131
)
131
132
self .containers .append (container )
132
133
133
- self . assertEqual (
134
- container .attrs .get ('Config' , {}).get ('Env' , []),
135
- env_list ,
136
- )
134
+ # Verify that the user-provided environment variables are in the container's configuration
135
+ container_env = container .attrs .get ('Config' , {}).get ('Env' , [])
136
+ for env in env_list :
137
+ self . assertIn ( env , container_env )
137
138
139
+ # Start the container and verify the environment variables are set
138
140
container .start ()
139
141
container .wait ()
140
142
logs = b"\n " .join (container .logs ()).decode ()
0 commit comments