Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Convenient message for PEP8TestCase if pep8 is not installed.
  • Loading branch information
Daniel Boczek committed Feb 24, 2012
1 parent bd13421 commit d8a5bea
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/moderation/tests/unit/utils.py
Expand Up @@ -23,11 +23,16 @@ class PEP8TestCase(unittest.TestCase):

def test_pep8_rules(self):
import subprocess

p = subprocess.Popen(
['pep8', '--filename=*.py', '--show-source', '--show-pep8',
'--ignore=W291', '--exclude=migrations', moderation.__path__[0]],
stdout=subprocess.PIPE)
try:
p = subprocess.Popen(
['pep8', '--filename=*.py', '--show-source', '--show-pep8',
'--ignore=W291', '--exclude=migrations',
moderation.__path__[0]], stdout=subprocess.PIPE)
except OSError, e:
self.assertNotEqual(e.errno, 2,
"pep8 command is missing. "
"You can install it with easy_install pep8")
raise
out, err = p.communicate()

self.assertEqual(out, "",
Expand Down

0 comments on commit d8a5bea

Please sign in to comment.