From 6242b2700e481816cb8cfaa9ce403999ded4ad6a Mon Sep 17 00:00:00 2001 From: Freddy Boulton Date: Tue, 28 Feb 2023 14:24:07 -0500 Subject: [PATCH] Fix flaky external test (#3348) * Fix flaky external test * CHANGELOG * Undo accidental diff * Fix flaky external test * CHANGELOG * Undo accidental diff * Remove from changelog * Use bunny file --------- Co-authored-by: Abubakar Abid --- CHANGELOG.md | 4 ++-- gradio/utils.py | 4 ++-- test/test_external.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9bb6aed60..9ed194214d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,8 +54,8 @@ By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3297](https://git - Gradio Status Page by [@aliabd](https://github.com/aliabd) in [PR 3331](https://github.com/gradio-app/gradio/pull/3331) ## Testing and Infrastructure Changes: -* Adds a script to benchmark the performance of the queue and adds some instructions on how to use it. By [@freddyaboulton](https://github.com/freddyaboulton) and [@abidlabs](https://github.com/abidlabs) in [PR 3272](https://github.com/gradio-app/gradio/pull/3272) -* Flaky python tests no longer cancel non-flaky tests by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3344](https://github.com/gradio-app/gradio/pull/3344) +- Adds a script to benchmark the performance of the queue and adds some instructions on how to use it. By [@freddyaboulton](https://github.com/freddyaboulton) and [@abidlabs](https://github.com/abidlabs) in [PR 3272](https://github.com/gradio-app/gradio/pull/3272) +- Flaky python tests no longer cancel non-flaky tests by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3344](https://github.com/gradio-app/gradio/pull/3344) ## Breaking Changes: No changes to highlight. diff --git a/gradio/utils.py b/gradio/utils.py index 705b6d12e3..0e6b626e0d 100644 --- a/gradio/utils.py +++ b/gradio/utils.py @@ -886,11 +886,11 @@ def tex2svg(formula, *args): svg_start = xml_code.index(".*<\/metadata>", "", svg_code, flags=re.DOTALL) - svg_code = re.sub(r' width="[^"]+"', "", svg_code) + svg_code = re.sub(r' width="[^"]+"', '', svg_code) height_match = re.search(r'height="([\d.]+)pt"', svg_code) if height_match: height = float(height_match.group(1)) - new_height = height / FONTSIZE # conversion from pt to em + new_height = height / FONTSIZE # conversion from pt to em svg_code = re.sub(r'height="[\d.]+pt"', f'height="{new_height}em"', svg_code) copy_code = f"{formula}" return f"{copy_code}{svg_code}" diff --git a/test/test_external.py b/test/test_external.py index e70703217b..a3d80813d2 100644 --- a/test/test_external.py +++ b/test/test_external.py @@ -329,7 +329,7 @@ class TestLoadInterface: app, _, _ = io.launch(prevent_thread_lock=True) test_client = TestClient(app) r = test_client.get( - "/proxy=https://gradio-tests-test-loading-examples-private.hf.space/file=/tmp/tmpdd31pyri/Bunnyp0c5zw__.obj" + "/proxy=https://gradio-tests-test-loading-examples-private.hf.space/file=Bunny.obj" ) assert r.status_code == 200