Skip to content

Instantly share code, notes, and snippets.

@dpnova
Last active August 29, 2015 14:06
Show Gist options
  • Save dpnova/615ebe54fa06f94b1b0e to your computer and use it in GitHub Desktop.
Save dpnova/615ebe54fa06f94b1b0e to your computer and use it in GitHub Desktop.
class TestCase(unittest.TestCase):
def __call__(self, *args, **kwargs):
alembic_cfg = Config("../alembic.ini")
alembic_cfg.set_section_option(
"alembic", "script_location", "../alembic")
command.upgrade(alembic_cfg, "head")
r = super(TestCase, self).__call__(*args, **kwargs)
command.downgrade(alembic_cfg, "base")
return r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment