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

Method collect

doc/en/example/nonpython/conftest.py:13–19  ·  doc/en/example/nonpython/conftest.py::YamlFile.collect
(self)

Source from the content-addressed store, hash-verified

11
12class YamlFile(pytest.File):
13 def collect(self):
14 class="cm"># We need a yaml parser, e.g. PyYAML.
15 import yaml
16
17 raw = yaml.safe_load(self.path.open(encoding=class="st">"utf-8"))
18 for name, spec in sorted(raw.items()):
19 yield YamlItem.from_parent(self, name=name, spec=spec)
20
21
22class YamlItem(pytest.Item):

Callers

nothing calls this directly

Calls 2

openMethod · 0.80
from_parentMethod · 0.45

Tested by

no test coverage detected