X-Git-Url: https://gitweb.fperrin.net/?a=blobdiff_plain;f=quotes%2Ftest_pyflakes.py;fp=quotes%2Ftest_pyflakes.py;h=535c13a07bc2255883a236d685407374610f7bcb;hb=ba8a1a46983d9e26f70a6dab5a2a3aa9ebb5425b;hp=0000000000000000000000000000000000000000;hpb=0a2f1c977154f674843c1fbe63084e7d0599a037;p=djsite.git diff --git a/quotes/test_pyflakes.py b/quotes/test_pyflakes.py new file mode 100644 index 0000000..535c13a --- /dev/null +++ b/quotes/test_pyflakes.py @@ -0,0 +1,22 @@ +from django.test import TestCase + +import pyflakes.api +import os + +class PyflakesTest(TestCase): + def setUp(self): + topdir = os.path.dirname(os.path.realpath(__file__)) + self.pythonfiles = [] + + for folder, subfolders, files in os.walk(topdir): + if 'migrations' in subfolders: + subfolders.remove('migrations') + + for file in files: + if not file.endswith('.py'): + continue + self.pythonfiles += [os.path.join(folder, file)] + + def test_pyflakes(self): + for file in self.pythonfiles: + self.assertEqual(pyflakes.api.checkPath(file), 0)