diff options
author | Commenter123321 <36051603+Commenter123321@users.noreply.github.com> | 2023-10-09 18:02:06 +0200 |
---|---|---|
committer | Commenter123321 <36051603+Commenter123321@users.noreply.github.com> | 2023-10-09 18:02:06 +0200 |
commit | 119817c96349807efaf87ee432ce46446542b66a (patch) | |
tree | 1dbdf4d4dbf4f6c8a8247274ef500a2f1de765d1 /etc/testing/test_providers.py | |
parent | aivvm's no life creator keeps patching it, but I'm just better 😉 (diff) | |
parent | Merge branch 'main' of https://github.com/xtekky/gpt4free (diff) | |
download | gpt4free-119817c96349807efaf87ee432ce46446542b66a.tar gpt4free-119817c96349807efaf87ee432ce46446542b66a.tar.gz gpt4free-119817c96349807efaf87ee432ce46446542b66a.tar.bz2 gpt4free-119817c96349807efaf87ee432ce46446542b66a.tar.lz gpt4free-119817c96349807efaf87ee432ce46446542b66a.tar.xz gpt4free-119817c96349807efaf87ee432ce46446542b66a.tar.zst gpt4free-119817c96349807efaf87ee432ce46446542b66a.zip |
Diffstat (limited to '')
-rw-r--r-- | etc/testing/test_providers.py (renamed from testing/test_providers.py) | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/testing/test_providers.py b/etc/testing/test_providers.py index cd82fe7c..ec0e0271 100644 --- a/testing/test_providers.py +++ b/etc/testing/test_providers.py @@ -33,21 +33,10 @@ def main(): def get_providers() -> list[type[BaseProvider]]: - provider_names = dir(Provider) - ignore_names = [ - "annotations", - "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: @@ -73,4 +62,5 @@ def test(_provider: type[BaseProvider]) -> bool: if __name__ == "__main__": - main()
\ No newline at end of file + main() +
\ No newline at end of file |