Testcontainers is a Python library that providing a friendly API to run Docker container. It is designed to create runtime environment to use during your automatic tests.
Improves type hints for type checking in a common use cases:
with MySqlContainer("mysql:8").with_env("some", "value") as mysql:
url = mysql.get_connection_url() # get_connection_url would previously be an unknown member here
And, also improved type hinting for the custom DockerClient's run command, where the linter no longer reports an error due to missing parameter types:
DockerClient.run("nginx") # Previously this would report "Argument missing for parameter "image"
Improves type hints for type checking in a common use cases:
And, also improved type hinting for the custom
DockerClient
'srun
command, where the linter no longer reports an error due to missing parameter types: