@@ -90,13 +90,13 @@ def test_license_variations(
90
90
"""Test different license configurations."""
91
91
tt = str .maketrans ({"-" : "_" , "." : "_" , " " : "_" })
92
92
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 )
95
95
96
96
context = {
97
97
"license" : license_name ,
98
98
"create_github_repo" : False ,
99
- "package_name" : pkgname ,
99
+ "package_name" : pkg_name ,
100
100
}
101
101
102
102
project_path = bake (
@@ -111,7 +111,7 @@ def test_license_variations(
111
111
# Verify LICENSE file exists and contains expected content
112
112
license_file = project_path / "LICENSE"
113
113
114
- if license == "no-license" :
114
+ if license_name == "no-license" :
115
115
assert not license_file .exists (), "no-license: LICENSE should not exist."
116
116
pytest .skip ("No LICENSE file expected for no-license configuration" )
117
117
@@ -120,17 +120,18 @@ def test_license_variations(
120
120
license_content = license_file .read_text ()
121
121
122
122
# 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
129
130
130
131
# Verify pyproject.toml license field
131
132
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
134
135
135
136
@pytest .mark .parametrize ("log_to_file" , [True , False ])
136
137
@pytest .mark .parametrize ("use_pydantic_settings" , [True , False ])
0 commit comments