Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @pytest.fixture
- def db_conn():
- psycopg2.connect("dbname=test user=postgres")
- yield conn
- # start cleaning up
- conn.close()
- def test_foo(db_conn):
- result = db_conn.execute(a_sql_statement)
- assert result == expected_value
Add Comment
Please, Sign In to add comment