Created
January 9, 2014 10:57
-
-
Save OrangeTux/8332464 to your computer and use it in GitHub Desktop.
Regenerate database with Py.test.
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
#conftest.py | |
import pytest | |
@pytest.fixture | |
def db(): | |
test_db.create_all() | |
return test_db | |
@pytest.fixture | |
def recreate_db(): | |
test_db.drop_all() | |
return db() | |
# test.py | |
import pytest | |
@pytest.mark.usefixtures('recreate_db') | |
def test_something(): | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment