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

Commit d9d5f77

Browse files
committed
Rearranged files.
1 parent bfa9997 commit d9d5f77

File tree

12 files changed

+30
-20
lines changed

12 files changed

+30
-20
lines changed

requirements/tests.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pytest==2.7.2
2+
pytest-pep8
3+
mock

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
from __future__ import with_statement
2+
import os
23
from setuptools import setup
34

45

5-
with open('pep257.py') as f:
6+
with open(os.path.join('src', 'pep257.py')) as f:
67
for line in f:
78
if line.startswith('__version__'):
89
version = eval(line.split('=')[-1])
@@ -25,6 +26,7 @@
2526
'License :: OSI Approved :: MIT License',
2627
],
2728
keywords='PEP 257, pep257, PEP 8, pep8, docstrings',
29+
package_dir={'': 'src'},
2830
py_modules=['pep257'],
29-
scripts=['pep257'],
31+
scripts=['src/pep257'],
3032
)

src/__init__.py

Whitespace-only changes.

pep257 renamed to src/pep257

File renamed without changes.

pep257.py renamed to src/pep257.py

File renamed without changes.

src/tests/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__author__ = 'rachum'

src/tests/test_cases/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__author__ = 'rachum'

test.py renamed to src/tests/test_cases/test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# encoding: utf-8
22
# No docstring, so we can test D100
33
import sys
4+
import os
45

56

67
expected = set([])
@@ -293,4 +294,5 @@ def inner_function():
293294
"""Do inner something."""
294295
return 0
295296

296-
expect('test.py', 'D100: Missing docstring in public module')
297+
expect(__file__ if __file__[-1] != 'c' else __file__[:-1],
298+
'D100: Missing docstring in public module')

test_decorators.py renamed to src/tests/test_decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import textwrap
1212

13-
import pep257
13+
from .. import pep257
1414

1515

1616
class TestParser:

test_definitions.py renamed to src/tests/test_definitions.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
from pep257 import (StringIO, TokenStream, Parser, Error, check,
2-
Module, Class, Method, Function, NestedFunction)
1+
import os
2+
from ..pep257 import (StringIO, TokenStream, Parser, Error, check,
3+
Module, Class, Method, Function, NestedFunction)
34

45

56
_ = type('', (), dict(__repr__=lambda *a: '_', __eq__=lambda *a: True))()
@@ -116,11 +117,10 @@ def test_token_stream():
116117

117118
def test_pep257():
118119
"""Run domain-specific tests from test.py file."""
119-
import test
120-
results = list(check(['test.py']))
120+
from .test_cases import test
121+
results = list(check([os.path.join(os.path.dirname(__file__),
122+
'test_cases', 'test.py')]))
121123
for error in results:
122124
assert isinstance(error, Error)
123125
results = set([(e.definition.name, e.message) for e in results])
124-
print('\nextra: %r' % (results - test.expected))
125-
print('\nmissing: %r' % (test.expected - results))
126126
assert test.expected == results

0 commit comments

Comments
 (0)