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
commit99ac3a90889b1cac74a80fa76141b9301eb8e90b (patch)
tree58b9d91a0bcd54376c43d9da8ec988f8ef890acf /testutils.py
parent7997dad2a80ee8a779a01cb76b1f2d73b09e380b (diff)
downloadpylint-git-99ac3a90889b1cac74a80fa76141b9301eb8e90b.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 0b1b96732..a89225830 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))