make local.py work in tests

This commit is contained in:
Honza Král
2020-01-19 00:02:02 +00:00
parent 415f744b01
commit 8fdf11cc5c
+3 -5
View File
@@ -1,7 +1,5 @@
from elasticsearch.helpers.test import ( from elasticsearch.helpers import test
get_test_client, from elasticsearch.helpers.test import ElasticsearchTestCase as BaseTestCase
ElasticsearchTestCase as BaseTestCase,
)
client = None client = None
@@ -18,7 +16,7 @@ def get_client(**kwargs):
new_client = local_get_client(**kwargs) new_client = local_get_client(**kwargs)
except ImportError: except ImportError:
# fallback to using vanilla client # fallback to using vanilla client
new_client = get_test_client(**kwargs) new_client = test.get_test_client(**kwargs)
if not kwargs: if not kwargs:
client = new_client client = new_client