M yoyo/backends/base.py +0 -2
@@ 83,7 83,6 @@ class TransactionManager:
class SavepointTransactionManager(TransactionManager):
-
id = None
id_generator = count(1)
@@ 106,7 105,6 @@ class SavepointTransactionManager(Transa
class DatabaseBackend:
-
driver_module = ""
log_table = "_yoyo_log"
M yoyo/backends/contrib/oracle.py +0 -1
@@ 16,7 16,6 @@ from yoyo.backends.base import DatabaseB
class OracleBackend(DatabaseBackend):
-
driver_module = "cx_Oracle"
list_tables_sql = "SELECT table_name FROM all_tables WHERE owner=user"
M yoyo/backends/contrib/snowflake.py +0 -1
@@ 16,7 16,6 @@ from yoyo.backends.base import DatabaseB
class SnowflakeBackend(DatabaseBackend):
-
driver_module = "snowflake.connector"
def connect(self, dburi):
M yoyo/backends/core/mysql.py +0 -1
@@ 16,7 16,6 @@ from yoyo.backends.base import DatabaseB
class MySQLBackend(DatabaseBackend):
-
driver_module = "pymysql"
list_tables_sql = (
"SELECT table_name FROM information_schema.tables "
M yoyo/backends/core/sqlite3.py +0 -1
@@ 16,7 16,6 @@ from yoyo.backends.base import DatabaseB
class SQLiteBackend(DatabaseBackend):
-
driver_module = "sqlite3"
list_tables_sql = "SELECT name FROM sqlite_master WHERE type = 'table'"
M yoyo/config.py +0 -2
@@ 39,7 39,6 @@ class CircularReferenceError(configparse
class CustomInterpolation(configparser.BasicInterpolation):
-
defaults: t.Dict[str, str] = {}
def __init__(self, defaults):
@@ 149,7 148,6 @@ def _read_config(path: Path) -> ConfigPa
def find_includes(
basepath: Path, config: ConfigParser
) -> t.Tuple[t.List[Path], t.List[Path]]:
-
result: t.Dict[str, t.List[Path]] = {INCLUDE: [], INHERIT: []}
for key in [INHERIT, INCLUDE]:
try:
M yoyo/scripts/init.py +0 -1
@@ 37,7 37,6 @@ def install_argparsers(global_parser, su
def init(args, config) -> int:
-
if args.config:
configpath = pathlib.Path(args.config)
else:
M yoyo/scripts/main.py +0 -1
@@ 175,7 175,6 @@ def prompt_save_config(config, path):
def upgrade_legacy_config(args, config, sources):
-
for dir in reversed(sources):
path = os.path.join(dir, LEGACY_CONFIG_FILENAME)
if not os.path.isfile(path):
M yoyo/scripts/migrate.py +0 -2
@@ 165,7 165,6 @@ def install_argparsers(global_parser, su
def filter_migrations(migrations, pattern):
-
if not pattern:
return migrations
@@ 207,7 206,6 @@ def migrations_to_revision(migrations, r
def get_migrations(args, backend, direction=None):
-
sources = args.sources
dburi = args.database
M yoyo/scripts/newmigration.py +0 -1
@@ 90,7 90,6 @@ def install_argparsers(global_parser, su
def new_migration(args, config) -> int:
-
try:
directory = args.sources[0]
except IndexError:
M yoyo/tests/test_backends.py +0 -4
@@ 160,7 160,6 @@ class TestTransactionHandling(object):
class TestConcurrency(object):
-
# How long to lock for: long enough to allow a migration to be loaded and
# started without unduly slowing down the test suite
lock_duration = 0.5
@@ 209,7 208,6 @@ class TestConcurrency(object):
thread.join()
def test_lock_times_out(self, dburi):
-
backend = get_backend(dburi)
self.skip_if_not_concurrency_safe(backend)
@@ 236,11 234,9 @@ class TestInitConnection(object):
return Mock()
def test_it_calls_init_connection(self):
-
with patch("yoyo.internalmigrations.upgrade"), patch.object(
self.MockBackend, "init_connection", Mock()
) as mock_init:
-
backend = self.MockBackend("", "")
connection = backend.connection
assert mock_init.call_args == call(connection)
M yoyo/tests/test_connections.py +0 -1
@@ 79,7 79,6 @@ class TestParseURI:
return_value=MagicMock(DatabaseError=MockDatabaseError, paramstyle="qmark"),
)
def test_connections(get_dbapi_module):
-
u = parse_uri("odbc://scott:tiger@db.example.org:42/northwind?foo=bar")
cases = [
(
M yoyo/tests/test_migrations.py +0 -3
@@ 315,7 315,6 @@ class TestAncestorsDescendants(object):
self.migrations = {self.m1, self.m2, self.m3, self.m4, self.m5}
def test_ancestors(self):
-
assert ancestors(self.m1, self.migrations) == {
self.m2,
self.m3,
@@ 327,7 326,6 @@ class TestAncestorsDescendants(object):
assert ancestors(self.m5, self.migrations) == set()
def test_descendants(self):
-
assert descendants(self.m1, self.migrations) == set()
assert descendants(self.m2, self.migrations) == {self.m1}
assert descendants(self.m3, self.migrations) == {self.m2, self.m1}
@@ 456,7 454,6 @@ class TestReadMigrations(object):
def test_it_sets_depends_for_sql_migrations(self):
def check(sql, expected):
with migrations_dir(**{"1.sql": "", "2.sql": "", "3.sql": sql}) as tmp:
-
migration = read_migrations(tmp)[-1]
migration.load()
assert {m.id for m in migration._depends} == expected
M yoyo/tests/test_topologicalsort.py +0 -1
@@ 25,7 25,6 @@ class TestTopologicalSort(object):
self.check(s, "", s)
def test_it_sorts_topologically(self):
-
# Single group at start
self.check("ABCD", "BA", "ABCD")
self.check("BACD", "BA", "ABCD")
M yoyo/topologicalsort.py +0 -1
@@ 24,7 24,6 @@ T = TypeVar("T")
def topological_sort(
items: Iterable[T], dependency_graph: Mapping[T, Collection[T]]
) -> Iterable[T]:
-
# Tag each item with its input order
pqueue = list(enumerate(items))
ordering = {item: ix for ix, item in pqueue}