| 166 | assert option.hello == "x" |
| 167 | |
| 168 | def test_parse_set_options(self, parser: parseopt.Parser) -> None: |
| 169 | parser.addoption("--hello", dest="hello", action="store") |
| 170 | parser.addoption("--world", dest="world", default=42) |
| 171 | |
| 172 | option = argparse.Namespace() |
| 173 | parser.parse(["--hello", "world"], option) |
| 174 | assert option.hello == "world" |
| 175 | assert option.world == 42 |
| 176 | assert getattr(option, parseopt.FILE_OR_DIR) == [] |
| 177 | |
| 178 | def test_parse_special_destination(self, parser: parseopt.Parser) -> None: |
| 179 | parser.addoption("--ultimate-answer", type=int) |