diff options
| author | Eric N. Vander Weele <ericvw@gmail.com> | 2019-10-25 15:01:30 -0400 |
|---|---|---|
| committer | Eric N. Vander Weele <ericvw@gmail.com> | 2019-10-25 17:07:43 -0400 |
| commit | a90200353edb3d605e16e9ea852fe33f22f8d7a6 (patch) | |
| tree | f09524ab23f3ee38f457e4d75dfc7c3ebae6fa5f /tests/integration | |
| parent | 1d7558f7da77d67272352d6ab8ca8a476cf80411 (diff) | |
| download | flake8-a90200353edb3d605e16e9ea852fe33f22f8d7a6.tar.gz | |
application: Register preliminary options on a separate argument parser
We introduce a new `ArgumentParser` for registering the preliminary
options to be inherited by the `Application.option_manager`. The next
step will be to use the `Application.prelim_arg_parser` for parsing and
handling preliminary options and arguments.
Note that we prevent the preliminary parser from handling `-h/--help`
and defer to that to the primary parser.
Diffstat (limited to 'tests/integration')
| -rw-r--r-- | tests/integration/test_aggregator.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/integration/test_aggregator.py b/tests/integration/test_aggregator.py index 5af24ef..d2c0133 100644 --- a/tests/integration/test_aggregator.py +++ b/tests/integration/test_aggregator.py @@ -1,4 +1,5 @@ """Test aggregation of config files and command-line options.""" +import argparse import os import pytest @@ -14,11 +15,13 @@ CLI_SPECIFIED_CONFIG = 'tests/fixtures/config_files/cli-specified.ini' @pytest.fixture def optmanager(): """Create a new OptionManager.""" + prelim_parser = argparse.ArgumentParser(add_help=False) + options.register_preliminary_options(prelim_parser) option_manager = manager.OptionManager( prog='flake8', version='3.0.0', + parents=[prelim_parser], ) - options.register_preliminary_options(option_manager) options.register_default_options(option_manager) return option_manager |
