summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2013-12-31 10:06:22 +0100
committerMichael Vogt <mvo@debian.org>2014-01-05 20:04:08 +0100
commit29d9d4270c7a7a1f40faed5a46443b33feb8cf9b (patch)
tree72c3164ac65e918126d9a072a93349c6c003de00 /tests
parent1336dd7de3ce9f48a88cedb2dbe90e54f5c85143 (diff)
downloadpython-apt-29d9d4270c7a7a1f40faed5a46443b33feb8cf9b.tar.gz
make pep8 test part of the unittests
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_pep8.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test_pep8.py b/tests/test_pep8.py
new file mode 100755
index 00000000..e6a672cf
--- /dev/null
+++ b/tests/test_pep8.py
@@ -0,0 +1,27 @@
+import os
+import subprocess
+import unittest
+
+
+class PackagePep8TestCase(unittest.TestCase):
+
+ def test_all_code(self):
+ res = 0
+ py_dir = os.path.join(os.path.dirname(__file__), "..")
+ res += subprocess.call(
+ ["pep8",
+ # disable for now:
+ # E125 continuation line does not distinguish itself from
+ # next logical line
+ # E126 continuation line over-indented for hanging indent
+ # E127 continuation line over-indented for visual indent
+ # E128 continuation line under-indented for visual indent
+ "--ignore=E125,E126,E127,E128",
+ "--exclude", "build,tests/old",
+ "--repeat", py_dir])
+ if res != 0:
+ self.fail("pep8 failed with: %s" % res)
+
+
+if __name__ == "__main__":
+ unittest.main()