(monkeypatch: MonkeyPatch)
| 15 | |
| 16 | |
| 17 | def test_parser_const_with_default_none(monkeypatch: MonkeyPatch) -> None: |
| 18 | monkeypatch.setenv("TOX_ALPHA", "2") |
| 19 | parser = ToxParser.base() |
| 20 | parser.add_argument( |
| 21 | "-a", |
| 22 | dest="alpha", |
| 23 | action="store_const", |
| 24 | const=1, |
| 25 | default=None, |
| 26 | help="sum the integers (default: find the max)", |
| 27 | ) |
| 28 | parser.fix_defaults() |
| 29 | |
| 30 | result = parser.parse_args([]) |
| 31 | assert result.alpha == 2 |
| 32 | |
| 33 | |
| 34 | @pytest.mark.parametrize("is_atty", [True, False]) |
nothing calls this directly
no test coverage detected
searching dependent graphs…