Skip to content

Commit 3906fc2

Browse files
committed
Don't require env vars
1 parent dcfed95 commit 3906fc2

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

test_elasticsearch_serverless/utils.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,7 @@ def es_url() -> str:
3030
"""Grabs an Elasticsearch URL that must be designated via
3131
an environment variable, otherwise raises an exception.
3232
"""
33-
34-
# Try user-supplied URLs before generic localhost ones.
35-
url = os.environ.get("ELASTICSEARCH_URL", None)
36-
if url is None:
37-
raise ValueError("ELASTICSEARCH_URL environment variable is required")
38-
39-
return url
33+
return os.environ.get("ELASTICSEARCH_URL", "http://elastic:changeme@localhost:9200")
4034

4135

4236
def es_version(client) -> Tuple[int, ...]:
@@ -199,9 +193,4 @@ def es_api_key() -> str:
199193
"""
200194
Gets Elasticsearch API key ID and secret from environment variables, raises ValueError if none found
201195
"""
202-
api_key = os.environ.get("ES_API_KEY", None)
203-
204-
if api_key is None:
205-
raise ValueError("ES_API_KEY environment variable is required")
206-
207-
return api_key
196+
return os.environ.get("ES_API_KEY", "abcd1234")

0 commit comments

Comments
 (0)