Add more docstrings and fix lint errors

This commit is contained in:
Ian Cordasco 2016-01-10 14:47:06 -06:00
parent 5903576732
commit 8c872c4bb9
9 changed files with 13 additions and 0 deletions

View file

@ -1,3 +1,4 @@
"""Packaging logic for Flake8."""
# -*- coding: utf-8 -*-
from __future__ import with_statement
import setuptools
@ -25,6 +26,7 @@ if mock is None:
def get_long_description():
"""Generate a long description from the README and CHANGES files."""
descr = []
for fname in ('README.rst', 'CHANGES.rst'):
with open(fname) as f:

View file

View file

@ -10,6 +10,7 @@ from flake8.options import manager
@pytest.fixture
def optmanager():
"""Generate an OptionManager with simple values."""
return manager.OptionManager(prog='flake8', version='3.0.0a1')

View file

@ -1,7 +1,9 @@
"""Unit tests for the Notifier object."""
import pytest
from flake8 import notifier
class _Listener(object):
def __init__(self, error_code):
self.error_code = error_code
@ -13,8 +15,11 @@ class _Listener(object):
class TestNotifier(object):
"""Notifier unit tests."""
@pytest.fixture(autouse=True)
def setup(self):
"""Set up each TestNotifier instance."""
self.notifier = notifier.Notifier()
self.listener_map = {}

View file

@ -60,5 +60,6 @@ def test_config_name_needs_long_option_name():
def test_dest_is_not_overridden():
"""Show that we do not override custom destinations."""
opt = manager.Option('-s', '--short', dest='something_not_short')
assert opt.dest == 'something_not_short'

View file

@ -9,6 +9,7 @@ from flake8.options import manager
@pytest.fixture
def optmanager():
"""Generate a simple OptionManager with default test arguments."""
return manager.OptionManager(prog='flake8', version='3.0.0b1')

View file

@ -1,3 +1,4 @@
"""Unit test for the _trie module."""
from flake8 import _trie as trie

View file

@ -38,4 +38,5 @@ def test_normalize_path(value, expected):
[os.path.abspath("../" + p) for p in RELATIVE_PATHS]),
])
def test_normalize_paths(value, expected):
"""Verify we normalize comma-separated paths provided to the tool."""
assert utils.normalize_paths(value) == expected

View file

@ -9,4 +9,5 @@ commands =
py.test {posargs}
[flake8]
# Ignore some flake8-docstrings errors
ignore = D203