aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/skylark/skylint/skylint_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/skylark/skylint/skylint_test.py')
-rw-r--r--src/test/skylark/skylint/skylint_test.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/test/skylark/skylint/skylint_test.py b/src/test/skylark/skylint/skylint_test.py
index eec9a4fd3d..26dba1dc88 100644
--- a/src/test/skylark/skylint/skylint_test.py
+++ b/src/test/skylark/skylint/skylint_test.py
@@ -28,6 +28,7 @@ class SkylintTest(unittest.TestCase):
testenv.SKYLINT_BINARY_PATH,
os.path.join(testenv.SKYLINT_TESTDATA_PATH, "good.bzl.test")
])
+ output = output.decode("utf-8")
self.assertEqual(output, "")
def testBadFile(self):
@@ -38,7 +39,7 @@ class SkylintTest(unittest.TestCase):
os.path.join(testenv.SKYLINT_TESTDATA_PATH, "bad.bzl.test")
])
except subprocess.CalledProcessError as e:
- issues = e.output
+ issues = e.output.decode("utf-8")
self.assertIn("no module docstring", issues)
def testNonexistingFile(self):
@@ -48,7 +49,7 @@ class SkylintTest(unittest.TestCase):
[testenv.SKYLINT_BINARY_PATH, "does_not_exist.bzl"],
stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
- output = e.output
+ output = e.output.decode("utf-8")
self.assertEqual("File not found: does_not_exist.bzl\n", output)
def testDisablingCheck(self):
@@ -56,6 +57,7 @@ class SkylintTest(unittest.TestCase):
testenv.SKYLINT_BINARY_PATH, "--disable-checks=docstring",
os.path.join(testenv.SKYLINT_TESTDATA_PATH, "bad.bzl.test")
])
+ output = output.decode("utf-8")
self.assertEqual(output, "")
def testDisablingCategory(self):
@@ -64,6 +66,7 @@ class SkylintTest(unittest.TestCase):
"--disable-categories=missing-module-docstring",
os.path.join(testenv.SKYLINT_TESTDATA_PATH, "bad.bzl.test")
])
+ output = output.decode("utf-8")
self.assertEqual(output, "")
IMPORT_BZL_CONTENTS = """
@@ -90,7 +93,7 @@ def foo():
os.path.join(temp_dir, "dependencies.bzl")
] + options)
except subprocess.CalledProcessError as e:
- output = e.output
+ output = e.output.decode("utf-8")
return output
finally:
shutil.rmtree(temp_dir)