Skip to content

Commit 1937d7a

Browse files
committed
fix test for python 3.7
1 parent 8478350 commit 1937d7a

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

piccolo/apps/migrations/commands/backwards.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async def run(self) -> MigrationResult:
4343
app_name=self.app_name
4444
)
4545
if len(ran_migration_ids) == 0:
46-
# Make sure a status of 0 is returned, as we don't want this
46+
# Make sure a success is returned, as we don't want this
4747
# to appear as an error in automated scripts.
4848
message = "No migrations to reverse!"
4949
print(message)

tests/apps/migrations/commands/test_forwards_backwards.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,10 @@ def test_backwards_unknown_migration(self, print_: MagicMock):
120120
)
121121
)
122122

123-
self.assertEqual(
124-
len(
125-
[
126-
i
127-
for i in print_.mock_calls
128-
if i.args[0].startswith(
129-
"Unrecognized migration name - must be one of "
130-
)
131-
]
132-
),
133-
1,
123+
self.assertTrue(
124+
tuple(print_.mock_calls[0])[1][0].startswith(
125+
"Unrecognized migration name - must be one of "
126+
)
134127
)
135128

136129
@patch("piccolo.apps.migrations.commands.backwards.print")

0 commit comments

Comments
 (0)