Skip to content

Commit ba6c6a6

Browse files
committed
tox: update ruff and mypy
1 parent e2c6cee commit ba6c6a6

File tree

7 files changed

+22
-24
lines changed

7 files changed

+22
-24
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ ignore = [
139139
"PLR0913", # Too many arguments in function definition
140140
"PLR2004", # Magic value used in comparison, consider replacing 3 with a constant variable
141141
"PT001", # Use `@pytest.fixture()` over `@pytest.fixture`
142-
"PT004", # Fixture `fixture_with_db` does not return anything, add leading underscore
143142
"PT023", # Use `@pytest.mark.django_db()` over `@pytest.mark.django_db`
144143
]
145144

pytest_django/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111

1212
__all__ = [
13-
"__version__",
1413
"DjangoAssertNumQueries",
1514
"DjangoCaptureOnCommitCallbacks",
1615
"DjangoDbBlocker",
16+
"__version__",
1717
]

pytest_django/fixtures.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,25 @@
4141

4242

4343
__all__ = [
44-
"django_db_setup",
44+
"_live_server_helper",
45+
"admin_client",
46+
"admin_user",
47+
"async_client",
48+
"async_rf",
49+
"client",
4550
"db",
46-
"transactional_db",
51+
"django_assert_max_num_queries",
52+
"django_assert_num_queries",
53+
"django_capture_on_commit_callbacks",
4754
"django_db_reset_sequences",
4855
"django_db_serialized_rollback",
49-
"admin_user",
56+
"django_db_setup",
5057
"django_user_model",
5158
"django_username_field",
52-
"client",
53-
"async_client",
54-
"admin_client",
59+
"live_server",
5560
"rf",
56-
"async_rf",
5761
"settings",
58-
"live_server",
59-
"_live_server_helper",
60-
"django_assert_num_queries",
61-
"django_assert_max_num_queries",
62-
"django_capture_on_commit_callbacks",
62+
"transactional_db",
6363
]
6464

6565

pytest_django/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,13 @@ def pytest_addoption(parser: pytest.Parser) -> None:
129129

130130
parser.addini(
131131
"django_find_project",
132-
"Automatically find and add a Django project to the " "Python path.",
132+
"Automatically find and add a Django project to the Python path.",
133133
type="bool",
134134
default=True,
135135
)
136136
parser.addini(
137137
"django_debug_mode",
138-
"How to set the Django DEBUG setting (default `False`). " "Use `keep` to not override.",
138+
"How to set the Django DEBUG setting (default `False`). Use `keep` to not override.",
139139
default="False",
140140
)
141141
group.addoption(

tests/test_fixtures.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def test_django_assert_num_queries_db(
104104
with django_assert_num_queries(2) as captured:
105105
Item.objects.create(name="quux")
106106
assert excinfo.value.args == (
107-
"Expected to perform 2 queries but 1 was done " "(add -v option to show queries)",
107+
"Expected to perform 2 queries but 1 was done (add -v option to show queries)",
108108
)
109109
assert len(captured.captured_queries) == 1
110110

@@ -556,11 +556,10 @@ def test_specified_port_django_111(self, django_pytester: DjangoPytester) -> Non
556556
sock.close()
557557

558558
django_pytester.create_test_module(
559+
f"""
560+
def test_with_live_server(live_server):
561+
assert live_server.port == {port}
559562
"""
560-
def test_with_live_server(live_server):
561-
assert live_server.port == %d
562-
"""
563-
% port
564563
)
565564

566565
django_pytester.runpytest_subprocess(f"--liveserver=localhost:{port}")

tests/test_manage_py_scan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def test_django_project_scan_disabled_invalid_settings(
123123
assert result.ret != 0
124124

125125
result.stderr.fnmatch_lines(["*ImportError*DOES_NOT_EXIST*"])
126-
result.stderr.fnmatch_lines(["*pytest-django did not search for " "Django projects*"])
126+
result.stderr.fnmatch_lines(["*pytest-django did not search for Django projects*"])
127127

128128

129129
@pytest.mark.django_project(project_root="django_project_root", create_manage_py=True)

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ commands =
5050
[testenv:linting]
5151
extras =
5252
deps =
53-
ruff==0.6.3
54-
mypy==1.11.2
53+
ruff==0.9.5
54+
mypy==1.15.0
5555
commands =
5656
ruff check {posargs:pytest_django pytest_django_test tests}
5757
ruff format --quiet --diff {posargs:pytest_django pytest_django_test tests}

0 commit comments

Comments
 (0)