mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-21 02:19:59 +08:00
e2dc87aa2b
* Fix + test * Fix test * Rename demo file * Delete unused demo * Refactor into independent demos * change (#2059) * Remove chatbot Co-authored-by: aliabid94 <aabid94@gmail.com>
35 lines
749 B
Python
35 lines
749 B
Python
import inspect
|
|
import pathlib
|
|
|
|
import pytest
|
|
|
|
import gradio as gr
|
|
|
|
|
|
def pytest_configure(config):
|
|
config.addinivalue_line(
|
|
"markers", "flaky: mark test as flaky. Failure will not cause te"
|
|
)
|
|
|
|
|
|
@pytest.fixture
|
|
def test_file_dir():
|
|
return pathlib.Path(pathlib.Path(__file__).parent, "test_files")
|
|
|
|
|
|
@pytest.fixture
|
|
def io_components():
|
|
classes_to_check = gr.components.IOComponent.__subclasses__()
|
|
subclasses = []
|
|
|
|
while classes_to_check:
|
|
subclass = classes_to_check.pop()
|
|
children = subclass.__subclasses__()
|
|
|
|
if children:
|
|
classes_to_check.extend(children)
|
|
if "value" in inspect.signature(subclass).parameters:
|
|
subclasses.append(subclass)
|
|
|
|
return subclasses
|