Get the latest tech news
Test Postgres in Python Like SQLite
PGlite wrapper in Python for testing. Test your app with Postgres just as lite as SQLite. - wey-gu/py-pglite
🐍 Pythonic: Native support for SQLAlchemy & SQLModel in your tests 🧊 Fully Isolated: Every test module gets its own fresh database 🦾 100% Compatible: True PostgreSQL features via PGlite 🧩 Pytest Plug-and-Play: Ready-to-use fixtures for instant productivity Fork the repository Create a feature branch Make your changes Add tests for new functionality Run the development workflow: python hacking.py Submit a pull request Use pglite_session fixture for automatic cleanup between tests Use pglite_engine fixture when you need direct engine access Use utility functions for efficient database operations Consider custom configurations for specific test requirements
Or read this on Hacker News