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

Class ConfigValue

src/_pytest/config/findpaths.py:23–40  ·  view source on GitHub ↗

Represents a configuration value with its origin and parsing mode. This allows tracking whether a value came from a configuration file or from a CLI override (--override-ini), which is important for determining precedence when dealing with ini option aliases. The mode tracks the pa

Source from the content-addressed store, hash-verified

21
22@dataclass(frozen=True)
23class ConfigValue:
24 """Represents a configuration value with its origin and parsing mode.
25
26 This allows tracking whether a value came from a configuration file
27 or from a CLI override (--override-ini), which is important for
28 determining precedence when dealing with ini option aliases.
29
30 The mode tracks the parsing mode/data model used for the value:
31 - "ini": from INI files or [tool.pytest.ini_options], where the only
32 supported value types are `str` or `list[str]`.
33 - "toml": from TOML files (not in INI mode), where native TOML types
34 are preserved.
35 """
36
37 value: object
38 _: KW_ONLY
39 origin: Literal["file", "override"]
40 mode: Literal["ini", "toml"]
41
42
43ConfigDict: TypeAlias = dict[str, ConfigValue]

Callers 14

test_inifilenameMethod · 0.90
test_with_iniMethod · 0.90
test_pytest_iniMethod · 0.90
test_custom_iniMethod · 0.90
test_valid_cfg_fileMethod · 0.90
test_valid_toml_fileMethod · 0.90
__setitem__Method · 0.85

Calls

no outgoing calls

Tested by 11

test_inifilenameMethod · 0.72
test_with_iniMethod · 0.72
test_pytest_iniMethod · 0.72
test_custom_iniMethod · 0.72
test_valid_cfg_fileMethod · 0.72
test_valid_toml_fileMethod · 0.72