summaryrefslogtreecommitdiff
path: root/testutils.py
diff options
context:
space:
mode:
authorClaudiu Popa <cpopa@cloudbasesolutions.com>2014-11-15 17:21:38 +0200
committerClaudiu Popa <cpopa@cloudbasesolutions.com>2014-11-15 17:21:38 +0200
commit05ffa4a548380f5de416ac398e042a18a729adc9 (patch)
treef23fd524163c39590fbbd2c79b6dd107502cbbb2 /testutils.py
parent769077db8f8674bac1250db6acb201493ba5d2e3 (diff)
downloadpylint-05ffa4a548380f5de416ac398e042a18a729adc9.tar.gz
Move tokenize_str from tests to testutils.
Diffstat (limited to 'testutils.py')
-rw-r--r--testutils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/testutils.py b/testutils.py
index 0b1b967..a892258 100644
--- a/testutils.py
+++ b/testutils.py
@@ -22,6 +22,7 @@ import functools
import sys
import re
import unittest
+import tokenize
from glob import glob
from os import linesep, getcwd, sep
@@ -368,3 +369,6 @@ def make_tests(input_dir, msg_dir, filter_rgx, callbacks):
if test:
tests.append(test)
return tests
+
+def tokenize_str(code):
+ return list(tokenize.generate_tokens(StringIO(code).readline))