diff options
author | Andy Hayden <andyhayden1@gmail.com> | 2019-06-08 04:46:57 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-06-08 07:46:57 -0400 |
commit | 5960e398ecab914effec821cc6da5f3a091fdb50 (patch) | |
tree | bb12c155ef59b725dcc0d7a32b757e47718cdaa1 /tools/fmt_test.py | |
parent | 4ea2df6759abf3a99e07fe720987805075c8a18b (diff) |
make tests quieter (#2468)
Don't mix every http request in with the tests output.
Don't print that the file servers are starting unless
-vv flag is passed.
Capture the output of run with run_output which returns
stdout, stderr and exit_code. Test against this rather
than relying on sys.exit.
Diffstat (limited to 'tools/fmt_test.py')
-rwxr-xr-x | tools/fmt_test.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/fmt_test.py b/tools/fmt_test.py index 0be2d2eff..99abb2c9e 100755 --- a/tools/fmt_test.py +++ b/tools/fmt_test.py @@ -4,10 +4,10 @@ import os import shutil from test_util import DenoTestCase, run_tests -from util import mkdtemp, root_path, tests_path, run +from util import mkdtemp, root_path, tests_path, run_output -class FmtTest(DenoTestCase): +class TestFmt(DenoTestCase): def test_fmt(self): d = mkdtemp() try: @@ -26,12 +26,15 @@ class FmtTest(DenoTestCase): # TODO(kt3k) Below can be run([deno_exe, "fmt", dst], ...) # once the following issue is addressed: # https://github.com/denoland/deno_std/issues/330 - run([ + result = run_output([ os.path.join(root_path, self.deno_exe), "fmt", "badly_formatted.js" ], - cwd=d, - merge_env={"DENO_DIR": deno_dir}) + cwd=d, + merge_env={"DENO_DIR": deno_dir}, + exit_on_fail=True, + quiet=True) + self.assertEqual(result.code, 0) with open(fixed_filename) as f: expected = f.read() with open(dst) as f: |