Skip to content

Commit

Permalink
Merge pull request #19 from AspenWeb/pyflakes
Browse files Browse the repository at this point in the history
Pyflakes
  • Loading branch information
chadwhitacre authored Jul 29, 2016
2 parents 0d06227 + 9f94861 commit ce8120b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
11 changes: 10 additions & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
'coverage>=3.7.1',
'cov-core>=1.7',
'py>=1.4.20',
'pyflakes',
'pytest>=2.5.2',
'pytest-cov>=1.6',
]
Expand Down Expand Up @@ -149,14 +150,20 @@ def clean_sphinx():
# Testing
# =======

def pyflakes():
shell(_virt('pyflakes', _dev()), 'aspen/', 'tests/', ignore_status=False, silent=False)


def test():
"""run all tests"""
shell(_virt('py.test', _dev()), 'tests/', ignore_status=True, silent=False)
shell(_virt('py.test', _dev()), 'tests/', ignore_status=False, silent=False)
pyflakes()


def testf():
"""run tests, stopping at the first failure"""
shell(_virt('py.test', _dev()), '-x', 'tests/', ignore_status=True, silent=False)
pyflakes()


def pylint():
Expand All @@ -177,12 +184,14 @@ def test_cov():
'--cov', 'aspen',
'tests/',
ignore_status=False)
pyflakes()


def analyse():
"""run lint and coverage"""
pylint()
test_cov()
pyflakes()
print('done!')


Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from pytest import raises

import aspen.utils # this happens to install the 'repr' error strategy
# Note: importing from `aspen.utils` installs the 'repr' error strategy
from aspen.utils import ascii_dammit, unicode_dammit

GARBAGE = b"\xef\xf9"
Expand Down
2 changes: 2 additions & 0 deletions tests/test_weird.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def test_weirdness():
log("importing a thing")
old = set(sys.path_importer_cache.keys())
import aspen
aspen # shut up pyflakes
now = set(sys.path_importer_cache.keys())
log("diff", now - old)

Expand All @@ -84,6 +85,7 @@ def test_weirdness():
__dump()
try:
import bar
bar # shut up pyflakes
log("succeeded")
except:
log("failed")
Expand Down

0 comments on commit ce8120b

Please sign in to comment.