gradio/test/test_documentation.py
Abubakar Abid 010827e211
Refactoring to replace unittests with pytests (#2610)
* replace pytests with unittests

* formatting

* test blocks

* fixed test/blocks

* test components

* working on test components

* test components

* test components almost fixed

* removed unittest

* linting

* fix remaining tests

* lint

* formatting

* changelog
2022-11-08 01:37:55 +01:00

24 lines
669 B
Python

import os
import sys
import pytest
import gradio as gr
os.environ["GRADIO_ANALYTICS_ENABLED"] = "False"
class TestDocumentation:
@pytest.mark.skipif(
sys.version_info < (3, 8),
reason="Docs use features in inspect module not available in py 3.7",
)
def test_website_documentation(self):
documentation = gr.documentation.generate_documentation()
assert len(documentation) > 0
def test_component_api_documentation(self):
for cls in gr.components.IOComponent.__subclasses__():
gr.documentation.document_component_api(cls, "input")
gr.documentation.document_component_api(cls, "output")