Skip to content

fix(config): raise TypeError when string ini option receives list (_getini_ini) (#14808) - #14872

Closed
harmehak0173 wants to merge 2 commits into
pytest-dev:mainfrom
harmehak0173:fix/issue-14808-config-string-type
Closed

fix(config): raise TypeError when string ini option receives list (_getini_ini) (#14808)#14872
harmehak0173 wants to merge 2 commits into
pytest-dev:mainfrom
harmehak0173:fix/issue-14808-config-string-type

Conversation

@harmehak0173

Copy link
Copy Markdown

Summary of Changes

Fixes #14808 where _getini_ini returns raw list objects for options registered with type="string" without raising TypeError.

  • Updated _getini_ini in src/_pytest/config/__init__.py to check isinstance(value, str) when type == "string", raising a TypeError if a non-string value (e.g. list from TOML) is passed.
  • Added unit test test_getini_string_type_invalid_list in testing/test_config.py.

@RonnyPfannschmidt

Copy link
Copy Markdown
Member

ai dupe ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

_getini_ini: "string" type returns list silently instead of raising TypeError

2 participants