Guest User

Untitled

a guest
Mar 23rd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. @pytest.fixture
  2. def db_conn():
  3. psycopg2.connect("dbname=test user=postgres")
  4. yield conn
  5. # start cleaning up
  6. conn.close()
  7.  
  8. def test_foo(db_conn):
  9. result = db_conn.execute(a_sql_statement)
  10. assert result == expected_value
Add Comment
Please, Sign In to add comment