Created
March 14, 2018 15:20
-
-
Save nguyendv/29acc797ca98926f8e70881ea697437f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment