diff options
Diffstat (limited to 'Tests/feaLib/lexer_test.py')
-rw-r--r-- | Tests/feaLib/lexer_test.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Tests/feaLib/lexer_test.py b/Tests/feaLib/lexer_test.py index 238552ec..24dc5dba 100644 --- a/Tests/feaLib/lexer_test.py +++ b/Tests/feaLib/lexer_test.py @@ -1,6 +1,7 @@ -from fontTools.misc.py23 import * +from fontTools.misc.py23 import tobytes from fontTools.feaLib.error import FeatureLibError, IncludedFeaNotFound from fontTools.feaLib.lexer import IncludingLexer, Lexer +from io import StringIO import os import shutil import tempfile @@ -184,7 +185,7 @@ class IncludingLexerTest(unittest.TestCase): lambda: list(lexer)) def test_featurefilepath_None(self): - lexer = IncludingLexer(UnicodeIO("# foobar")) + lexer = IncludingLexer(StringIO("# foobar")) self.assertIsNone(lexer.featurefilepath) files = set(loc.file for _, _, loc in lexer) self.assertIn("<features>", files) @@ -196,7 +197,7 @@ class IncludingLexerTest(unittest.TestCase): pos A B -40; } kern; """, encoding="utf-8")) - including = UnicodeIO("include(%s);" % included.name) + including = StringIO("include(%s);" % included.name) try: lexer = IncludingLexer(including) files = set(loc.file for _, _, loc in lexer) @@ -224,7 +225,7 @@ class IncludingLexerTest(unittest.TestCase): # itself have a path, because it was initialized from # an in-memory stream, so it will use the current working # directory to resolve relative include statements - lexer = IncludingLexer(UnicodeIO("include(included.fea);")) + lexer = IncludingLexer(StringIO("include(included.fea);")) files = set(os.path.realpath(loc.file) for _, _, loc in lexer) expected = os.path.realpath(included.name) self.assertIn(expected, files) |