mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-31 11:16:54 +00:00
Fix finding of local config files.
This commit is contained in:
parent
cead98598a
commit
54a8a551b3
2 changed files with 12 additions and 2 deletions
|
|
@ -131,8 +131,8 @@ class Application(object):
|
|||
pass
|
||||
|
||||
opts, args = self.option_manager.parse_known_args(args)
|
||||
# parse_known_args includes unknown options as args; get rid of them
|
||||
args = [a for a in args if not a.startswith('-')]
|
||||
# parse_known_args includes program name and unknown options as args
|
||||
args = [a for a in args[1:] if not a.startswith('-')]
|
||||
self.prelim_opts, self.prelim_args = opts, args
|
||||
|
||||
def exit(self):
|
||||
|
|
|
|||
|
|
@ -96,3 +96,13 @@ def test_returns_specified_plugin(application):
|
|||
assert execute is application.formatter_for('desired')
|
||||
|
||||
assert warning.called is False
|
||||
|
||||
|
||||
def test_prelim_opts_args(application):
|
||||
"""Verify we get sensible prelim opts and args."""
|
||||
application.parse_preliminary_options_and_args(
|
||||
['flake8', '--foo', '--verbose', 'src', 'setup.py', '--statistics'])
|
||||
|
||||
assert application.prelim_opts.statistics
|
||||
assert application.prelim_opts.verbose
|
||||
assert application.prelim_args == ['src', 'setup.py']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue