Skip to content

Commit fd26a73

Browse files
committed
Updated tests
Claude tests were using bespoke extra context which caused gh executing during tests which causes GitHub actions to fail.
1 parent 7ff90db commit fd26a73

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

tests/test_build_validation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,23 +243,23 @@ def test_build_with_different_backends(
243243
self,
244244
tmp_path_factory: pytest.TempPathFactory,
245245
template_root: Path,
246+
cookiecutter_extra_context: dict,
246247
) -> None:
247248
"""Test building with different build backends."""
248249
backends_to_test = ["uv", "hatch"]
249250

250251
for backend in backends_to_test:
251252
tmp_path = tmp_path_factory.mktemp(f"build_{backend}")
252253

253-
context = {
254+
cookiecutter_extra_context |= {
254255
"build_backend": backend,
255-
"create_github_repo": False,
256256
"package_name": f"build_test_{backend}",
257257
}
258258

259259
project_path = bake(
260260
template=str(template_root),
261261
no_input=True,
262-
extra_context=context,
262+
extra_context=cookiecutter_extra_context,
263263
output_dir=tmp_path,
264264
)
265265

tests/test_edge_cases.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ def test_no_license_project(
1313
tmp_path_factory: pytest.TempPathFactory,
1414
template_root: Path,
1515
cookiecutter_package_name: str,
16+
cookiecutter_extra_context: dict,
1617
) -> None:
1718
"""Test that projects with no-license still include an Unlicense file."""
1819
tmp_path = tmp_path_factory.mktemp("no_license_project")
1920

20-
context = {
21+
cookiecutter_extra_context |= {
2122
"license": "no-license",
22-
"create_github_repo": False,
2323
}
2424

2525
project_path = bake(
2626
template=str(template_root),
2727
no_input=True,
28-
extra_context=context,
28+
extra_context=cookiecutter_extra_context,
2929
output_dir=tmp_path,
3030
)
3131

@@ -38,20 +38,20 @@ def test_no_pydantic_settings_project(
3838
tmp_path_factory: pytest.TempPathFactory,
3939
template_root: Path,
4040
cookiecutter_package_name: str,
41+
cookiecutter_extra_context: dict,
4142
) -> None:
4243
"""Test that projects without pydantic-settings don't include settings.py."""
4344
tmp_path = tmp_path_factory.mktemp("no_pydantic_project")
4445

45-
context = {
46+
cookiecutter_extra_context |= {
4647
"use_pydantic_settings": False,
47-
"create_github_repo": False,
4848
}
4949

5050
# Generate without hooks to avoid ruff issues in test templates
5151
project_path = bake(
5252
template=str(template_root),
5353
no_input=True,
54-
extra_context=context,
54+
extra_context=cookiecutter_extra_context,
5555
output_dir=tmp_path,
5656
skip_if_file_exists=True,
5757
accept_hooks=False, # Skip hooks for this test
@@ -66,7 +66,7 @@ def test_no_pydantic_settings_project(
6666
)
6767

6868
# Check project structure (but skip .git and .venv since hooks didn't run)
69-
basic_context = context.copy()
69+
basic_context = cookiecutter_extra_context.copy()
7070
basic_context["_hooks_ran"] = False
7171
assert check_project_contents(
7272
project_path, cookiecutter_package_name, basic_context

0 commit comments

Comments
 (0)