gradio/test
pngwn 074ce3805a
ensure the ImageEditor works correctly with layers and change events (#8059)
* stuff

* fix layrs

* add changeset

* lint

* ensure a default image can be passed when sources list is empty

* fix loading status

* add layers option to disable layer ui

* types

* fix tests

* cleanup

* cleanup

* notebooks

* fix composite

* fix

* fix trash icon

* add changeset

* fix layer bg

* fix error display

* notebooks

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-04-18 15:55:00 +00:00
..
golden
test_files Rotate Images to Upright Position in preprocess (#6676) 2023-12-07 13:16:48 -05:00
tmp
__init__.py
conftest.py Delete user state when they close the tab. Add an unload event for the demo and a delete_callback on gr.State to let developers control how resources are cleaned up (#7829) 2024-04-01 18:31:56 -04:00
README.md fixed typo (#6896) 2023-12-29 08:17:57 -08:00
requirements.in Add support for diffuser pipelines in gr.Interface.from_pipeline(). (#7265) 2024-03-08 11:53:38 -08:00
requirements.txt Add an explicit dependency of urllib3~=2.0 and update processing_utils.save_url_to_cache to use urllib3 for Lite support (#8011) 2024-04-14 17:46:55 +00:00
test_analytics.py Update ruff to 0.1.13, enable more rules, fix issues (#7061) 2024-02-01 11:32:40 -08:00
test_api_info.py Add show_api parameter to events, and fix gr.load(). Also makes some minor improvements to the "view API" page when running on Spaces (#6846) 2023-12-22 11:59:02 -08:00
test_blocks.py Adds an "API Recorder" to the view API page, some internal methods have been made async (#7850) 2024-04-03 14:28:06 -07:00
test_buttons.py Allow mounted Gradio apps to work with external / arbitrary authentication providers (#7557) 2024-03-05 12:41:39 -08:00
test_chat_interface.py Add support for lazy caching of examples, as well as add GRADIO_CACHE_EXAMPLES env variable (#7863) 2024-03-29 23:14:33 +00:00
test_components.py ensure the ImageEditor works correctly with layers and change events (#8059) 2024-04-18 15:55:00 +00:00
test_custom_component_compatibility.py Update ruff to 0.1.13, enable more rules, fix issues (#7061) 2024-02-01 11:32:40 -08:00
test_events.py Add concurrency_limit to ChatInterface, add IDE support for concurrency_limit (#6653) 2023-12-04 17:19:53 -05:00
test_external.py Adds support for kwargs and default arguments in the python client, and improves how parameter information is displayed in the "view API" page (#7732) 2024-03-21 17:18:13 -07:00
test_flagging.py Fix flagged files and ensure that flagging_mode="auto" saves output components as well (#7704) 2024-03-14 14:03:34 -07:00
test_gradio_component_cli.py Add --python-path, --pip-path, --gradio-path CLI arguments to let custom component developers control which executable is used (#7638) 2024-03-08 15:01:49 -08:00
test_helpers.py ensure ImageEditor events work as expected (#7845) 2024-04-15 20:16:07 +00:00
test_http_server.py Remove Ruff and Uvicorn in Wasm env (#7744) 2024-03-22 17:32:59 +09:00
test_interfaces.py Adds trigger_mode to gr.on. Use it to set trigger_model="always_last" for live interfaces. (#7794) 2024-03-22 16:00:52 -07:00
test_networking.py Remove Ruff and Uvicorn in Wasm env (#7744) 2024-03-22 17:32:59 +09:00
test_pipelines.py Add support for diffuser pipelines in gr.Interface.from_pipeline(). (#7265) 2024-03-08 11:53:38 -08:00
test_processing_utils.py ensure ImageEditor events work as expected (#7845) 2024-04-15 20:16:07 +00:00
test_queueing.py Python client properly handles hearbeat and log messages. Also handles responses longer than 65k (#6693) 2023-12-13 17:47:06 -05:00
test_reload.py Remove Ruff and Uvicorn in Wasm env (#7744) 2024-03-22 17:32:59 +09:00
test_routes.py Handle the case of multiple headers when constructing root url (#7938) 2024-04-05 02:35:12 +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 Bugfix: .. in filename throwing error while loading in output. (#7795) 2024-03-25 19:27:42 +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.