use cdn static files for unit tests

This commit is contained in:
Ali Abid 2021-06-15 10:43:57 -07:00
parent f7820e8ac3
commit 58da83db79
2 changed files with 2 additions and 1 deletions

View File

@ -130,7 +130,7 @@ def main():
@app.route("/static/<path:path>", 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))

View File

@ -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"