Remove support for local client in testing. (#573)
Signed-off-by: dblock <[email protected]>
This commit is contained in:
@@ -32,7 +32,7 @@ from unittest import SkipTest
|
|||||||
from opensearchpy.helpers import test
|
from opensearchpy.helpers import test
|
||||||
from opensearchpy.helpers.test import OpenSearchTestCase as BaseTestCase
|
from opensearchpy.helpers.test import OpenSearchTestCase as BaseTestCase
|
||||||
|
|
||||||
client = None
|
client: Any = None
|
||||||
|
|
||||||
|
|
||||||
def get_client(**kwargs: Any) -> Any:
|
def get_client(**kwargs: Any) -> Any:
|
||||||
@@ -42,18 +42,11 @@ def get_client(**kwargs: Any) -> Any:
|
|||||||
if client is not None and not kwargs:
|
if client is not None and not kwargs:
|
||||||
return client
|
return client
|
||||||
|
|
||||||
# try and locate manual override in the local environment
|
|
||||||
try:
|
try:
|
||||||
from test_opensearchpy.local import get_client as local_get_client
|
new_client = test.get_test_client(**kwargs)
|
||||||
|
except SkipTest:
|
||||||
new_client = local_get_client(**kwargs)
|
client = False
|
||||||
except ImportError:
|
raise
|
||||||
# fallback to using vanilla client
|
|
||||||
try:
|
|
||||||
new_client = test.get_test_client(**kwargs)
|
|
||||||
except SkipTest:
|
|
||||||
client = False
|
|
||||||
raise
|
|
||||||
|
|
||||||
if not kwargs:
|
if not kwargs:
|
||||||
client = new_client
|
client = new_client
|
||||||
|
|||||||
Reference in New Issue
Block a user