Skip to content

Commit

Permalink
pre-commit update
Browse files Browse the repository at this point in the history
  • Loading branch information
craiga authored and github-actions[bot] committed Sep 13, 2024
1 parent 632c781 commit 9255b6a
Show file tree
Hide file tree
Showing 14 changed files with 66 additions and 66 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ repos:
- "--fix=lf"
- id: trailing-whitespace
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.16.0
rev: 1.21.0
hooks:
- id: django-upgrade
args: [--target-version, "3.1"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
rev: v3.17.0
hooks:
- id: pyupgrade
args: ["--py39"]
Expand All @@ -46,7 +46,7 @@ repos:
hooks:
- id: checkmake
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.1
rev: v0.6.5
hooks:
- id: ruff
args: [--fix]
Expand Down
4 changes: 2 additions & 2 deletions will_of_the_prophets/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
logger = logging.getLogger(__name__)


@pytest.fixture()
def rolls() -> None: # noqa: PT004
@pytest.fixture
def rolls() -> None:
"""Generate nine rolls on the first nine days of July 2369."""
for number in range(1, 10):
embargo = pytz.utc.localize(
Expand Down
16 changes: 8 additions & 8 deletions will_of_the_prophets/tests/models/butthole/test_active.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,37 @@
from will_of_the_prophets import models


@pytest.mark.django_db()
@pytest.mark.django_db
def test_no_start_or_end() -> None: # noqa: D103
butthole = baker.make(models.Butthole, start=None, end=None)
assert butthole in models.Butthole.objects.active(datetime(2000, 1, 1)) # noqa: DTZ001


@pytest.mark.django_db()
@pytest.mark.django_db
def test_start_in_past() -> None: # noqa: D103
butthole = baker.make(models.Butthole, start=datetime(1980, 1, 1), end=None) # noqa: DTZ001
assert butthole in models.Butthole.objects.active(datetime(2000, 1, 1)) # noqa: DTZ001


@pytest.mark.django_db()
@pytest.mark.django_db
def test_start_in_future() -> None: # noqa: D103
butthole = baker.make(models.Butthole, start=datetime(2020, 1, 1), end=None) # noqa: DTZ001
assert butthole not in models.Butthole.objects.active(datetime(2000, 1, 1)) # noqa: DTZ001


@pytest.mark.django_db()
@pytest.mark.django_db
def test_end_in_past() -> None: # noqa: D103
butthole = baker.make(models.Butthole, start=None, end=datetime(1980, 1, 1)) # noqa: DTZ001
assert butthole not in models.Butthole.objects.active(datetime(2000, 1, 1)) # noqa: DTZ001


@pytest.mark.django_db()
@pytest.mark.django_db
def test_end_in_future() -> None: # noqa: D103
butthole = baker.make(models.Butthole, start=None, end=datetime(2020, 1, 1)) # noqa: DTZ001
assert butthole in models.Butthole.objects.active(datetime(2000, 1, 1)) # noqa: DTZ001


@pytest.mark.django_db()
@pytest.mark.django_db
def test_start_and_end_in_past() -> None: # noqa: D103
butthole = baker.make(
models.Butthole,
Expand All @@ -46,7 +46,7 @@ def test_start_and_end_in_past() -> None: # noqa: D103
assert butthole not in models.Butthole.objects.active(datetime(2000, 1, 1)) # noqa: DTZ001


@pytest.mark.django_db()
@pytest.mark.django_db
def test_start_in_past_end_in_future() -> None: # noqa: D103
butthole = baker.make(
models.Butthole,
Expand All @@ -56,7 +56,7 @@ def test_start_in_past_end_in_future() -> None: # noqa: D103
assert butthole in models.Butthole.objects.active(datetime(2000, 1, 1)) # noqa: DTZ001


@pytest.mark.django_db()
@pytest.mark.django_db
def test_start_and_end_in_future() -> None: # noqa: D103
butthole = baker.make(
models.Butthole,
Expand Down
16 changes: 8 additions & 8 deletions will_of_the_prophets/tests/models/special_square/test_active.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
from will_of_the_prophets import models


@pytest.mark.django_db()
@pytest.mark.django_db
def test_no_start_or_end() -> None: # noqa: D103
special_square = baker.make(
models.SpecialSquare, start=None, end=None, type__image=""
)
assert special_square in models.SpecialSquare.objects.active(datetime(2000, 1, 1)) # noqa: DTZ001


@pytest.mark.django_db()
@pytest.mark.django_db
def test_start_in_past() -> None: # noqa: D103
special_square = baker.make(
models.SpecialSquare,
Expand All @@ -25,7 +25,7 @@ def test_start_in_past() -> None: # noqa: D103
assert special_square in models.SpecialSquare.objects.active(datetime(2000, 1, 1)) # noqa: DTZ001


@pytest.mark.django_db()
@pytest.mark.django_db
def test_start_in_future() -> None: # noqa: D103
special_square = baker.make(
models.SpecialSquare,
Expand All @@ -38,7 +38,7 @@ def test_start_in_future() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_end_in_past() -> None: # noqa: D103
special_square = baker.make(
models.SpecialSquare,
Expand All @@ -51,7 +51,7 @@ def test_end_in_past() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_end_in_future() -> None: # noqa: D103
special_square = baker.make(
models.SpecialSquare,
Expand All @@ -62,7 +62,7 @@ def test_end_in_future() -> None: # noqa: D103
assert special_square in models.SpecialSquare.objects.active(datetime(2000, 1, 1)) # noqa: DTZ001


@pytest.mark.django_db()
@pytest.mark.django_db
def test_start_and_end_in_past() -> None: # noqa: D103
special_square = baker.make(
models.SpecialSquare,
Expand All @@ -75,7 +75,7 @@ def test_start_and_end_in_past() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_start_in_past_end_in_future() -> None: # noqa: D103
special_square = baker.make(
models.SpecialSquare,
Expand All @@ -86,7 +86,7 @@ def test_start_in_past_end_in_future() -> None: # noqa: D103
assert special_square in models.SpecialSquare.objects.active(datetime(2000, 1, 1)) # noqa: DTZ001


@pytest.mark.django_db()
@pytest.mark.django_db
def test_start_and_end_in_future() -> None: # noqa: D103
special_square = baker.make(
models.SpecialSquare,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from will_of_the_prophets import models


@pytest.mark.django_db()
@pytest.mark.django_db
def test_one_square_no_end() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(models.SpecialSquare, start=None, end=None, type=special_square_type)
Expand All @@ -15,7 +15,7 @@ def test_one_square_no_end() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_one_square_end_in_past() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(
Expand All @@ -29,7 +29,7 @@ def test_one_square_end_in_past() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_one_square_end_in_future() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(
Expand All @@ -43,7 +43,7 @@ def test_one_square_end_in_future() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_many_squares_all_archived() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(
Expand All @@ -63,7 +63,7 @@ def test_many_squares_all_archived() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_many_squares_none_archived() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(models.SpecialSquare, start=None, end=None, type=special_square_type)
Expand All @@ -79,7 +79,7 @@ def test_many_squares_none_archived() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_many_squares_some_archived() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(models.SpecialSquare, start=None, end=None, type=special_square_type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from will_of_the_prophets import models


@pytest.mark.django_db()
@pytest.mark.django_db
def test_one_square_no_start_or_end() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(models.SpecialSquare, start=None, end=None, type=special_square_type)
Expand All @@ -15,7 +15,7 @@ def test_one_square_no_start_or_end() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_one_square_start_in_past() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(
Expand All @@ -29,7 +29,7 @@ def test_one_square_start_in_past() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_one_square_start_in_future() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(
Expand All @@ -43,7 +43,7 @@ def test_one_square_start_in_future() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_one_square_end_in_past() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(
Expand All @@ -57,7 +57,7 @@ def test_one_square_end_in_past() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_one_square_end_in_future() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(
Expand All @@ -71,7 +71,7 @@ def test_one_square_end_in_future() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_one_square_start_and_end_in_past() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(
Expand All @@ -85,7 +85,7 @@ def test_one_square_start_and_end_in_past() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_one_square_start_in_past_end_in_future() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(
Expand All @@ -99,7 +99,7 @@ def test_one_square_start_in_past_end_in_future() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_one_square_start_and_end_in_future() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(
Expand All @@ -113,7 +113,7 @@ def test_one_square_start_and_end_in_future() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_many_squares_all_active() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(models.SpecialSquare, start=None, end=None, type=special_square_type)
Expand All @@ -140,7 +140,7 @@ def test_many_squares_all_active() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_many_squares_none_active() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(
Expand Down Expand Up @@ -172,7 +172,7 @@ def test_many_squares_none_active() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_many_squares_some_active() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(models.SpecialSquare, start=None, end=None, type=special_square_type)
Expand Down
4 changes: 2 additions & 2 deletions will_of_the_prophets/tests/test_authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
import pytest


@pytest.mark.django_db()
@pytest.mark.django_db
@pytest.mark.parametrize("url", ["/", "/roll_frequency/"])
def test_public(client, url) -> None: # noqa: ANN001
"""Test that pages do not require authorization."""
response = client.get(url, secure=True)
assert response.status_code == 200


@pytest.mark.django_db()
@pytest.mark.django_db
@pytest.mark.parametrize("url", ["/roll/"])
def test_requires_auth(client, admin_client, url) -> None: # noqa: ANN001
"""Test that pages require authorization."""
Expand Down
10 changes: 5 additions & 5 deletions will_of_the_prophets/tests/test_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from will_of_the_prophets import board


@pytest.mark.django_db()
@pytest.mark.django_db
def test_square_order() -> None:
"""
Tests that squares are generated as expected.
Expand Down Expand Up @@ -48,7 +48,7 @@ def test_square_order() -> None:
assert squares[i].row_reversed == expected_row_reversed


@pytest.mark.django_db()
@pytest.mark.django_db
@pytest.mark.freeze_time("2369-07-05 08:00")
def test_position(rolls) -> None: # noqa: ANN001
"""Test that the current position is correctly set."""
Expand All @@ -65,7 +65,7 @@ def test_position(rolls) -> None: # noqa: ANN001
assert not squares[i].is_current_position


@pytest.mark.django_db()
@pytest.mark.django_db
@pytest.mark.freeze_time("2369-07-05 08:00")
def test_explicit_date(rolls) -> None: # noqa: ANN001
"""Test that the current position is set with an explicit date."""
Expand All @@ -84,7 +84,7 @@ def test_explicit_date(rolls) -> None: # noqa: ANN001
assert not squares[i].is_current_position


@pytest.mark.django_db()
@pytest.mark.django_db
def test_query_count(django_assert_max_num_queries) -> None: # noqa: ANN001
"""Test that rendering the board does not issue an excessive number of queries."""
call_command(
Expand All @@ -94,7 +94,7 @@ def test_query_count(django_assert_max_num_queries) -> None: # noqa: ANN001
str(board.Board())


@pytest.fixture()
@pytest.fixture
def some_datetime(): # noqa: ANN201, D103
return pytz.utc.localize(
datetime(year=2369, month=7, day=5, hour=12, minute=34, second=56) # noqa: DTZ001
Expand Down
2 changes: 1 addition & 1 deletion will_of_the_prophets/tests/test_buttholes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from model_bakery import baker


@pytest.mark.django_db()
@pytest.mark.django_db
def test_start_and_end_must_be_different() -> None: # noqa: D103
butthole = baker.prepare("Butthole", start_square=25, end_square=25)
with pytest.raises(ValidationError):
Expand Down
Loading

0 comments on commit 9255b6a

Please sign in to comment.