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
| 21 | |
| 22 | @dataclass(frozen=True) |
| 23 | class 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 | |
| 43 | ConfigDict: TypeAlias = dict[str, ConfigValue] |
no outgoing calls