mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-06 13:06:53 +00:00
Start fleshing out flake8.utils
Add parse_comma_separated_list, normalize_path, and normalize_paths and add logic in OptionManager.parse_args to use the right normalize_path* function based on comma_separated_list value of the option.
This commit is contained in:
parent
ad0200e792
commit
a4042d6d69
3 changed files with 81 additions and 8 deletions
14
tests/unit/test_utils.py
Normal file
14
tests/unit/test_utils.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
"""Tests for flake8's utils module."""
|
||||
import pytest
|
||||
|
||||
from flake8 import utils
|
||||
|
||||
|
||||
@pytest.mark.parametrize("value,expected", [
|
||||
("E123,\n\tW234,\n E206", ["E123", "W234", "E206"]),
|
||||
("E123,W234,E206", ["E123", "W234", "E206"]),
|
||||
(["E123", "W234", "E206"], ["E123", "W234", "E206"]),
|
||||
(["E123", "\n\tW234", "\n E206"], ["E123", "W234", "E206"]),
|
||||
])
|
||||
def test_parse_comma_separated_list(value, expected):
|
||||
assert utils.parse_comma_separated_list(value) == expected
|
||||
Loading…
Add table
Add a link
Reference in a new issue