mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-12 15:44:17 +00:00
Add more docstrings and fix lint errors
This commit is contained in:
parent
5903576732
commit
8c872c4bb9
9 changed files with 13 additions and 0 deletions
2
setup.py
2
setup.py
|
|
@ -1,3 +1,4 @@
|
||||||
|
"""Packaging logic for Flake8."""
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import with_statement
|
from __future__ import with_statement
|
||||||
import setuptools
|
import setuptools
|
||||||
|
|
@ -25,6 +26,7 @@ if mock is None:
|
||||||
|
|
||||||
|
|
||||||
def get_long_description():
|
def get_long_description():
|
||||||
|
"""Generate a long description from the README and CHANGES files."""
|
||||||
descr = []
|
descr = []
|
||||||
for fname in ('README.rst', 'CHANGES.rst'):
|
for fname in ('README.rst', 'CHANGES.rst'):
|
||||||
with open(fname) as f:
|
with open(fname) as f:
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ from flake8.options import manager
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def optmanager():
|
def optmanager():
|
||||||
|
"""Generate an OptionManager with simple values."""
|
||||||
return manager.OptionManager(prog='flake8', version='3.0.0a1')
|
return manager.OptionManager(prog='flake8', version='3.0.0a1')
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
|
"""Unit tests for the Notifier object."""
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from flake8 import notifier
|
from flake8 import notifier
|
||||||
|
|
||||||
|
|
||||||
class _Listener(object):
|
class _Listener(object):
|
||||||
def __init__(self, error_code):
|
def __init__(self, error_code):
|
||||||
self.error_code = error_code
|
self.error_code = error_code
|
||||||
|
|
@ -13,8 +15,11 @@ class _Listener(object):
|
||||||
|
|
||||||
|
|
||||||
class TestNotifier(object):
|
class TestNotifier(object):
|
||||||
|
"""Notifier unit tests."""
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
def setup(self):
|
def setup(self):
|
||||||
|
"""Set up each TestNotifier instance."""
|
||||||
self.notifier = notifier.Notifier()
|
self.notifier = notifier.Notifier()
|
||||||
self.listener_map = {}
|
self.listener_map = {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,5 +60,6 @@ def test_config_name_needs_long_option_name():
|
||||||
|
|
||||||
|
|
||||||
def test_dest_is_not_overridden():
|
def test_dest_is_not_overridden():
|
||||||
|
"""Show that we do not override custom destinations."""
|
||||||
opt = manager.Option('-s', '--short', dest='something_not_short')
|
opt = manager.Option('-s', '--short', dest='something_not_short')
|
||||||
assert opt.dest == 'something_not_short'
|
assert opt.dest == 'something_not_short'
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ from flake8.options import manager
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def optmanager():
|
def optmanager():
|
||||||
|
"""Generate a simple OptionManager with default test arguments."""
|
||||||
return manager.OptionManager(prog='flake8', version='3.0.0b1')
|
return manager.OptionManager(prog='flake8', version='3.0.0b1')
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
"""Unit test for the _trie module."""
|
||||||
from flake8 import _trie as trie
|
from flake8 import _trie as trie
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,4 +38,5 @@ def test_normalize_path(value, expected):
|
||||||
[os.path.abspath("../" + p) for p in RELATIVE_PATHS]),
|
[os.path.abspath("../" + p) for p in RELATIVE_PATHS]),
|
||||||
])
|
])
|
||||||
def test_normalize_paths(value, expected):
|
def test_normalize_paths(value, expected):
|
||||||
|
"""Verify we normalize comma-separated paths provided to the tool."""
|
||||||
assert utils.normalize_paths(value) == expected
|
assert utils.normalize_paths(value) == expected
|
||||||
|
|
|
||||||
1
tox.ini
1
tox.ini
|
|
@ -9,4 +9,5 @@ commands =
|
||||||
py.test {posargs}
|
py.test {posargs}
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
|
# Ignore some flake8-docstrings errors
|
||||||
ignore = D203
|
ignore = D203
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue