MCPcopy
hub / github.com/pytest-dev/pytest / _is_doctest

Function _is_doctest

src/_pytest/doctest.py:148–152  ·  view source on GitHub ↗
(config: Config, path: Path, parent: Collector)

Source from the content-addressed store, hash-verified

146
147
148def _is_doctest(config: Config, path: Path, parent: Collector) -> bool:
149 if path.suffix in (".txt", ".rst") and parent.session.isinitpath(path):
150 return True
151 globs = config.getoption("doctestglob") or ["test*.txt"]
152 return any(fnmatch_ex(glob, path) for glob in globs)
153
154
155def _is_main_py(path: Path) -> bool:

Callers 1

pytest_collect_fileFunction · 0.85

Calls 3

fnmatch_exFunction · 0.90
getoptionMethod · 0.80
isinitpathMethod · 0.45

Tested by

no test coverage detected