gradio/test
Abubakar Abid 04857bc524
Add allowed_paths, blocked_paths, show_error, and favicon_path parameters to gr.mount_gradio_app (#7734)
* mount

* add params

* routes

* add changeset

* blocks

* fixes

* add changeset

* typo

* typo

* mount

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-19 10:56:20 -07:00
..
golden
test_files
tmp
__init__.py
conftest.py Control which files get moved to cache with gr.set_static_paths (#7618) 2024-03-07 15:39:07 -05:00
README.md
requirements.in Add support for diffuser pipelines in gr.Interface.from_pipeline(). (#7265) 2024-03-08 11:53:38 -08:00
requirements.txt downgrade contourpy (#7650) 2024-03-08 16:11:43 -08: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
test_blocks.py More fixes for gr.load() as well as a tweaking the __str__ and __repr__ methods of components (#7712) 2024-03-15 20:59:46 +00: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
test_components.py Cast button value as string in postprocess (#7733) 2024-03-18 13:37:45 -07: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
test_external.py Files should now be supplied as file(...) in the Client, and some fixes to gr.load() as well (#7575) 2024-03-08 12:29:02 -08: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 Refactor examples so they accept data in the same format as is returned by function, rename .as_example() to .process_example() (#6933) 2024-01-10 16:35:25 -08:00
test_interfaces.py Update ruff to 0.1.13, enable more rules, fix issues (#7061) 2024-02-01 11:32:40 -08:00
test_networking.py
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 Files should now be supplied as file(...) in the Client, and some fixes to gr.load() as well (#7575) 2024-03-08 12:29:02 -08:00
test_queueing.py
test_reload.py
test_routes.py Add allowed_paths, blocked_paths, show_error, and favicon_path parameters to gr.mount_gradio_app (#7734) 2024-03-19 10:56:20 -07: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
test_utils.py Fix the root_url logic for streaming files (#7614) 2024-03-05 15:21:45 -08: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.