Testcontainers を使うと,テストコードを実行するときに必要になるデータベース・キャッシュ・キューなどの依存関係をコード上で管理できて,実行後にはコンテナを自動的に消してくれるという使い捨て可能な仕組みを簡単に作れる❗️Testcontainers のサイトに載っている「Test dependencies as code」という表現はピッタリだと思う👌 testcontainers.com Testcontainers は Java / Go / .NET / Rust など多くの言語をサポートしているけど,今回は Python 用の testcontainers-python を試してみた.検証に使ったコードを紹介しつつ,簡単にまとめておく✍ また Testcontainers Cloud もあったりする🌩 testcontainers.com 前提 今回は以下の前提で試
![testcontainers-python: pytest 実行時に使い捨て可能な LocalStack を起動する - kakakakakku blog](https://cdn-ak-scissors.b.st-hatena.com/image/square/e4198a7f3c04d5366989fb7c5c68eaf59b1e073a/height=288;version=1;width=512/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fk%2Fkakku22%2F20240317%2F20240317135016.png)