Skip to content

Commit

Permalink
remove fixture typing
Browse files Browse the repository at this point in the history
  • Loading branch information
fangchenli committed Nov 9, 2023
1 parent 9f648c0 commit 8236673
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 31 deletions.
2 changes: 1 addition & 1 deletion tests/tests_unit/test_cli_dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
(["keycloak-api", "-r"], 2, ["requires an argument"]),
],
)
def test_cli_dev_stdout(args: List[str], exit_code: int, content: List[str]):
def test_cli_dev_stdout(args, exit_code, content):
app = create_cli()
result = runner.invoke(app, ["dev"] + args)
assert result.exit_code == exit_code
Expand Down
20 changes: 10 additions & 10 deletions tests/tests_unit/test_cli_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,16 @@ def generate_test_data_test_cli_init_happy_path():


def test_cli_init_happy_path(
provider: str,
region: str,
project_name: str,
domain_name: str,
namespace: str,
auth_provider: str,
ci_provider: str,
terraform_state: str,
email: str,
kubernetes_version: str,
provider,
region,
project_name,
domain_name,
namespace,
auth_provider,
ci_provider,
terraform_state,
email,
kubernetes_version,
):
app = create_cli()
args = [
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_unit/test_cli_keycloak.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
(["listusers", "-c"], 2, ["requires an argument"]),
],
)
def test_cli_keycloak_stdout(args: List[str], exit_code: int, content: List[str]):
def test_cli_keycloak_stdout(args, exit_code, content):
app = create_cli()
result = runner.invoke(app, ["keycloak"] + args)
assert result.exit_code == exit_code
Expand Down
20 changes: 10 additions & 10 deletions tests/tests_unit/test_cli_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,27 +74,27 @@ class Test_Cli_Upgrade_2023_5_1(_nebari.upgrade.UpgradeStep):
),
],
)
def test_cli_upgrade_stdout(args: List[str], exit_code: int, content: List[str]):
def test_cli_upgrade_stdout(args, exit_code, content):
app = create_cli()
result = runner.invoke(app, ["upgrade"] + args)
assert result.exit_code == exit_code
for c in content:
assert c in result.stdout


def test_cli_upgrade_2022_10_1_to_2022_11_1(monkeypatch: pytest.MonkeyPatch):
def test_cli_upgrade_2022_10_1_to_2022_11_1(monkeypatch):
assert_nebari_upgrade_success(monkeypatch, "2022.10.1", "2022.11.1")


def test_cli_upgrade_2022_11_1_to_2023_1_1(monkeypatch: pytest.MonkeyPatch):
def test_cli_upgrade_2022_11_1_to_2023_1_1(monkeypatch):
assert_nebari_upgrade_success(monkeypatch, "2022.11.1", "2023.1.1")


def test_cli_upgrade_2023_1_1_to_2023_4_1(monkeypatch: pytest.MonkeyPatch):
def test_cli_upgrade_2023_1_1_to_2023_4_1(monkeypatch):
assert_nebari_upgrade_success(monkeypatch, "2023.1.1", "2023.4.1")


def test_cli_upgrade_2023_4_1_to_2023_5_1(monkeypatch: pytest.MonkeyPatch):
def test_cli_upgrade_2023_4_1_to_2023_5_1(monkeypatch):
assert_nebari_upgrade_success(
monkeypatch,
"2023.4.1",
Expand All @@ -109,7 +109,7 @@ def test_cli_upgrade_2023_4_1_to_2023_5_1(monkeypatch: pytest.MonkeyPatch):
["aws", "azure", "do", "gcp"],
)
def test_cli_upgrade_2023_5_1_to_2023_7_1(
monkeypatch: pytest.MonkeyPatch, provider: str
monkeypatch, provider
):
config = assert_nebari_upgrade_success(
monkeypatch, "2023.5.1", "2023.7.1", provider=provider
Expand All @@ -126,9 +126,9 @@ def test_cli_upgrade_2023_5_1_to_2023_7_1(
[(True, True), (True, False), (False, None), (None, None)],
)
def test_cli_upgrade_2023_7_1_to_2023_7_2(
monkeypatch: pytest.MonkeyPatch,
workflows_enabled: bool,
workflow_controller_enabled: bool,
monkeypatch,
workflows_enabled,
workflow_controller_enabled,
):
addl_config = {}
inputs = []
Expand Down Expand Up @@ -164,7 +164,7 @@ def test_cli_upgrade_2023_7_1_to_2023_7_2(
assert "argo_workflows" not in upgraded


def test_cli_upgrade_image_tags(monkeypatch: pytest.MonkeyPatch):
def test_cli_upgrade_image_tags(monkeypatch):
start_version = "2023.5.1"
end_version = "2023.7.1"
addl_config = {
Expand Down
17 changes: 8 additions & 9 deletions tests/tests_unit/test_cli_validate.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import re
import shutil
from pathlib import Path
from typing import Any, Dict, List

import pytest
import yaml
Expand All @@ -15,7 +14,7 @@
runner = CliRunner()


def _update_yaml_file(file_path: Path, key: str, value: Any):
def _update_yaml_file(file_path, key, value):
"""Utility function to update a yaml file with a new key/value pair."""
with open(file_path, "r") as f:
yaml_data = yaml.safe_load(f)
Expand Down Expand Up @@ -43,7 +42,7 @@ def _update_yaml_file(file_path: Path, key: str, value: Any):
), # https://github.com/nebari-dev/nebari/issues/1937
],
)
def test_cli_validate_stdout(args: List[str], exit_code: int, content: List[str]):
def test_cli_validate_stdout(args, exit_code, content):
app = create_cli()
result = runner.invoke(app, ["validate"] + args)
assert result.exit_code == exit_code
Expand Down Expand Up @@ -148,11 +147,11 @@ def test_cli_validate_from_env(tmp_path):
],
)
def test_cli_validate_error_from_env(
key: str,
value: str,
provider: str,
expected_message: str,
addl_config: Dict[str, Any],
key,
value,
provider,
expected_message,
addl_config,
tmp_path,
):
tmp_file = tmp_path / "nebari-config.yaml"
Expand Down Expand Up @@ -211,7 +210,7 @@ def generate_test_data_test_cli_validate_error():
return {"keys": keys, "test_data": test_data}


def test_cli_validate_error(config_yaml: str, expected_message: str):
def test_cli_validate_error(config_yaml, expected_message):
test_file = TEST_DATA_DIR / config_yaml
assert test_file.exists() is True

Expand Down

0 comments on commit 8236673

Please sign in to comment.