]> gitweb.fperrin.net Git - djsite.git/blob - quotes/test_pyflakes.py
Add a pyflakes check, and fix the warnings
[djsite.git] / quotes / test_pyflakes.py
1 from django.test import TestCase
2
3 import pyflakes.api
4 import os
5
6 class PyflakesTest(TestCase):
7     def setUp(self):
8         topdir = os.path.dirname(os.path.realpath(__file__))
9         self.pythonfiles = []
10
11         for folder, subfolders, files in os.walk(topdir):
12             if 'migrations' in subfolders:
13                 subfolders.remove('migrations')
14
15             for file in files:
16                 if not file.endswith('.py'):
17                     continue
18                 self.pythonfiles += [os.path.join(folder, file)]
19     
20     def test_pyflakes(self):
21         for file in self.pythonfiles:
22             self.assertEqual(pyflakes.api.checkPath(file), 0)