From 58da83db798c524c0e1d49d2f725d856c1e49084 Mon Sep 17 00:00:00 2001 From: Ali Abid Date: Tue, 15 Jun 2021 10:43:57 -0700 Subject: [PATCH] use cdn static files for unit tests --- gradio/networking.py | 2 +- test/test_demos.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gradio/networking.py b/gradio/networking.py index 05439e355b..6aa5c78c4b 100644 --- a/gradio/networking.py +++ b/gradio/networking.py @@ -130,7 +130,7 @@ def main(): @app.route("/static/", methods=["GET"]) def static_resource(path): - if app.interface.share: + if app.interface.share or os.getenv("GRADIO_TEST_MODE"): return redirect(GRADIO_STATIC_ROOT + path) else: return send_file(os.path.join(STATIC_PATH_LIB, path)) diff --git a/test/test_demos.py b/test/test_demos.py index dbf80f0590..7b809f49c7 100644 --- a/test/test_demos.py +++ b/test/test_demos.py @@ -11,6 +11,7 @@ import random import os current_dir = os.getcwd() +os.environ["GRADIO_TEST_MODE"] = "1" LOCAL_HOST = "http://localhost:{}" GOLDEN_PATH = "test/golden/{}/{}.png"