Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-ballarin committed Feb 11, 2024
1 parent 57ed3c9 commit d799b39
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Determine the version of a mathrace journal."""

import pathlib
import typing


def determine_journal_version(journal_filename: str) -> str:
def determine_journal_version(journal_filename: pathlib.Path) -> str:
"""
Determine the version of a mathrace journal.
Expand Down Expand Up @@ -97,7 +98,6 @@ def determine_journal_version(journal_filename: str) -> str:
This change affects all race event codes.
"""

with open(journal_filename) as journal_file:
journal = [line.strip("\n") for line in journal_file.readlines()]

Expand Down
2 changes: 1 addition & 1 deletion mathrace_interaction/tests/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def data_journals_basic(data_dir: pathlib.Path) -> list[pathlib.Path]:


@pytest.fixture
def data_journals_all(data_dir: pathlib.Path, data_journals_basic: list[pathlib.Path]) -> pathlib.Path:
def data_journals_all(data_dir: pathlib.Path, data_journals_basic: list[pathlib.Path]) -> list[pathlib.Path]:
"""Return all journals in the data directory."""
return [
*data_journals_basic,
Expand Down
4 changes: 2 additions & 2 deletions mathrace_interaction/tests/unit/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_data_both_journal_and_score_files_exist(

def test_data_contains_only_journal_and_score_files(data_dir: pathlib.Path) -> None:
"""Test that the data directory only contains journal and score files."""
for entry in data_dir.rglob(f"*"):
for entry in data_dir.rglob("*"):
assert entry.is_file() or entry.is_dir()
if entry.is_file():
assert entry.suffix in (".journal", ".score")
Expand All @@ -49,7 +49,7 @@ def test_data_contains_only_journal_and_score_files(data_dir: pathlib.Path) -> N
def test_data_journal_all_fixture(data_dir: pathlib.Path, data_journals_all: list[pathlib.Path]) -> None:
"""Test that the data_journals_all fixture actually contains all journal files."""
data_journals_actual = set()
for entry in data_dir.rglob(f"*"):
for entry in data_dir.rglob("*"):
assert entry.is_file() or entry.is_dir()
if entry.is_file():
if entry.suffix == ".journal":
Expand Down

0 comments on commit d799b39

Please sign in to comment.