Skip to content

Commit

Permalink
coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
bharel committed Nov 25, 2020
1 parent 7f68bb2 commit 1832c9f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions yellowbox/extras/logstash.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def __del__(self):
self._selector.close()
self._rshutdown.close()
self._wshutdown.close()
except AttributeError:
except AttributeError: # pragma: no cover # Hard and pointless to test.
pass

def _create_data_callback(self, sock: socket.socket) -> Callable[[], None]:
Expand Down Expand Up @@ -220,7 +220,7 @@ def start(self: _T, *, retry_spec: None = None) -> _T:
Args:
retry_spec: Ignored.
"""
if retry_spec:
if retry_spec: # pragma: no cover
_logger.warning(f"{self.__class__.__name__} does not support passing "
f"a retry spec.")
self._root.listen()
Expand All @@ -239,7 +239,7 @@ def stop(self) -> None:
return
self._wshutdown.send(_CLOSE_SENTINEL)
self._thread.join(_STOP_TIMEOUT) # Should almost never timeout
if self._thread.is_alive():
if self._thread.is_alive(): # pragma: no cover
raise RuntimeError(f"Failed stopping {self.__class__.__name__}.")

for key in self._selector.get_map().values():
Expand All @@ -256,14 +256,14 @@ def is_alive(self) -> bool:
"""
return self._thread.is_alive()

def connect(self, network: Any) -> List[str]:
def connect(self, network: Any) -> List[str]: # pragma: no cover
"""Does nothing. Conforms to YellowService interface."""
# Logstash service is not docker related. It cannot actually connect to
# the network. However, other containers connected to the network can
# connect to the service with docker's usual host
return [self.container_host]

def disconnect(self, network: Any):
def disconnect(self, network: Any): # pragma: no cover
"""Does nothing. Conforms to YellowService interface."""
pass

Expand Down

0 comments on commit 1832c9f

Please sign in to comment.