diff options
author | Heejin Ahn <aheejin@gmail.com> | 2019-11-22 14:46:09 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-22 14:46:09 -0800 |
commit | 66008703800039e9de7cee83ceab1352857d80ea (patch) | |
tree | 9b55128f587d7ea4083ec1c2361a6237e7b36681 /test/unit/utils.py | |
parent | bf8f36c31c0b8e6213bce840be66937dd6d0f6af (diff) | |
download | binaryen-66008703800039e9de7cee83ceab1352857d80ea.tar.gz binaryen-66008703800039e9de7cee83ceab1352857d80ea.tar.bz2 binaryen-66008703800039e9de7cee83ceab1352857d80ea.zip |
Use package name in imports (NFC) (#2462)
Don't directly import names from shared.py and support.py, and use
prefixes instead. Also this reorders imports based on PEP
recommendation.
Diffstat (limited to 'test/unit/utils.py')
-rw-r--r-- | test/unit/utils.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/test/unit/utils.py b/test/unit/utils.py index 6aa00aa4f..a9bfc3740 100644 --- a/test/unit/utils.py +++ b/test/unit/utils.py @@ -1,15 +1,18 @@ import os import unittest -from scripts.test.shared import WASM_OPT, run_process, options + +from scripts.test import shared class BinaryenTestCase(unittest.TestCase): def input_path(self, filename): - return os.path.join(options.binaryen_test, 'unit', 'input', filename) + return os.path.join(shared.options.binaryen_test, 'unit', 'input', + filename) def roundtrip(self, filename, opts=[]): path = self.input_path(filename) - p = run_process(WASM_OPT + ['-g', '-o', 'a.wasm', path] + opts) + p = shared.run_process(shared.WASM_OPT + ['-g', '-o', 'a.wasm', path] + + opts) self.assertEqual(p.returncode, 0) with open(path, 'rb') as f: with open('a.wasm', 'rb') as g: @@ -17,16 +20,18 @@ class BinaryenTestCase(unittest.TestCase): def disassemble(self, filename): path = self.input_path(filename) - p = run_process(WASM_OPT + ['--print', '-o', os.devnull, path], check=False, - capture_output=True) + p = shared.run_process(shared.WASM_OPT + + ['--print', '-o', os.devnull, path], + check=False, capture_output=True) self.assertEqual(p.returncode, 0) self.assertEqual(p.stderr, '') return p.stdout def check_features(self, filename, features, opts=[]): path = self.input_path(filename) - cmd = WASM_OPT + ['--print-features', '-o', os.devnull, path] + opts - p = run_process(cmd, check=False, capture_output=True) + cmd = shared.WASM_OPT + \ + ['--print-features', '-o', os.devnull, path] + opts + p = shared.run_process(cmd, check=False, capture_output=True) self.assertEqual(p.returncode, 0) self.assertEqual(p.stderr, '') self.assertEqual(p.stdout.split('\n')[:-1], |