You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: restore example collection during directory traversal (#794) (#795)
* fix: restore example collection during directory traversal (#794)
pytest_pycollect_makemodule only fires for files matching python_files
(test_*.py) — return ExampleModule from pytest_collect_file so directory
traversal collects examples.
* fix: require # pytest: marker for example collection (#796)
Examples without a marker are now silently ignored instead of being
collected as tests. Removes spurious marker from helper/helpers.py
and documents opt-in behaviour in AGENTS.md and MARKERS_GUIDE.md.
* docs: expand required Ollama models list in CONTRIBUTING.md
The previous list only covered 4 models (CI subset). Expanded to include
all models needed by examples and tests, grouped by context (CI, examples,
test suite) with a one-liner to pull the lot.
* fix: harden example collection hooks against silent failures
- pytest_pycollect_makemodule: return SkippedFile (not None) for
markerless files, closing the direct-specification bypass
- pytest_collect_file: narrow except to OSError, return None on
failure (exclude) instead of falling through to collect
- Fix stale docstring and comments from the old collection model
* fix: harden collection hooks and add regression test
Address code review findings from PR #795:
- Fix duplicate collection: guard pytest_collect_file with isinitpath()
so directly-specified files defer to pytest_pycollect_makemodule
- Remove dead try/except OSError (_extract_markers_from_file is
self-contained)
- Key examples_to_skip by full path instead of basename to prevent
collisions across subdirectories
- Use file_path.parts instead of str() substring match in
pytest_pycollect_makemodule for correct path filtering
- Add test/test_example_collection.py regression test verifying
support files are excluded, examples are collected, and no
duplicates occur
Signed-off-by: Nigel Jones <nigelgj@ie.ibm.com>
Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
---------
Signed-off-by: Nigel Jones <nigelgj@ie.ibm.com>
Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
Copy file name to clipboardExpand all lines: AGENTS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ Tests use a four-tier granularity system (`unit`, `integration`, `e2e`, `qualita
51
51
52
52
See **[test/MARKERS_GUIDE.md](test/MARKERS_GUIDE.md)** for the full marker reference (tier definitions, backend markers, resource gates, auto-skip logic, common patterns).
53
53
54
-
**Examples in `docs/examples/`**use comment-based markers:
54
+
**Examples in `docs/examples/`**are opt-in — unlike `test/` files (auto-collected, default `unit`), examples require an explicit `# pytest:` comment to be collected. Files without this comment are silently ignored (they won't appear in skip summaries either). This is because examples have variable dependencies and limited setup:
0 commit comments