August 2018
Beginner
160 pages
4h 8m
English
This plugin allows you to test code that needs a running PostgreSQL database.
Here's a quick example of it in action:
def test_fetch_series(postgresql): cur = postgresql.cursor() cur.execute('SELECT * FROM comedy_series;') assert len(cur.fetchall()) == 5 cur.close()
It provides two fixtures:
It also provides several configuration options on how to connect and configure the testing database.
Read now
Unlock full access