MCPcopy
hub / github.com/sqlalchemy/alembic / setUp

Method setUp

tests/test_script_consumption.py:642–671  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

640
641class EncodingTest(TestBase):
642 def setUp(self):
643 self.env = staging_env()
644 self.cfg = cfg = _no_sql_testing_config()
645 cfg.set_main_option("dialect_name", "sqlite")
646 cfg.remove_main_option("url")
647 self.a = util.rev_id()
648 script = ScriptDirectory.from_config(cfg)
649 script.generate_revision(self.a, "revision a", refresh=True)
650 write_script(
651 script,
652 self.a,
653 (
654 """# coding: utf-8
655from __future__ import unicode_literals
656revision = '%s'
657down_revision = None
658
659from alembic import op
660
661def upgrade():
662 op.execute("« S’il vous plaît…")
663
664def downgrade():
665 op.execute("drôle de petite voix m’a réveillé")
666
667"""
668 % self.a
669 ),
670 encoding="utf-8",
671 )
672
673 def tearDown(self):
674 clear_staging_env()

Callers

nothing calls this directly

Calls 7

staging_envFunction · 0.90
_no_sql_testing_configFunction · 0.90
write_scriptFunction · 0.90
set_main_optionMethod · 0.80
remove_main_optionMethod · 0.80
from_configMethod · 0.80
generate_revisionMethod · 0.80

Tested by

no test coverage detected