Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/collabnix/testcontainers-python

Testcontainers, Python and PyTest
https://github.com/collabnix/testcontainers-python

containers developers docker integration-testing test-automation testcontainers testing testing-tools

Last synced: 3 days ago
JSON representation

Testcontainers, Python and PyTest

Awesome Lists containing this project

README

        

# Testcontainers, Python and PyTest

Test-Driven Development with Python, Testcontainers, and pytest

## Prereq

- Docker Desktop

## Clone the repository

```
git clone https://github.com/collabnix/testcontainers-python
cd testcontainers-python
```

## Create a virtual environment

```shell
python3 -m venv .venv
```

## Activate the virtual environment

```shell
source .venv/bin/activate
```

## Upgrade pip

```shell
pip install --upgrade pip
```

## Install the required packages

```shell
pip install psycopg
pip install pytest
pip install testcontainers
```

## Freeze the requirements

```shell
pip freeze > requirements.txt
```

## Running Tests

```shell
pytest
```

To set this interpreter as the default for all new projects: