Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ formatting = [
"isort==7.0.0"
]
linting = [
"pylint==3.3.9"
"pylint==4.0.0"
]
cli = [
"typer" # if you install fundamend[cli], the cli commands are available via typer
Expand Down
18 changes: 9 additions & 9 deletions unittests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

import pytest

_SKIP_TESTS = False
_should_skip_typer_based_tests = False
try:
from typer.testing import CliRunner

runner = CliRunner()
from fundamend.__main__ import app
except ImportError:
_SKIP_TESTS = True
_should_skip_typer_based_tests = True


@pytest.fixture(scope="function")
def example_files_lesefassung(tmp_path: Path) -> Iterator[Path]:
if _SKIP_TESTS:
if _should_skip_typer_based_tests:
pytest.skip("Seems like typer is not installed")
copied_files_path = tmp_path / "example_files"
copied_files_path.mkdir(parents=True, exist_ok=True)
Expand All @@ -29,7 +29,7 @@ def example_files_lesefassung(tmp_path: Path) -> Iterator[Path]:

@pytest.fixture(scope="function")
def example_files_konsulationsfassung_without_uebertragungsdatei(tmp_path: Path) -> Iterator[Path]:
if _SKIP_TESTS:
if _should_skip_typer_based_tests:
pytest.skip("Seems like typer is not installed")
copied_files_path = tmp_path / "example_files"
copied_files_path.mkdir(parents=True, exist_ok=True)
Expand All @@ -43,7 +43,7 @@ def example_files_konsulationsfassung_without_uebertragungsdatei(tmp_path: Path)

@pytest.fixture(scope="function")
def example_files_fehlerkorrektur(tmp_path: Path) -> Iterator[Path]:
if _SKIP_TESTS:
if _should_skip_typer_based_tests:
pytest.skip("Seems like typer is not installed")
copied_files_path = tmp_path / "example_files"
copied_files_path.mkdir(parents=True, exist_ok=True)
Expand All @@ -55,7 +55,7 @@ def example_files_fehlerkorrektur(tmp_path: Path) -> Iterator[Path]:


def test_cli_single_file_mig(example_files_lesefassung: Path) -> None:
if _SKIP_TESTS:
if _should_skip_typer_based_tests:
pytest.skip("Seems like typer is not installed")
mig_path = example_files_lesefassung / "UTILTS_MIG_1.1c_Lesefassung_2023_12_12.xml"

Expand All @@ -66,7 +66,7 @@ def test_cli_single_file_mig(example_files_lesefassung: Path) -> None:


def test_cli_single_file_ahb(example_files_konsulationsfassung_without_uebertragungsdatei: Path) -> None:
if _SKIP_TESTS:
if _should_skip_typer_based_tests:
pytest.skip("Seems like typer is not installed")
ahb_path = (
example_files_konsulationsfassung_without_uebertragungsdatei
Expand All @@ -80,7 +80,7 @@ def test_cli_single_file_ahb(example_files_konsulationsfassung_without_uebertrag


def test_cli_directory(example_files_lesefassung: Path) -> None:
if _SKIP_TESTS:
if _should_skip_typer_based_tests:
pytest.skip("Seems like typer is not installed")
mig_path = example_files_lesefassung / "UTILTS_MIG_1.1c_Lesefassung_2023_12_12.xml"
ahb_path = example_files_lesefassung / "UTILTS_AHB_1.1c_Lesefassung_2023_12_12_ZPbXedn.xml"
Expand All @@ -94,7 +94,7 @@ def test_cli_directory(example_files_lesefassung: Path) -> None:


def test_cli_directory_with_sanitize_compressed_splitted(example_files_fehlerkorrektur: Path, tmp_path: Path) -> None:
if _SKIP_TESTS:
if _should_skip_typer_based_tests:
pytest.skip("Seems like typer is not installed")
# mig_path = example_files_lesefassung / "UTILTS_MIG_1.1c_Lesefassung_2023_12_12.xml"
# ahb_path = example_files_lesefassung / "UTILTS_AHB_1.1c_Lesefassung_2023_12_12_ZPbXedn.xml"
Expand Down