summaryrefslogtreecommitdiff
path: root/tools/fetch_test.py
diff options
context:
space:
mode:
authorAndy Hayden <andyhayden1@gmail.com>2019-06-08 04:46:57 -0700
committerRyan Dahl <ry@tinyclouds.org>2019-06-08 07:46:57 -0400
commit5960e398ecab914effec821cc6da5f3a091fdb50 (patch)
treebb12c155ef59b725dcc0d7a32b757e47718cdaa1 /tools/fetch_test.py
parent4ea2df6759abf3a99e07fe720987805075c8a18b (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/fetch_test.py')
-rwxr-xr-xtools/fetch_test.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/fetch_test.py b/tools/fetch_test.py
index e8c54dfec..b4bf1836c 100755
--- a/tools/fetch_test.py
+++ b/tools/fetch_test.py
@@ -2,20 +2,23 @@
# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import os
import shutil
+import sys
import http_server
from test_util import DenoTestCase, run_tests
from util import mkdtemp, tests_path, run_output
-class FetchTest(DenoTestCase):
+class TestFetch(DenoTestCase):
def test_fetch(self):
deno_dir = mkdtemp()
try:
t = os.path.join(tests_path, "006_url_imports.ts")
- output = run_output([self.deno_exe, "fetch", t],
+ result = run_output([self.deno_exe, "fetch", t],
+ quiet=True,
merge_env={"DENO_DIR": deno_dir})
- assert output == ""
+ self.assertEqual(result.out, "")
+ self.assertEqual(result.code, 0)
# Check that we actually did the prefetch.
os.path.exists(
os.path.join(