Skip to content

example_readme_generator.py crashes at pytest collection time #592

Description

@planetf1

example_readme_generator.py crashes at pytest collection time

Description

docs/examples/aLora/example_readme_generator.py calls generate_readme() at module level (line 6), which internally calls start_session()OllamaModelBackend(). This runs during pytest collection before the # pytest: skip marker is processed, causing:

Exception: could not create OllamaModelBackend: ollama server not running at None

Fix options

  1. Change marker to # pytest: skip_always so it's excluded before import
  2. Wrap the call in if __name__ == "__main__": so it only runs when executed directly

Option 2 is preferred — it follows Python best practices and still allows the example to be run standalone.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions