MCPcopy Create free account
hub / github.com/pytest-dev/pytest / collect

Method collect

doc/en/example/nonpython/conftest.py:11–17  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

9
10class YamlFile(pytest.File):
11 def collect(self):
12 # We need a yaml parser, e.g. PyYAML.
13 import yaml
14
15 raw = yaml.safe_load(self.path.open())
16 for name, spec in sorted(raw.items()):
17 yield YamlItem.from_parent(self, name=name, spec=spec)
18
19
20class YamlItem(pytest.Item):

Callers

nothing calls this directly

Calls 1

from_parentMethod · 0.45

Tested by

no test coverage detected