Skip to content

Commit

Permalink
tox: update ruff and mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
bluetech committed Feb 9, 2025
1 parent e2c6cee commit ba6c6a6
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 24 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ ignore = [
"PLR0913", # Too many arguments in function definition
"PLR2004", # Magic value used in comparison, consider replacing 3 with a constant variable
"PT001", # Use `@pytest.fixture()` over `@pytest.fixture`
"PT004", # Fixture `fixture_with_db` does not return anything, add leading underscore
"PT023", # Use `@pytest.mark.django_db()` over `@pytest.mark.django_db`
]

Expand Down
2 changes: 1 addition & 1 deletion pytest_django/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@


__all__ = [
"__version__",
"DjangoAssertNumQueries",
"DjangoCaptureOnCommitCallbacks",
"DjangoDbBlocker",
"__version__",
]
24 changes: 12 additions & 12 deletions pytest_django/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,25 @@


__all__ = [
"django_db_setup",
"_live_server_helper",
"admin_client",
"admin_user",
"async_client",
"async_rf",
"client",
"db",
"transactional_db",
"django_assert_max_num_queries",
"django_assert_num_queries",
"django_capture_on_commit_callbacks",
"django_db_reset_sequences",
"django_db_serialized_rollback",
"admin_user",
"django_db_setup",
"django_user_model",
"django_username_field",
"client",
"async_client",
"admin_client",
"live_server",
"rf",
"async_rf",
"settings",
"live_server",
"_live_server_helper",
"django_assert_num_queries",
"django_assert_max_num_queries",
"django_capture_on_commit_callbacks",
"transactional_db",
]


Expand Down
4 changes: 2 additions & 2 deletions pytest_django/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ def pytest_addoption(parser: pytest.Parser) -> None:

parser.addini(
"django_find_project",
"Automatically find and add a Django project to the " "Python path.",
"Automatically find and add a Django project to the Python path.",
type="bool",
default=True,
)
parser.addini(
"django_debug_mode",
"How to set the Django DEBUG setting (default `False`). " "Use `keep` to not override.",
"How to set the Django DEBUG setting (default `False`). Use `keep` to not override.",
default="False",
)
group.addoption(
Expand Down
9 changes: 4 additions & 5 deletions tests/test_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def test_django_assert_num_queries_db(
with django_assert_num_queries(2) as captured:
Item.objects.create(name="quux")
assert excinfo.value.args == (
"Expected to perform 2 queries but 1 was done " "(add -v option to show queries)",
"Expected to perform 2 queries but 1 was done (add -v option to show queries)",
)
assert len(captured.captured_queries) == 1

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

django_pytester.create_test_module(
f"""
def test_with_live_server(live_server):
assert live_server.port == {port}
"""
def test_with_live_server(live_server):
assert live_server.port == %d
"""
% port
)

django_pytester.runpytest_subprocess(f"--liveserver=localhost:{port}")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_manage_py_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def test_django_project_scan_disabled_invalid_settings(
assert result.ret != 0

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


@pytest.mark.django_project(project_root="django_project_root", create_manage_py=True)
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ commands =
[testenv:linting]
extras =
deps =
ruff==0.6.3
mypy==1.11.2
ruff==0.9.5
mypy==1.15.0
commands =
ruff check {posargs:pytest_django pytest_django_test tests}
ruff format --quiet --diff {posargs:pytest_django pytest_django_test tests}
Expand Down

0 comments on commit ba6c6a6

Please sign in to comment.