File: test_main_options.py

package info (click to toggle)
python-flake8 7.1.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,212 kB
  • sloc: python: 6,592; sh: 21; makefile: 19
file content (19 lines) | stat: -rw-r--r-- 576 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from __future__ import annotations

from flake8.main import options


def test_stage1_arg_parser():
    stage1_parser = options.stage1_arg_parser()
    opts, args = stage1_parser.parse_known_args(
        ["--foo", "--verbose", "src", "setup.py", "--statistics", "--version"]
    )

    assert opts.verbose
    assert args == ["--foo", "src", "setup.py", "--statistics", "--version"]


def test_stage1_arg_parser_ignores_help():
    stage1_parser = options.stage1_arg_parser()
    _, args = stage1_parser.parse_known_args(["--help", "-h"])
    assert args == ["--help", "-h"]