@@ -1090,7 +1090,7 @@ def test_ignore_init_summary(parse_numpy: ParserType, docstring: str) -> None:
1090
1090
],
1091
1091
)
1092
1092
def test_trim_doctest_flags_basic_example (parse_numpy : ParserType , docstring : str ) -> None :
1093
- """Correctly parse_numpy simple example docstrings when `trim_doctest_flags` option is turned on.
1093
+ """Correctly parse simple example docstrings when `trim_doctest_flags` option is turned on.
1094
1094
1095
1095
Parameters:
1096
1096
parse_numpy: Fixture parser.
@@ -1108,7 +1108,7 @@ def test_trim_doctest_flags_basic_example(parse_numpy: ParserType, docstring: st
1108
1108
1109
1109
1110
1110
def test_trim_doctest_flags_multi_example (parse_numpy : ParserType ) -> None :
1111
- """Correctly parse_numpy multiline example docstrings when `trim_doctest_flags` option is turned on.
1111
+ """Correctly parse multiline example docstrings when `trim_doctest_flags` option is turned on.
1112
1112
1113
1113
Parameters:
1114
1114
parse_numpy: Fixture parser.
@@ -1142,3 +1142,20 @@ def test_trim_doctest_flags_multi_example(parse_numpy: ParserType) -> None:
1142
1142
example_str = sections [0 ].value [3 ][1 ]
1143
1143
assert "<BLANKLINE>" not in example_str
1144
1144
assert "\n >>> print(list(range(1, 100)))\n " in example_str
1145
+
1146
+
1147
+ def test_parsing_choices (parse_numpy : ParserType ) -> None :
1148
+ """Correctly parse choices.
1149
+
1150
+ Parameters:
1151
+ parse_numpy: Fixture parser.
1152
+ """
1153
+ docstring = r"""
1154
+ Parameters
1155
+ --------
1156
+ order : {'C', 'F', 'A'}
1157
+ Description of `order`.
1158
+ """
1159
+ sections , warnings = parse_numpy (docstring , trim_doctest_flags = True )
1160
+ assert sections [0 ].value [0 ].annotation == "'C', 'F', 'A'"
1161
+ assert not warnings
0 commit comments