Skip to content

Commit 8687c19

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent b28e9d1 commit 8687c19

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

tests/test_migrations.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
import pytest
1+
from io import StringIO
22
from typing import Optional
3+
4+
import pytest
35
from django.core.management import call_command
46
from django.test import TestCase
5-
from io import StringIO
7+
68

79
class MigrationTestCase(TestCase):
810
def test_no_missing_migrations(self):
@@ -22,19 +24,19 @@ def test_no_missing_migrations(self):
2224

2325
try:
2426
# Check for pending migrations without actually creating them
25-
call_command("makemigrations", "--check", "--dry-run", stdout=output, stderr=output)
27+
call_command(
28+
"makemigrations", "--check", "--dry-run", stdout=output, stderr=output
29+
)
2630
except SystemExit as e:
2731
# Capture the SystemExit if migrations are needed (the command will had ended with exit code 1)
2832
exec = e
29-
3033

31-
# If an exception was raised, verify it indicates no migration changes are required
34+
# If an exception was raised, verify it indicates no migration changes are required
3235
if exec is not None:
3336
self.assertEqual(
3437
exec.code,
35-
0, # 0 means no migrations needed
38+
0, # 0 means no migrations needed
3639
f"Model changes detected that require migrations!\n"
3740
f"Please run `python manage.py makemigrations` to create the necessary migrations.\n\n"
38-
f"Detected Changes:\n{output.getvalue()}"
41+
f"Detected Changes:\n{output.getvalue()}",
3942
)
40-

0 commit comments

Comments
 (0)