mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-07 13:36:54 +00:00
Add integration tests for prepend-config argument
This commit is contained in:
parent
06d3d25740
commit
dc12f5cc82
3 changed files with 58 additions and 0 deletions
3
tests/fixtures/config_files/append-config.ini
vendored
Normal file
3
tests/fixtures/config_files/append-config.ini
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[flake8]
|
||||
select = W,F
|
||||
max-line-length = 80
|
||||
3
tests/fixtures/config_files/prepend-config.ini
vendored
Normal file
3
tests/fixtures/config_files/prepend-config.ini
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[flake8]
|
||||
select = E,W
|
||||
max-line-length = 78
|
||||
|
|
@ -14,6 +14,8 @@ CLI_SPECIFIED_CONFIG = 'tests/fixtures/config_files/cli-specified.ini'
|
|||
USER_CONFIG = 'tests/fixtures/config_files/user-config.ini'
|
||||
LOCAL_CONFIG = 'tests/fixtures/config_files/local-config.ini'
|
||||
MISSING_CONFIG = 'tests/fixtures/config_files/missing.ini'
|
||||
PREPEND_CONFIG = 'tests/fixtures/config_files/prepend-config.ini'
|
||||
APPEND_CONFIG = 'tests/fixtures/config_files/append-config.ini'
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
|
@ -73,6 +75,56 @@ def mock_config_finder(program='flake8', arguments=[],
|
|||
"ignore": set(defaults.IGNORE),
|
||||
"max_line_length": 79,
|
||||
}),
|
||||
# Correct values with prepend config only
|
||||
({'prepend_configs': [PREPEND_CONFIG]}, {
|
||||
"select": {'E', 'W'},
|
||||
"ignore": set(defaults.IGNORE),
|
||||
"max_line_length": 78,
|
||||
}),
|
||||
# Correct values with append config only
|
||||
({'append_configs': [APPEND_CONFIG]}, {
|
||||
"select": {'W', 'F'},
|
||||
"ignore": set(defaults.IGNORE),
|
||||
"max_line_length": 80,
|
||||
}),
|
||||
# Correct values with user and prepend configs
|
||||
({
|
||||
'user_config': USER_CONFIG,
|
||||
'prepend_configs': [PREPEND_CONFIG]
|
||||
}, {
|
||||
"select": {'E', 'W'},
|
||||
"ignore": ['D203'],
|
||||
"max_line_length": 78,
|
||||
}),
|
||||
# Correct values with prepend and local configs
|
||||
({
|
||||
'prepend_configs': [PREPEND_CONFIG],
|
||||
'local_configs': [LOCAL_CONFIG]
|
||||
}, {
|
||||
"select": {'E', 'W', 'F'},
|
||||
"ignore": set(defaults.IGNORE),
|
||||
"max_line_length": 78,
|
||||
}),
|
||||
# Correct values with prepend and append configs
|
||||
({
|
||||
'prepend_configs': [PREPEND_CONFIG],
|
||||
'append_configs': [APPEND_CONFIG]
|
||||
}, {
|
||||
"select": {'W', 'F'},
|
||||
"ignore": set(defaults.IGNORE),
|
||||
"max_line_length": 80,
|
||||
}),
|
||||
# Correct values with user, append, local and prepend configs
|
||||
({
|
||||
'user_config': USER_CONFIG,
|
||||
'prepend_configs': [PREPEND_CONFIG],
|
||||
'local_configs': [LOCAL_CONFIG],
|
||||
'append_configs': [APPEND_CONFIG],
|
||||
}, {
|
||||
"select": {'W', 'F'},
|
||||
"ignore": ['D203'],
|
||||
"max_line_length": 80,
|
||||
}),
|
||||
])
|
||||
def test_aggregate_options_resulting_values(
|
||||
optmanager, config_finder_params, options_assertions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue