Skip to content

Commit

Permalink
style: correct typing in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
laurent-laporte-pro committed Jul 6, 2024
1 parent da8295b commit 8d82409
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def study_assets(
AssetNotFoundError: If the study or expected study assets are not found
in the resource directory.
"""
module_path = Path(request.fspath)
module_path = Path(request.fspath) # type: ignore
assets_dir = module_path.parent.joinpath(module_path.stem.replace("test_", ""))
asset_dir = assets_dir.joinpath(request.node.name.replace("test_", ""))
zip_files = list(asset_dir.glob("*.zip"))
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
DEFAULT_IGNORES = frozenset(filecmp.DEFAULT_IGNORES) | {"study.ico"}


def are_same_dir(dir1: Path, dir2: Path, *, ignore: t.Sequence[str] = DEFAULT_IGNORES) -> bool:
def are_same_dir(dir1: Path, dir2: Path, *, ignore: t.Collection[str] = DEFAULT_IGNORES) -> bool:
"""
Compare two directories recursively.
"""
Expand Down
6 changes: 5 additions & 1 deletion tests/show_app/test_show_app.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import dataclasses
import datetime
import typing as t
from pathlib import Path

from antares.study.version.show_app import ShowApp
from antares.study.version.upgrade_app import scenarios

if t.TYPE_CHECKING:
from antares.study.version import StudyVersion

STUDY_ANTARES_FILE_0600 = """\
[antares]
caption = Thermal fleet optimization
Expand All @@ -31,7 +35,7 @@ def test_study_antares(self, study_dir: Path) -> None:
def test_available_upgrades(self, study_dir: Path) -> None:
app = ShowApp(study_dir)
actual = app.available_upgrades
expected = []
expected: t.List[StudyVersion] = []
assert actual == expected

# patch version
Expand Down

0 comments on commit 8d82409

Please sign in to comment.