make local.py work in tests
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user