MCPcopy Create free account
hub / github.com/livekit/agents / _module_facts

Function _module_facts

tests/conftest.py:90–102  ·  view source on GitHub ↗

Retrieve information about the module without importing it. Cache to avoid redundant filesystem reads.

(path: Path)

Source from the content-addressed store, hash-verified

88
89@cache
90def _module_facts(path: Path) -> _ModuleFacts:
91 """
92 Retrieve information about the module without importing it.
93 Cache to avoid redundant filesystem reads.
94 """
95 try:
96 source = path.read_text(encoding="utf-8")
97 except OSError:
98 return _ModuleFacts(frozenset(), False)
99 return _ModuleFacts(
100 frozenset(_CATEGORY_RE.findall(source)),
101 _HAS_TESTS_RE.search(source) is not None,
102 )
103
104
105def _plural(n: int, noun: str) -> str:

Callers 3

_uncategorized_modulesFunction · 0.85
pytest_configureFunction · 0.85
pytest_ignore_collectFunction · 0.85

Calls 2

_ModuleFactsClass · 0.85
searchMethod · 0.45

Tested by

no test coverage detected