This is a simple example on how to reproduce a bug with psycopg3 and sentry_sdk.
Steps to reproduce:
- Install requirements
pip install -r requirements.txt
- Startup postgres
docker-compose up
- Run test without Sentry (test will succeed)
./manage.py test
- Run test with Sentry (test will fail)
export USE_SENTRY=True && ./manage.py test