测试gitnore
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user