测试gitnore

This commit is contained in:
ladeng07
2022-05-06 15:45:57 +08:00
parent 12f390949b
commit 51552904f9
2347 changed files with 120102 additions and 53549 deletions
@@ -28,7 +28,7 @@ class MigrationOptimizer:
"""
# Internal tracking variable for test assertions about # of loops
if app_label is None:
raise TypeError("app_label must be a str.")
raise TypeError('app_label must be a str.')
self._iterations = 0
while True:
result = self.optimize_inner(operations, app_label)
@@ -43,10 +43,10 @@ class MigrationOptimizer:
for i, operation in enumerate(operations):
right = True # Should we reduce on the right or on the left.
# Compare it to each operation after it
for j, other in enumerate(operations[i + 1 :]):
for j, other in enumerate(operations[i + 1:]):
result = operation.reduce(other, app_label)
if isinstance(result, list):
in_between = operations[i + 1 : i + j + 1]
in_between = operations[i + 1:i + j + 1]
if right:
new_operations.extend(in_between)
new_operations.extend(result)
@@ -59,7 +59,7 @@ class MigrationOptimizer:
# Otherwise keep trying.
new_operations.append(operation)
break
new_operations.extend(operations[i + j + 2 :])
new_operations.extend(operations[i + j + 2:])
return new_operations
elif not result:
# Can't perform a right reduction.