summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorEric N. Vander Weele <ericvw@gmail.com>2019-10-25 15:01:30 -0400
committerEric N. Vander Weele <ericvw@gmail.com>2019-10-25 17:07:43 -0400
commit7f46990f4b1dcd59e8c593538b37578cbf9f3d77 (patch)
tree898e501034858a3e4271f0f53549f32004d20265 /tests/unit
parenta90200353edb3d605e16e9ea852fe33f22f8d7a6 (diff)
downloadflake8-7f46990f4b1dcd59e8c593538b37578cbf9f3d77.tar.gz
application: Change to `argparse.ArgumentParser` for preliminary parsing
Now that preliminary options are registered with the preliminary parser on the `Application`, leverage that for parsing known options. This important change removes the `Application.option_manager` from being responsible for pre-configuration parsing and the workarounds needed in the `Application.parse_preliminary_options_and_args()` to account for the fact that `Application.option_manager` was aware of *all* options, not just the options necessary for pre-configuration loading. A following commit will address removing these workarounds.
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/test_application.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/unit/test_application.py b/tests/unit/test_application.py
index 09edfe4..15bc54d 100644
--- a/tests/unit/test_application.py
+++ b/tests/unit/test_application.py
@@ -93,9 +93,10 @@ def test_returns_specified_plugin(application):
def test_prelim_opts_args(application):
"""Verify we get sensible prelim opts and args."""
opts, args = application.parse_preliminary_options_and_args(
- ['flake8', '--foo', '--verbose', 'src', 'setup.py', '--statistics'])
+ ['--foo', '--verbose', 'src', 'setup.py', '--statistics'])
- assert opts.statistics
+ assert not hasattr(opts, 'foo')
+ assert not hasattr(opts, 'statistics')
assert opts.verbose
assert args == ['src', 'setup.py']