mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-14 08:24:46 +00:00
Reproduce quiet/verbose config problem
This commit is contained in:
parent
01f8824490
commit
98b9946a78
2 changed files with 23 additions and 3 deletions
|
|
@ -7,3 +7,5 @@ exclude =
|
||||||
foo/,
|
foo/,
|
||||||
bar/,
|
bar/,
|
||||||
bogus/
|
bogus/
|
||||||
|
verbose = 2
|
||||||
|
quiet = 1
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,10 @@ def test_parse_cli_config(optmanager):
|
||||||
normalize_paths=True)
|
normalize_paths=True)
|
||||||
optmanager.add_option('--ignore', parse_from_config=True,
|
optmanager.add_option('--ignore', parse_from_config=True,
|
||||||
comma_separated_list=True)
|
comma_separated_list=True)
|
||||||
|
optmanager.add_option('--verbose', parse_from_config=True,
|
||||||
|
action='count')
|
||||||
|
optmanager.add_option('--quiet', parse_from_config=True,
|
||||||
|
action='count')
|
||||||
parser = config.MergedConfigParser(optmanager)
|
parser = config.MergedConfigParser(optmanager)
|
||||||
|
|
||||||
parsed_config = parser.parse_cli_config(
|
parsed_config = parser.parse_cli_config(
|
||||||
|
|
@ -58,7 +62,9 @@ def test_parse_cli_config(optmanager):
|
||||||
os.path.abspath('foo/'),
|
os.path.abspath('foo/'),
|
||||||
os.path.abspath('bar/'),
|
os.path.abspath('bar/'),
|
||||||
os.path.abspath('bogus/'),
|
os.path.abspath('bogus/'),
|
||||||
]
|
],
|
||||||
|
'verbose': 2,
|
||||||
|
'quiet': 1,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -81,6 +87,10 @@ def test_parse_user_config(optmanager):
|
||||||
normalize_paths=True)
|
normalize_paths=True)
|
||||||
optmanager.add_option('--ignore', parse_from_config=True,
|
optmanager.add_option('--ignore', parse_from_config=True,
|
||||||
comma_separated_list=True)
|
comma_separated_list=True)
|
||||||
|
optmanager.add_option('--verbose', parse_from_config=True,
|
||||||
|
action='count')
|
||||||
|
optmanager.add_option('--quiet', parse_from_config=True,
|
||||||
|
action='count')
|
||||||
parser = config.MergedConfigParser(optmanager)
|
parser = config.MergedConfigParser(optmanager)
|
||||||
|
|
||||||
with mock.patch.object(parser.config_finder, 'user_config_file') as usercf:
|
with mock.patch.object(parser.config_finder, 'user_config_file') as usercf:
|
||||||
|
|
@ -93,7 +103,9 @@ def test_parse_user_config(optmanager):
|
||||||
os.path.abspath('foo/'),
|
os.path.abspath('foo/'),
|
||||||
os.path.abspath('bar/'),
|
os.path.abspath('bar/'),
|
||||||
os.path.abspath('bogus/'),
|
os.path.abspath('bogus/'),
|
||||||
]
|
],
|
||||||
|
'verbose': 2,
|
||||||
|
'quiet': 1,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -104,6 +116,10 @@ def test_parse_local_config(optmanager):
|
||||||
normalize_paths=True)
|
normalize_paths=True)
|
||||||
optmanager.add_option('--ignore', parse_from_config=True,
|
optmanager.add_option('--ignore', parse_from_config=True,
|
||||||
comma_separated_list=True)
|
comma_separated_list=True)
|
||||||
|
optmanager.add_option('--verbose', parse_from_config=True,
|
||||||
|
action='count')
|
||||||
|
optmanager.add_option('--quiet', parse_from_config=True,
|
||||||
|
action='count')
|
||||||
parser = config.MergedConfigParser(optmanager)
|
parser = config.MergedConfigParser(optmanager)
|
||||||
config_finder = parser.config_finder
|
config_finder = parser.config_finder
|
||||||
|
|
||||||
|
|
@ -119,7 +135,9 @@ def test_parse_local_config(optmanager):
|
||||||
os.path.abspath('foo/'),
|
os.path.abspath('foo/'),
|
||||||
os.path.abspath('bar/'),
|
os.path.abspath('bar/'),
|
||||||
os.path.abspath('bogus/'),
|
os.path.abspath('bogus/'),
|
||||||
]
|
],
|
||||||
|
'verbose': 2,
|
||||||
|
'quiet': 1,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue