Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit 00c7cb3

Browse files
committed
Merge branch 'bug/179' of git://github.com/sigmavirus24/pep257 into sigmavirus24-bug/179
2 parents dbf8d5f + d99705e commit 00c7cb3

File tree

5 files changed

+26
-30
lines changed

5 files changed

+26
-30
lines changed

src/pydocstyle.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,6 @@ class Module(Definition):
151151
module = property(lambda self: self)
152152
all = property(lambda self: self._all)
153153

154-
def __init__(self, *args, **kwargs):
155-
super(Module, self).__init__(*args, **kwargs)
156-
self.name = self.name.lower()
157-
158154
def __str__(self):
159155
return 'at module level'
160156

src/tests/test_cases/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,5 +339,5 @@ def inner_function():
339339
"""Do inner something."""
340340
return 0
341341

342-
expect(__file__.lower() if __file__[-1] != 'c' else __file__[:-1].lower(),
342+
expect(__file__ if __file__[-1] != 'c' else __file__[:-1],
343343
'D100: Missing docstring in public module')

src/tests/test_definitions.py

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -253,26 +253,25 @@ def test_token_stream():
253253
assert stream.line == 1
254254

255255

256-
def test_pep257():
256+
@pytest.mark.parametrize('test_case', [
257+
'test',
258+
'unicode_literals',
259+
'nested_class',
260+
'capitalization',
261+
'comment_after_def_bug',
262+
'multi_line_summary_start',
263+
])
264+
def test_pep257(test_case):
257265
"""Run domain-specific tests from test.py file."""
258-
test_cases = (
259-
'test',
260-
'unicode_literals',
261-
'nested_class',
262-
'capitalization',
263-
'comment_after_def_bug',
264-
'multi_line_summary_start'
265-
)
266-
for test_case in test_cases:
267-
case_module = __import__('test_cases.{0}'.format(test_case),
268-
globals=globals(),
269-
locals=locals(),
270-
fromlist=['expectation'],
271-
level=1)
272-
results = list(check([os.path.join(os.path.dirname(__file__),
273-
'test_cases', test_case + '.py')],
274-
select=set(ErrorRegistry.get_error_codes())))
275-
for error in results:
276-
assert isinstance(error, Error)
277-
results = set([(e.definition.name, e.message) for e in results])
278-
assert case_module.expectation.expected == results
266+
case_module = __import__('test_cases.{0}'.format(test_case),
267+
globals=globals(),
268+
locals=locals(),
269+
fromlist=['expectation'],
270+
level=1)
271+
results = list(check([os.path.join(os.path.dirname(__file__),
272+
'test_cases', test_case + '.py')],
273+
select=set(ErrorRegistry.get_error_codes())))
274+
for error in results:
275+
assert isinstance(error, Error)
276+
results = set([(e.definition.name, e.message) for e in results])
277+
assert case_module.expectation.expected == results

src/tests/test_integration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
__all__ = ()
2222

2323

24-
class TestEnv(object):
24+
class FakeTestEnv(object):
2525
"""An isolated environment where pydocstyle can be run.
2626
2727
Since running pydocstyle as a script is affected by local config files,
@@ -109,7 +109,7 @@ def install_package(request):
109109

110110
@pytest.yield_fixture(scope="function", params=('pydocstyle', 'pep257'))
111111
def env(request):
112-
with TestEnv(request.param) as test_env:
112+
with FakeTestEnv(request.param) as test_env:
113113
yield test_env
114114

115115

@@ -855,7 +855,7 @@ def foo():
855855

856856

857857
def test_pep257_entry_point():
858-
with TestEnv('pep257') as env:
858+
with FakeTestEnv('pep257') as env:
859859
_, err, code = env.invoke()
860860
assert code == 0
861861
assert 'Deprecation Warning' in err, err

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ commands=sphinx-build -b html . _build
2323
pep8ignore =
2424
test.py E701 E704
2525
norecursedirs = docs .tox
26+
addopts = -rw
2627

2728
[pep257]
2829
inherit = false

0 commit comments

Comments
 (0)