gradio/test
Freddy Boulton 6b63fdec44
Blocked Paths Fix (#10304)
* add code

* add changeset

* Fix test

* empty

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2025-01-08 19:29:39 +00:00
..
components Reset flagged values when switching conversations in chat history (#10292) 2025-01-06 13:59:31 -08:00
golden updated test images 2022-03-17 10:45:48 -07:00
test_files Allow displaying SVG images securely in gr.Image and gr.Gallery components (#10269) 2025-01-06 13:07:13 -08:00
tmp End-to-end UI tests with Selenium (#72) 2020-10-23 18:28:30 +04:00
__init__.py blocks-components-tests 2022-03-30 13:08:34 +03:00
conftest.py 5.0 dev -> main (#8843) 2024-10-08 22:17:17 -07:00
README.md fixed typo (#6896) 2023-12-29 08:17:57 -08:00
requirements.in Fix flaky tests and tests on Windows (#9059) 2024-08-08 01:41:16 -07:00
requirements.txt Update devcontainers (#10146) 2024-12-06 10:08:36 -06:00
test_analytics.py 5.0 dev -> main (#8843) 2024-10-08 22:17:17 -07:00
test_api_info.py Use the modern lower-case Python types in the API typing information (#10196) 2024-12-13 12:10:47 -08:00
test_blocks.py Fixes #9742 (#9767) 2024-10-18 15:48:38 -07:00
test_buttons.py 5.0 dev -> main (#8843) 2024-10-08 22:17:17 -07:00
test_chat_interface.py Add support for returning multiple messages from gr.ChatInterface chat function (#10197) 2024-12-17 14:46:10 -05:00
test_components.py Adding maxlength attribute handling of textarea and input HTML element for the gr.TextBox() component via a max_length parameter (#9185) 2024-08-27 23:42:05 +00:00
test_custom_component_compatibility.py upgrade ruff test dependency to ruff==0.4.1 (#8100) 2024-04-23 09:16:58 -07:00
test_events.py 5.0 dev -> main (#8843) 2024-10-08 22:17:17 -07:00
test_external.py 5.0 dev -> main (#8843) 2024-10-08 22:17:17 -07:00
test_flagging.py 5.0 dev -> main (#8843) 2024-10-08 22:17:17 -07:00
test_gradio_component_cli.py Add ability to read and write from LocalStorage (#9950) 2024-11-15 12:56:36 -08:00
test_helpers.py Fix lazy caching (#10124) 2024-12-04 16:00:28 -06:00
test_http_server.py Extend pyright to cover tests as well (#8856) 2024-07-21 19:55:18 -07:00
test_image_utils.py Allow displaying SVG images securely in gr.Image and gr.Gallery components (#10269) 2025-01-06 13:07:13 -08:00
test_interfaces.py Fix typing for components in gr.Interface and docstring in image.py (#10235) 2024-12-20 19:32:49 -05:00
test_networking.py 5.0 dev -> main (#8843) 2024-10-08 22:17:17 -07:00
test_pipelines.py Extend pyright to cover tests as well (#8856) 2024-07-21 19:55:18 -07:00
test_processing_utils.py Use safehttpx.get() instead of async_get_with_secure_transport() (#9795) 2024-10-23 12:33:13 -07:00
test_queueing.py 5.0 dev -> main (#8843) 2024-10-08 22:17:17 -07:00
test_reload.py 5.0 dev -> main (#8843) 2024-10-08 22:17:17 -07:00
test_routes.py Blocked Paths Fix (#10304) 2025-01-08 19:29:39 +00:00
test_theme_sharing.py Allow mounted Gradio apps to work with external / arbitrary authentication providers (#7557) 2024-03-05 12:41:39 -08:00
test_tunneling.py Version 4 development branch (#5498) 2023-10-31 04:46:02 +00:00
test_utils.py Support saving chat history in gr.ChatInterface (#10191) 2025-01-04 17:42:05 +00:00

Backend Testing Guidelines

  • All the tests should test Backend functionalities. Frontend functionalities and e2e tests are done in Frontend.
  • Make use of pytest fixtures whenever it is possible. With fixtures, objects with high initialize durations are reused within tests, ex. a client session.
  • All testdata resides within _gradio/test_data and all test_files reside within test/test_files.
  • When doing network operations do not forget to make use of async to make tests faster.
  • Have clear class and function naming within the tests.
  • Short descriptions within test functions are great.
  • Library function docstrings is expected to contain an example, please add missing docstrings to the library while you are writing tests the related function.
  • Library docstring examples and descriptions are expected to align with tests, please fix divergent tests and library docstrings.