@@ -127,27 +127,42 @@ def docker_run(
127
127
"""
128
128
A convenient context manager for safely setting up and tearing down Docker environments.
129
129
130
- - **compose_file** (_str_) - A path to a Docker compose file. A custom tear
131
- down is not required when using this.
132
- - **build** (_bool_) - Whether or not to build images for when `compose_file` is provided
133
- - **service_name** (_str_) - Optional name for when ``compose_file`` is provided
134
- - **up** (_callable_) - A custom setup callable
135
- - **down** (_callable_) - A custom tear down callable. This is required when using a custom setup.
136
- - **on_error** (_callable_) - A callable called in case of an unhandled exception
137
- - **sleep** (_float_) - Number of seconds to wait before yielding. This occurs after all conditions are successful.
138
- - **endpoints** (_List[str]_) - Endpoints to verify access for before yielding. Shorthand for adding
139
- `CheckEndpoints(endpoints)` to the `conditions` argument.
140
- - **log_patterns** (_List[str|re.Pattern]_) - Regular expression patterns to find in Docker logs before yielding.
141
- This is only available when `compose_file` is provided. Shorthand for adding
142
- `CheckDockerLogs(compose_file, log_patterns, 'all')` to the `conditions` argument.
143
- - **mount_logs** (_bool_) - Whether or not to mount log files in Agent containers based on example logs
144
- configuration
145
- - **conditions** (_callable_) - A list of callable objects that will be executed before yielding to
146
- check for errors
147
- - **env_vars** (_dict_) - A dictionary to update `os.environ` with during execution
148
- - **wrappers** (_List[callable]_) - A list of context managers to use during execution
149
- - **attempts** (_int_) - Number of attempts to run `up` and the `conditions` successfully. Defaults to 2 in CI
150
- - **attempts_wait** (_int_) - Time to wait between attempts
130
+ Parameters:
131
+
132
+ compose_file (str):
133
+ A path to a Docker compose file. A custom tear
134
+ down is not required when using this.
135
+ build (bool):
136
+ Whether or not to build images for when `compose_file` is provided
137
+ service_name (str):
138
+ Optional name for when ``compose_file`` is provided
139
+ up (callable):
140
+ A custom setup callable
141
+ down (callable):
142
+ A custom tear down callable. This is required when using a custom setup.
143
+ on_error (callable):
144
+ A callable called in case of an unhandled exception
145
+ sleep (float):
146
+ Number of seconds to wait before yielding. This occurs after all conditions are successful.
147
+ endpoints (list[str]):
148
+ Endpoints to verify access for before yielding. Shorthand for adding
149
+ `CheckEndpoints(endpoints)` to the `conditions` argument.
150
+ log_patterns (list[str | re.Pattern]):
151
+ Regular expression patterns to find in Docker logs before yielding.
152
+ This is only available when `compose_file` is provided. Shorthand for adding
153
+ `CheckDockerLogs(compose_file, log_patterns, 'all')` to the `conditions` argument.
154
+ mount_logs (bool):
155
+ Whether or not to mount log files in Agent containers based on example logs configuration
156
+ conditions (callable):
157
+ A list of callable objects that will be executed before yielding to check for errors
158
+ env_vars (dict[str, str]):
159
+ A dictionary to update `os.environ` with during execution
160
+ wrappers (list[callable]):
161
+ A list of context managers to use during execution
162
+ attempts (int):
163
+ Number of attempts to run `up` and the `conditions` successfully. Defaults to 2 in CI
164
+ attempts_wait (int):
165
+ Time to wait between attempts
151
166
"""
152
167
if compose_file and up :
153
168
raise TypeError ('You must select either a compose file or a custom setup callable, not both.' )
0 commit comments