Skip to content

Commit 1361026

Browse files
committed
add better unit tests
1 parent 57e48c5 commit 1361026

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

docs/features/codecov.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ coverage:
2121
threshold: 1%
2222

2323
# Ignoring Paths
24-
# --------------
24+
25+
------------
2526
# which folders/files to ignore
2627
ignore:
2728
- "foo/bar.py"

tests/test_combinations.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
}
4040

4141

42-
def _effective(options: dict[str, str]) -> dict[str, str]:
43-
"""Return the full set of effective options (defaults merged with overrides)."""
42+
def resolve_options(options: dict[str, str]) -> dict[str, str]:
43+
"""Return the full set of resolved options (defaults merged with overrides)."""
4444
return {**DEFAULTS, **options}
4545

4646

@@ -66,7 +66,7 @@ def test_always_present_files(self, bake, options):
6666

6767
def test_conditional_files(self, bake, options):
6868
project = bake(**options)
69-
effective = _effective(options)
69+
effective = resolve_options(options)
7070

7171
if effective["dockerfile"] == "y":
7272
assert project.has_file("Dockerfile")
@@ -96,7 +96,7 @@ def test_conditional_files(self, bake, options):
9696
assert not project.has_dir(".github")
9797

9898
def test_layout(self, bake, options):
99-
effective = _effective(options)
99+
effective = resolve_options(options)
100100
project = bake(**options)
101101
if effective["layout"] == "src":
102102
assert project.has_dir("src/example_project")
@@ -106,7 +106,7 @@ def test_layout(self, bake, options):
106106
assert not project.has_dir("src")
107107

108108
def test_release_workflow(self, bake, options):
109-
effective = _effective(options)
109+
effective = resolve_options(options)
110110
project = bake(**options)
111111
if effective["include_github_actions"] != "y":
112112
return # no .github at all
@@ -118,13 +118,13 @@ def test_release_workflow(self, bake, options):
118118
assert not project.has_file(workflow), "Expected release workflow to be absent"
119119

120120
def test_yaml_validity(self, bake, options):
121-
effective = _effective(options)
121+
effective = resolve_options(options)
122122
project = bake(**options)
123123
if effective["include_github_actions"] == "y":
124124
assert project.is_valid_yaml(".github/workflows/main.yml")
125125

126126
def test_pyproject_type_checker(self, bake, options):
127-
effective = _effective(options)
127+
effective = resolve_options(options)
128128
project = bake(**options)
129129
content = project.read_file("pyproject.toml")
130130
if effective["type_checker"] == "mypy":
@@ -135,7 +135,7 @@ def test_pyproject_type_checker(self, bake, options):
135135
assert '"mypy' not in content
136136

137137
def test_makefile_targets(self, bake, options):
138-
effective = _effective(options)
138+
effective = resolve_options(options)
139139
project = bake(**options)
140140
content = project.read_file("Makefile")
141141

@@ -150,7 +150,7 @@ def test_makefile_targets(self, bake, options):
150150
assert "docs:" not in content
151151

152152
def test_codecov_workflow(self, bake, options):
153-
effective = _effective(options)
153+
effective = resolve_options(options)
154154
project = bake(**options)
155155
if effective["include_github_actions"] == "y":
156156
if effective["codecov"] == "y":

0 commit comments

Comments
 (0)