flake8/tests/unit/test_setuptools_command.py
Jon Dufresne 88f23594e2 Comply with flake8-import-order
Fixes errors:

  src/flake8/__init__.py:22:1: I202 Additional newline in a section of imports.
  tests/unit/test_setuptools_command.py:4:1: I202 Additional newline in a section of imports.

For src/flake8/__init__.py, simply remove the Python 2.6 workaround.
logging.NullHandler is available on all supported Python versions.
2017-11-26 09:19:04 -08:00

33 lines
795 B
Python

"""Module containing tests for the setuptools command integration."""
import pytest
from setuptools import dist
from flake8.main import setuptools_command
@pytest.fixture
def distribution():
"""Create a setuptools Distribution object."""
return dist.Distribution({
'name': 'foo',
'packages': [
'foo',
'foo.bar',
'foo_biz',
],
})
@pytest.fixture
def command(distribution):
"""Create an instance of Flake8's setuptools command."""
return setuptools_command.Flake8(distribution)
def test_package_files_removes_submodules(command):
"""Verify that we collect all package files."""
package_files = list(command.package_files())
assert sorted(package_files) == [
'foo',
'foo_biz',
]