4 ms·
Another cool trick - use ephemeral memory SQLite database during unit tests: conn = sqlite3.connect(":memory:") But also run against your prod-like database (
by jackric 6y ago
Another cool trick - use ephemeral memory SQLite database during unit tests:
conn = sqlite3.connect(":memory:")
But also run against your prod-like database (Postgres/MySQL etc.) later in the CI pipe to catch idiosyncratic database problems.
- aitchnyu 6y agoFor Postgres, there is also disabling fsync delays (20x speed claimed) and even running it all in memory. https://dev.to/thejessleigh/speed-up-your-postgresql-unit-tests-with-one-weird-trick-364p https://dev.to/thejessleigh/speed-up-your-postgresql-unit-te...