diff options
author | 2017-12-20 13:07:11 -0800 | |
---|---|---|
committer | 2017-12-20 13:08:43 -0800 | |
commit | 8a56db3724333c4bf5f0d54e22ffa122c3078b4d (patch) | |
tree | 5ab4df066bad01e6a3d48dbe5f66aa8645615b02 /src/test/skylark/skylint/skylint_test.py | |
parent | ab8ea13d81106aebcfd1c08f4edec198e347c48c (diff) |
Python 3 fixes for skylark tests
RELNOTES: None
PiperOrigin-RevId: 179723648
Diffstat (limited to 'src/test/skylark/skylint/skylint_test.py')
-rw-r--r-- | src/test/skylark/skylint/skylint_test.py | 9 |
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) |