Skip to content

Commit a0417a9

Browse files
committed
Add type annotations for elasticsearch.
1 parent 54e0d8e commit a0417a9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

elasticsearch/testcontainers/elasticsearch/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class ElasticSearchContainer(DockerContainer):
7272
'8.3.3'
7373
"""
7474

75-
def __init__(self, image="elasticsearch", port_to_expose=9200, **kwargs):
75+
def __init__(self, image="elasticsearch", port_to_expose=9200, **kwargs) -> None:
7676
super(ElasticSearchContainer, self).__init__(image, **kwargs)
7777
self.port_to_expose = port_to_expose
7878
self.with_exposed_ports(self.port_to_expose)
@@ -84,17 +84,17 @@ def __init__(self, image="elasticsearch", port_to_expose=9200, **kwargs):
8484
self.with_env(key, value)
8585

8686
@wait_container_is_ready()
87-
def _connect(self):
87+
def _connect(self) -> None:
8888
res = urllib.request.urlopen(self.get_url())
8989
if res.status != 200:
9090
raise Exception()
9191

92-
def get_url(self):
92+
def get_url(self) -> str:
9393
host = self.get_container_host_ip()
9494
port = self.get_exposed_port(self.port_to_expose)
9595
return 'http://{}:{}'.format(host, port)
9696

97-
def start(self):
97+
def start(self) -> "ElasticSearchContainer":
9898
super().start()
9999
self._connect()
100100
return self

0 commit comments

Comments
 (0)