diff options
author | Tekky <98614666+xtekky@users.noreply.github.com> | 2023-10-04 10:40:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-04 10:40:18 +0200 |
commit | 6eb3fa3e5fa5675363dc09209cf77fba0542a506 (patch) | |
tree | 0ca69953cbf4820667500a195c8f97c5da75c88e /testing/test_providers.py | |
parent | ~ | g4f v-0.1.4.6 `pip install -U g4f` (diff) | |
parent | Sort providers in new dirs (diff) | |
download | gpt4free-6eb3fa3e5fa5675363dc09209cf77fba0542a506.tar gpt4free-6eb3fa3e5fa5675363dc09209cf77fba0542a506.tar.gz gpt4free-6eb3fa3e5fa5675363dc09209cf77fba0542a506.tar.bz2 gpt4free-6eb3fa3e5fa5675363dc09209cf77fba0542a506.tar.lz gpt4free-6eb3fa3e5fa5675363dc09209cf77fba0542a506.tar.xz gpt4free-6eb3fa3e5fa5675363dc09209cf77fba0542a506.tar.zst gpt4free-6eb3fa3e5fa5675363dc09209cf77fba0542a506.zip |
Diffstat (limited to 'testing/test_providers.py')
-rw-r--r-- | testing/test_providers.py | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/testing/test_providers.py b/testing/test_providers.py index d328f730..ec0e0271 100644 --- a/testing/test_providers.py +++ b/testing/test_providers.py @@ -33,22 +33,10 @@ def main(): def get_providers() -> list[type[BaseProvider]]: - provider_names = dir(Provider) - ignore_names = [ - "annotations", - "helper", - "base_provider", - "retry_provider", - "BaseProvider", - "AsyncProvider", - "AsyncGeneratorProvider", - "RetryProvider", - ] - return [ - getattr(Provider, provider_name) - for provider_name in provider_names - if not provider_name.startswith("__") and provider_name not in ignore_names - ] + providers = dir(Provider) + providers = [getattr(Provider, provider) for provider in providers if provider != "RetryProvider"] + providers = [provider for provider in providers if isinstance(provider, type)] + return [provider for provider in providers if issubclass(provider, BaseProvider)] def create_response(_provider: type[BaseProvider]) -> str: |