diff options
Diffstat (limited to 'pyflakes/test/test_api.py')
-rw-r--r-- | pyflakes/test/test_api.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pyflakes/test/test_api.py b/pyflakes/test/test_api.py index 51b0027..a1e0be2 100644 --- a/pyflakes/test/test_api.py +++ b/pyflakes/test/test_api.py @@ -187,6 +187,22 @@ class TestIterSourceCode(TestCase): sorted(iterSourceCode([self.tempdir])), sorted([apath, bpath, cpath])) + def test_shebang(self): + """ + Find Python files that don't end with `.py`, but contain a Python + shebang. + """ + apath = os.path.join(self.tempdir, 'a') + fd = open(apath, 'w') + fd.write('#!/usr/bin/env python\n') + fd.close() + + self.makeEmptyFile('b') + + self.assertEqual( + list(iterSourceCode([self.tempdir])), + list([apath])) + def test_multipleDirectories(self): """ L{iterSourceCode} can be given multiple directories. It will recurse |