Skip to content

Commit b0b8ced

Browse files
authored
Fix FutureWarnings on Python 3.13 (#375)
This one: ``` FutureWarning: functools.partial will be a method descriptor in future Python versions; wrap it in staticmethod() if you want to preserve the old behavior ```
1 parent 6c4a360 commit b0b8ced

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

tests/test_makemigrations.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class MakeMigrationsTests(EnterContextMixin, TestCase):
1616
def setUp(self):
1717
self.migrations_dir = self.enterContext(temp_migrations_module())
1818

19-
call_command = partial(run_command, "makemigrations")
19+
call_command = staticmethod(partial(run_command, "makemigrations"))
2020

2121
def test_dry_run(self):
2222
out, err, returncode = self.call_command("--dry-run", "testapp")

tests/test_rebase_migration.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def tmp_path_fixture(self, tmp_path):
3636
finally:
3737
sys.path.pop(0)
3838

39-
call_command = partial(run_command, "rebase_migration")
39+
call_command = staticmethod(partial(run_command, "rebase_migration"))
4040

4141
def test_error_for_non_first_party_app(self):
4242
with mock.patch.object(module, "is_first_party_app_config", return_value=False):

tests/test_squashmigrations.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class SquashMigrationsTests(EnterContextMixin, TestCase):
1717
def setUp(self):
1818
self.migrations_dir = self.enterContext(temp_migrations_module())
1919

20-
call_command = partial(run_command, "squashmigrations")
20+
call_command = staticmethod(partial(run_command, "squashmigrations"))
2121

2222
def test_fail_already_squashed_migration(self):
2323
(self.migrations_dir / "__init__.py").touch()

0 commit comments

Comments
 (0)