mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-07 05:26:53 +00:00
Merge branch 'keyerror_str' into 'master'
Fix type='str' optparse options See merge request pycqa/flake8!419
This commit is contained in:
commit
809ea30cbc
2 changed files with 4 additions and 0 deletions
|
|
@ -28,6 +28,8 @@ _optparse_callable_map = {
|
||||||
"float": float,
|
"float": float,
|
||||||
"complex": complex,
|
"complex": complex,
|
||||||
"choice": _ARG.NO,
|
"choice": _ARG.NO,
|
||||||
|
# optparse allows this but does not document it
|
||||||
|
"str": str,
|
||||||
} # type: Dict[str, Union[Type[Any], _ARG]]
|
} # type: Dict[str, Union[Type[Any], _ARG]]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -303,6 +303,8 @@ def test_optparse_normalize_callback_option_legacy(optmanager):
|
||||||
('string', 'foo', 'foo'),
|
('string', 'foo', 'foo'),
|
||||||
('float', '1.5', 1.5),
|
('float', '1.5', 1.5),
|
||||||
('complex', '1+5j', 1 + 5j),
|
('complex', '1+5j', 1 + 5j),
|
||||||
|
# optparse allows this but does not document it
|
||||||
|
('str', 'foo', 'foo'),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
def test_optparse_normalize_types(optmanager, type_s, input_val, expected):
|
def test_optparse_normalize_types(optmanager, type_s, input_val, expected):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue