summaryrefslogtreecommitdiff
path: root/pecan/tests/test_scaffolds.py
diff options
context:
space:
mode:
authorRyan Petrello <lists@ryanpetrello.com>2013-01-08 11:08:56 -0500
committerRyan Petrello <lists@ryanpetrello.com>2013-01-08 11:08:56 -0500
commitf478bd59c5bf4d938c834505c6d10bfac6b81855 (patch)
treea079be941a5b216fd49f2d8ca6d516fd4c949963 /pecan/tests/test_scaffolds.py
parent3843ccbfc1bcd2fb2d893e97db1a63b3dd25f054 (diff)
downloadpecan-f478bd59c5bf4d938c834505c6d10bfac6b81855.tar.gz
Add a test to the scaffold project buildout that ensures pep8 passes.
Diffstat (limited to 'pecan/tests/test_scaffolds.py')
-rw-r--r--pecan/tests/test_scaffolds.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/pecan/tests/test_scaffolds.py b/pecan/tests/test_scaffolds.py
index 0dc916c..de99807 100644
--- a/pecan/tests/test_scaffolds.py
+++ b/pecan/tests/test_scaffolds.py
@@ -322,3 +322,34 @@ class TestTemplateBuilds(unittest.TestCase):
proc.wait()
assert proc.stderr.read().splitlines()[-1].strip() == 'OK'
+
+ @unittest.skipUnless(has_internet(), 'Internet connectivity unavailable.')
+ @unittest.skipUnless(
+ getattr(pecan, '__run_all_tests__', False) is True,
+ 'Skipping (slow). To run, `$ python setup.py test --functional.`'
+ )
+ def test_project_passes_pep8(self):
+ # Install pep8
+ pip_exe = os.path.join(self.install_dir, 'bin', 'pip')
+ proc = subprocess.Popen([
+ pip_exe,
+ 'install',
+ 'pep8'
+ ])
+ proc.wait()
+
+ # Run pep8 on setup.py and the project
+ pep8_exe = os.path.join(self.install_dir, 'bin', 'pep8')
+ proc = subprocess.Popen([
+ pep8_exe,
+ 'setup.py',
+ 'testing123'
+ ],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE
+ )
+ proc.wait()
+
+ # No output == good
+ output = proc.stdout.read()
+ assert output == ''