test: prepare test/pseudo-tty/testcfg.py for Python 3
PR-URL: https://github.com/nodejs/node/pull/24791 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
This commit is contained in:
parent
29204f4ebc
commit
6028f70a0a
@ -32,6 +32,11 @@ from os.path import join, exists, basename, isdir
|
|||||||
import re
|
import re
|
||||||
import utils
|
import utils
|
||||||
|
|
||||||
|
try:
|
||||||
|
xrange # Python 2
|
||||||
|
except NameError:
|
||||||
|
xrange = range # Python 3
|
||||||
|
|
||||||
FLAGS_PATTERN = re.compile(r"//\s+Flags:(.*)")
|
FLAGS_PATTERN = re.compile(r"//\s+Flags:(.*)")
|
||||||
|
|
||||||
class TTYTestCase(test.TestCase):
|
class TTYTestCase(test.TestCase):
|
||||||
@ -51,7 +56,7 @@ class TTYTestCase(test.TestCase):
|
|||||||
else: return str.startswith('==') or str.startswith('**')
|
else: return str.startswith('==') or str.startswith('**')
|
||||||
|
|
||||||
def IsFailureOutput(self, output):
|
def IsFailureOutput(self, output):
|
||||||
f = file(self.expected)
|
f = open(self.expected)
|
||||||
# Convert output lines to regexps that we can match
|
# Convert output lines to regexps that we can match
|
||||||
env = { 'basename': basename(self.file) }
|
env = { 'basename': basename(self.file) }
|
||||||
patterns = [ ]
|
patterns = [ ]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user