Skip to content

Commit 0e56243

Browse files
authored
fix: prevent example collection crash for readme_generator (#596)
* fix: prevent execution of readme_generator during pytest collection (#592) * fix: respect 'skip' marker during example collection
1 parent 3717cf9 commit 0e56243

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

docs/examples/aLora/example_readme_generator.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33

44
from cli.alora.readme_generator import generate_readme, make_readme_jinja_dict
55

6-
generate_readme(
7-
dataset_path="stembolt_failure_dataset.jsonl",
8-
base_model="granite-4.0-micro",
9-
prompt_file=None,
10-
output_path="stembolts_model_readme.md",
11-
name="your-username/stembolts-alora",
12-
hints=None,
13-
)
6+
if __name__ == "__main__":
7+
generate_readme(
8+
dataset_path="stembolt_failure_dataset.jsonl",
9+
base_model="granite-4.0-micro",
10+
prompt_file=None,
11+
output_path="stembolts_model_readme.md",
12+
name="your-username/stembolts-alora",
13+
hints=None,
14+
)

docs/examples/conftest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ def _should_skip_collection(markers):
115115
if "qualitative" in markers and gh_run == 1:
116116
return True, "Skipping qualitative test in CI (CICD=1)"
117117

118+
# Explicitly skip if 'skip' marker is present
119+
if "skip" in markers:
120+
return True, "Example marked with skip marker"
121+
118122
# Skip slow tests if SKIP_SLOW=1 environment variable is set
119123
if "slow" in markers and int(os.environ.get("SKIP_SLOW", 0)) == 1:
120124
return True, "Skipping slow test (SKIP_SLOW=1)"

0 commit comments

Comments
 (0)