Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and crocmagnon-pr[bot] committed Aug 19, 2024
1 parent d029177 commit 7351af5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
8 changes: 4 additions & 4 deletions src/character/tests/test_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from party.models import Party


@pytest.mark.django_db()
@pytest.mark.django_db
def test_can_access_own_character(client):
player = User.objects.create_user("username", password="password")

Expand All @@ -24,7 +24,7 @@ def test_can_access_own_character(client):
assert gm_notes not in body


@pytest.mark.django_db()
@pytest.mark.django_db
def test_cant_access_random_character(client):
player = User.objects.create_user("user", password="password")
other = User.objects.create_user("other", password="password")
Expand All @@ -35,7 +35,7 @@ def test_cant_access_random_character(client):
assert res.status_code == HTTPStatus.NOT_FOUND


@pytest.mark.django_db()
@pytest.mark.django_db
def test_can_access_character_in_party(client):
player = User.objects.create_user("user", password="password")
friend = User.objects.create_user("friend", password="password")
Expand All @@ -61,7 +61,7 @@ def test_can_access_character_in_party(client):
assert gm_notes not in body


@pytest.mark.django_db()
@pytest.mark.django_db
def test_game_master_can_access_character_in_party(client):
player = User.objects.create_user("user", password="password")
gm = User.objects.create_user("gm", password="password")
Expand Down
10 changes: 5 additions & 5 deletions src/character/tests/test_interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from common.models import User


@pytest.mark.django_db()
@pytest.mark.django_db
def test_create_character(selenium: WebDriver, live_server: LiveServer):
# Load fixtures
call_command("loaddata", "initial_data")
Expand Down Expand Up @@ -93,7 +93,7 @@ def test_create_character(selenium: WebDriver, live_server: LiveServer):
assert getattr(character, name) == value


@pytest.mark.django_db()
@pytest.mark.django_db
def test_change_health(selenium: WebDriver, live_server: LiveServer):
call_command("loaddata", "initial_data")
username, password = "user1", "some_password"
Expand Down Expand Up @@ -157,7 +157,7 @@ def test_change_health(selenium: WebDriver, live_server: LiveServer):
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_list_characters(selenium: WebDriver, live_server: LiveServer):
# Load fixtures
call_command("loaddata", "initial_data")
Expand Down Expand Up @@ -190,7 +190,7 @@ def test_list_characters(selenium: WebDriver, live_server: LiveServer):
assert names == expected_names


@pytest.mark.django_db()
@pytest.mark.django_db
def test_delete_character(selenium: WebDriver, live_server: LiveServer):
call_command("loaddata", "initial_data")

Expand All @@ -212,7 +212,7 @@ def test_delete_character(selenium: WebDriver, live_server: LiveServer):
assert Character.objects.filter(pk=characters[0].pk).first() is None


@pytest.mark.django_db()
@pytest.mark.django_db
def test_reset_stats_view(
selenium: WebDriver,
live_server: LiveServer,
Expand Down
10 changes: 5 additions & 5 deletions src/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def _collectstatic():
call_command("collectstatic", "--clear", "--noinput", "--verbosity=0")


@pytest.fixture()
@pytest.fixture
def live_server(settings, live_server):
settings.STORAGES = {
"default": {"BACKEND": "django.core.files.storage.FileSystemStorage"},
Expand All @@ -19,13 +19,13 @@ def live_server(settings, live_server):
return live_server


@pytest.fixture()
@pytest.fixture
def firefox_options(firefox_options):
firefox_options.add_argument("-headless")
return firefox_options


@pytest.fixture()
@pytest.fixture
def selenium(selenium: WebDriver) -> WebDriver:
selenium.implicitly_wait(3)
selenium.set_window_size(3860, 2140)
Expand All @@ -38,6 +38,6 @@ def settings(settings):
return settings


@pytest.fixture()
def initial_data() -> None: # noqa: PT004
@pytest.fixture
def initial_data() -> None:
call_command("loaddata", "initial_data")
16 changes: 8 additions & 8 deletions src/party/tests/test_interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from party.models import BattleEffect, Party


@pytest.mark.django_db()
@pytest.mark.django_db
def test_add_character_to_existing_group(selenium: WebDriver, live_server: LiveServer):
username, password = "gm", "password"
gm = User.objects.create_user(username, password=password)
Expand All @@ -39,7 +39,7 @@ def test_add_character_to_existing_group(selenium: WebDriver, live_server: LiveS
assert set(party.invited_characters.all()) == {character}


@pytest.mark.django_db()
@pytest.mark.django_db
def test_gm_observe_invited_character_in_group(
selenium: WebDriver,
live_server: LiveServer,
Expand All @@ -66,7 +66,7 @@ def test_gm_observe_invited_character_in_group(
assert title == character.name


@pytest.mark.django_db()
@pytest.mark.django_db
def test_gm_observe_invited_character_in_two_groups(
selenium: WebDriver,
live_server: LiveServer,
Expand Down Expand Up @@ -95,7 +95,7 @@ def test_gm_observe_invited_character_in_two_groups(
assert title == character.name


@pytest.mark.django_db()
@pytest.mark.django_db
def test_reset_stats_view(
selenium: WebDriver,
live_server: LiveServer,
Expand Down Expand Up @@ -125,7 +125,7 @@ def test_reset_stats_view(
assert character.luck_points_remaining == character.luck_points_max


@pytest.mark.django_db()
@pytest.mark.django_db
def test_player_can_add_effect_to_group(selenium: WebDriver, live_server: LiveServer):
"""Any member of a group can add effects to the group."""
user, password = "player", "password"
Expand Down Expand Up @@ -154,7 +154,7 @@ def test_player_can_add_effect_to_group(selenium: WebDriver, live_server: LiveSe
assert effect.description in element.text


@pytest.mark.django_db()
@pytest.mark.django_db
def test_gm_can_add_effect_to_group(selenium: WebDriver, live_server: LiveServer):
"""The GM of a group can add effects to the group."""
user, password = "gm", "password"
Expand Down Expand Up @@ -183,7 +183,7 @@ def test_gm_can_add_effect_to_group(selenium: WebDriver, live_server: LiveServer
assert effect.description in element.text


@pytest.mark.django_db()
@pytest.mark.django_db
def test_gm_can_change_remaining_rounds(selenium: WebDriver, live_server: LiveServer):
"""The GM of a group can increase or decrease the remaining rounds of effects."""
user, password = "gm", "password"
Expand Down Expand Up @@ -261,7 +261,7 @@ def wrapped(driver: WebDriver):
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_gm_can_delete_any_existing_effect(
selenium: WebDriver,
live_server: LiveServer,
Expand Down

0 comments on commit 7351af5

Please sign in to comment.