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 <abubakar@huggingface.co>
This commit is contained in:
Freddy Boulton 2023-02-28 14:24:07 -05:00 committed by GitHub
parent 04ddce05b3
commit 6242b2700e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

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

View File

@ -886,11 +886,11 @@ def tex2svg(formula, *args):
svg_start = xml_code.index("<svg ")
svg_code = xml_code[svg_start:]
svg_code = re.sub(r"<metadata>.*<\/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"<span style='font-size: 0px'>{formula}</span>"
return f"{copy_code}{svg_code}"

View File

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