Skip to content

Commit 35a4821

Browse files
committed
Updated tests to satisfy ruff.
1 parent a9080e8 commit 35a4821

File tree

3 files changed

+14
-242
lines changed

3 files changed

+14
-242
lines changed

tests/test_configuration_matrix.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ def test_license_variations(
9090
"""Test different license configurations."""
9191
tt = str.maketrans({"-": "_", ".": "_", " ": "_"})
9292

93-
pkgname = f"license_test_{license_name.translate(tt)}".lower()
94-
tmp_path = tmp_path_factory.mktemp(pkgname)
93+
pkg_name = f"license_test_{license_name.translate(tt)}".lower()
94+
tmp_path = tmp_path_factory.mktemp(pkg_name)
9595

9696
context = {
9797
"license": license_name,
9898
"create_github_repo": False,
99-
"package_name": pkgname,
99+
"package_name": pkg_name,
100100
}
101101

102102
project_path = bake(
@@ -111,7 +111,7 @@ def test_license_variations(
111111
# Verify LICENSE file exists and contains expected content
112112
license_file = project_path / "LICENSE"
113113

114-
if license == "no-license":
114+
if license_name == "no-license":
115115
assert not license_file.exists(), "no-license: LICENSE should not exist."
116116
pytest.skip("No LICENSE file expected for no-license configuration")
117117

@@ -120,17 +120,18 @@ def test_license_variations(
120120
license_content = license_file.read_text()
121121

122122
# Verify license-specific content
123-
if license == "MIT":
124-
assert "MIT License" in license_content
125-
elif license == "Apache-2.0":
126-
assert "Apache License" in license_content
127-
elif license == "GPL-3.0":
128-
assert "GNU GENERAL PUBLIC LICENSE" in license_content
123+
match license_name:
124+
case "MIT":
125+
assert "MIT License" in license_content
126+
case "Apache-2.0":
127+
assert "Apache License" in license_content
128+
case "GPL-3.0":
129+
assert "GNU GENERAL PUBLIC LICENSE" in license_content
129130

130131
# Verify pyproject.toml license field
131132
pyproject_content = (project_path / "pyproject.toml").read_text()
132-
if license != "no-license":
133-
assert f'license = "{license}"' in pyproject_content
133+
if license_name != "no-license":
134+
assert f'license = "{license_name}"' in pyproject_content
134135

135136
@pytest.mark.parametrize("log_to_file", [True, False])
136137
@pytest.mark.parametrize("use_pydantic_settings", [True, False])

tests/test_cross_platform.py

Lines changed: 0 additions & 229 deletions
This file was deleted.

{{ cookiecutter.package_name }}/src/{{cookiecutter.package_name}}/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
@cli.callback(invoke_without_command=True, no_args_is_help=True)
2727
def global_callback(
28-
ctx: typer.Context,
28+
ctx: typer.Context, # noqa: ARG001
2929
debug: bool = typer.Option(
3030
False,
3131
"--debug",

0 commit comments

Comments
 (0)