You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.rst
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,9 +120,13 @@ Fetching passwords from cloud providers:
120
120
Reusable Containers (Experimental)
121
121
----------------------------------
122
122
123
-
Containers can be reused across consecutive test runs. To reuse a container, the container configuration must be the same.
123
+
.. warning::
124
+
Reusable Containers is still an experimental feature and the behavior can change.
125
+
Those containers won't stop after all tests are finished.
124
126
125
-
Containers that are set up for reuse will not be automatically removed. Thus, those containers need to be removed manually.
127
+
Containers can be reused across consecutive test runs. To reuse a container, the container has to be started manually by calling the `start()` method. Do not call the `stop()` method directly or indirectly via a `with` statement (context manager). To reuse a container, the container configuration must be the same.
128
+
129
+
Containers that are set up for reuse will not be automatically removed. Thus, if they are not needed anymore, those containers must be removed manually.
126
130
127
131
Containers should not be reused in a CI environment.
128
132
@@ -131,16 +135,16 @@ How to use?
131
135
132
136
1. Add :code:`testcontainers.reuse.enable=true` to :code:`~/.testcontainers.properties`
133
137
2. Disable ryuk by setting the environment variable :code:`TESTCONTAINERS_RYUK_DISABLED=true`
134
-
3. Instantiate a container using :code:`with_reuse`
138
+
3. Instantiate a container using :code:`with_reuse()` and :code:`start()`
135
139
136
140
.. doctest::
137
141
138
142
>>> from testcontainers.core.container import DockerContainer
0 commit comments