Skip to content

Commit 290b5f6

Browse files
committed
shorten content
1 parent 5c1e1d0 commit 290b5f6

File tree

1 file changed

+16
-25
lines changed

1 file changed

+16
-25
lines changed

docs/quickstart.md

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
_Testcontainers for Python_ plays well with Python's testing frameworks like pytest.
1+
_Testcontainers for Python_ integrates seamlessly with Python testing frameworks like [pytest](https://docs.pytest.org/en/stable/).
22

3-
The ideal use case is for integration or end to end tests. It helps you to spin
4-
up and manage the dependencies life cycle via Docker.
3+
It's ideal for integration and end-to-end tests, allowing you to easily manage dependencies using Docker.
54

65
## 1. System requirements
76

8-
Please read the [system requirements](system_requirements/index.md) page before you start.
7+
Before you begin, review the [system requirements](system_requirements/index.md).
98

109
## 2. Install _Testcontainers for Python_
1110

12-
You can install testcontainers-python using pip:
11+
Install testcontainers-python with pip:
1312

1413
```bash
1514
pip install testcontainers
@@ -37,33 +36,25 @@ def test_with_redis():
3736
assert value == "Hello, Redis!"
3837
```
3938

40-
The `RedisContainer` class provides a convenient way to start a Redis container for testing.
39+
The `RedisContainer` class makes it easy to start a Redis container for testing:
4140

42-
- The container is automatically started when entering the context manager (`with` statement)
43-
- The container is automatically stopped and removed when exiting the context manager
44-
- `get_container_host_ip()` returns the host IP where the container is running
45-
- `get_exposed_port()` returns the mapped port on the host
41+
- The container starts automatically when entering the context manager (`with` statement).
42+
- It stops and removes itself when exiting the context.
43+
- `get_container_host_ip()` returns the host IP.
44+
- `get_exposed_port()` returns the mapped host port.
4645

47-
When you use `get_exposed_port()`, you have to imagine yourself using `docker run -p
48-
<port>`. When you do so, `dockerd` maps the selected `<port>` from inside the
49-
container to a random one available on your host.
46+
When using `get_exposed_port()`, think of it as running `docker run -p <port>`. `dockerd` maps the container's internal port to a random available port on your host.
5047

51-
In the previous example, we expose the default Redis port (6379) for `tcp` traffic to the outside. This
52-
allows Redis to be reachable from your code that runs outside the container, but
53-
it also makes parallelization possible because if you run your tests in parallel, each test will get its own Redis container exposed on a different random port.
48+
In the example above, the default Redis port (6379) is exposed for TCP traffic. This setup allows your code to connect to Redis outside the container and supports parallel test execution. Each test gets its own Redis container on a unique, random port.
5449

55-
The container is automatically cleaned up when the test finishes, thanks to the context manager (`with` statement). This ensures that no containers are left running after your tests complete.
50+
The context manager (`with` statement) ensures containers are cleaned up after tests, so no containers are left running.
5651

5752
!!!tip
53+
See [the garbage collector](features/garbage_collector.md) for another way to clean up resources.
5854

59-
Look at [the garbage collector](features/garbage_collector.md) to know another way to
60-
clean up resources.
55+
## 4. Connect your code to the container
6156

62-
## 4. Make your code to talk with the container
63-
64-
This is just an example, but usually Python applications that rely on Redis are
65-
using the [redis-py](https://github.com/redis/redis-py) client. This code gets
66-
the endpoint from the container we just started, and it configures the client.
57+
Typically, Python applications use the [redis-py](https://github.com/redis/redis-py) client. The following code retrieves the endpoint from the container and configures the client.
6758

6859
```python
6960
def test_redis_operations():
@@ -97,4 +88,4 @@ pytest test_redis.py
9788

9889
## 6. Want to go deeper with Redis?
9990

100-
You can find a more elaborated Redis example in our examples section. Please check it out [here](./modules/redis.md).
91+
You can find a more elaborated Redis example in our [examples section](./modules/redis.md).

0 commit comments

Comments
 (0)