summaryrefslogtreecommitdiff
path: root/pyflakes/test/test_script.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyflakes/test/test_script.py')
-rw-r--r--pyflakes/test/test_script.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/pyflakes/test/test_script.py b/pyflakes/test/test_script.py
new file mode 100644
index 0000000..2c2a0aa
--- /dev/null
+++ b/pyflakes/test/test_script.py
@@ -0,0 +1,23 @@
+
+"""
+Tests for L{pyflakes.scripts.pyflakes}.
+"""
+
+from twisted.python.filepath import FilePath
+from twisted.trial.unittest import TestCase
+
+from pyflakes.scripts.pyflakes import checkPath
+
+class CheckTests(TestCase):
+ """
+ Tests for L{check} and L{checkPath} which check a file for flakes.
+ """
+ def test_missingTrailingNewline(self):
+ """
+ Source which doesn't end with a newline shouldn't cause any
+ exception to be raised nor an error indicator to be returned by
+ L{check}.
+ """
+ fName = self.mktemp()
+ FilePath(fName).setContent("def foo():\n\tpass\n\t")
+ self.assertFalse(checkPath(fName))