Skip to content

Commit

Permalink
mypy and pylint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
eacharles committed Jan 16, 2025
1 parent c03ef36 commit aa21355
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
9 changes: 6 additions & 3 deletions tests/cli/plot/test_plot_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ def test_cli_help() -> None:


@pytest.mark.skipif(missing_ci_data, reason="NO CI data")
def test_cli_run(setup_project_area) -> None:
def test_cli_run(setup_project_area: int) -> None:

assert setup_project_area == 0
runner = CliRunner()

result = runner.invoke(
Expand All @@ -36,8 +37,9 @@ def test_cli_run(setup_project_area) -> None:


@pytest.mark.skipif(missing_ci_data, reason="NO CI data")
def test_cli_inspect(setup_project_area) -> None:
def test_cli_inspect(setup_project_area: int) -> None:

assert setup_project_area == 0
runner = CliRunner()

result = runner.invoke(
Expand All @@ -48,8 +50,9 @@ def test_cli_inspect(setup_project_area) -> None:


@pytest.mark.skipif(missing_ci_data, reason="NO CI data")
def test_cli_extract_datasets(setup_project_area) -> None:
def test_cli_extract_datasets(setup_project_area: int) -> None:

assert setup_project_area == 0
runner = CliRunner()

result = runner.invoke(
Expand Down
9 changes: 5 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@


@pytest.fixture(name="setup_project_area", scope="session")
def setup_project_area(request) -> None:

def setup_project_area(request: pytest.FixtureRequest) -> int:
if not os.path.exists('tests/temp_data/projects/ci_test/data'):
os.makedirs('tests/temp_data/projects/ci_test/data')
# FIXME, replace with a curl command
Expand All @@ -22,8 +22,9 @@ def setup_project_area(request) -> None:
'tests/temp_data/data/test/ci_test_blend_baseline_100k.hdf5'
)


def teardown_project_area():
def teardown_project_area() -> None:
os.system("\\rm -rf tests/temp_data")

request.addfinalizer(teardown_project_area)

return 0
6 changes: 4 additions & 2 deletions tests/plotting/test_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@


@pytest.mark.skipif(missing_ci_data, reason="no ci data")
def test_load_yaml(setup_project_area) -> None:
def test_load_yaml(setup_project_area: int) -> None:

assert setup_project_area == 0
control.clear()

# Load the testing yaml file
Expand All @@ -21,8 +22,9 @@ def test_load_yaml(setup_project_area) -> None:


@pytest.mark.skipif(missing_ci_data, reason="no ci data")
def test_run(setup_project_area) -> None:
def test_run(setup_project_area: int) -> None:

assert setup_project_area == 0
control.clear()

_out_dict = control.run('tests/ci_plot_groups.yaml', outdir='tests/temp_data/plots')
Expand Down
4 changes: 3 additions & 1 deletion tests/plotting/test_dataset_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@


@pytest.mark.skipif(missing_ci_data, reason="no ci data")
def test_load_yaml(setup_project_area) -> None:
def test_load_yaml(setup_project_area: int) -> None:

assert setup_project_area == 0

# Load the testing yaml file
RailDatasetFactory.clear()
Expand Down

0 comments on commit aa21355

Please sign in to comment.