From b96e2c314a1e4d80338f49549f5423e155b8e34a Mon Sep 17 00:00:00 2001 From: Esmeralda Gallardo Date: Fri, 24 Feb 2023 15:11:15 -0300 Subject: [PATCH] Minor style changes and removed unnecesary comments --- piker/data/_ahab.py | 7 ++++--- piker/data/elastic.py | 11 ----------- tests/test_databases.py | 10 ++++++---- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/piker/data/_ahab.py b/piker/data/_ahab.py index bb1d451d..39a5b46a 100644 --- a/piker/data/_ahab.py +++ b/piker/data/_ahab.py @@ -139,9 +139,10 @@ class Container: while True: try: logs = self.cntr.logs() - except docker.errors.NotFound: - return False - except docker.errors.APIError: + except ( + docker.errors.NotFound, + docker.errors.APIError + ): return False entries = logs.decode().split('\n') diff --git a/piker/data/elastic.py b/piker/data/elastic.py index a501de4f..43c6afd0 100644 --- a/piker/data/elastic.py +++ b/piker/data/elastic.py @@ -14,22 +14,11 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -''' -``elasticsearch`` integration. - -- client management routines -- ticK data ingest routines -- websocket client for subscribing to write triggers -- todo: tick sequence stream-cloning for testing - -''' from __future__ import annotations from contextlib import asynccontextmanager as acm from pprint import pformat from typing import ( Any, - # Optional, - #Union, TYPE_CHECKING, ) diff --git a/tests/test_databases.py b/tests/test_databases.py index dac64b35..4eb444f3 100644 --- a/tests/test_databases.py +++ b/tests/test_databases.py @@ -9,8 +9,9 @@ from piker.log import get_logger from elasticsearch import Elasticsearch from piker.data import marketstore -def test_marketstore( +def test_marketstore_startup_and_version( open_test_pikerd: AsyncContextManager, + loglevel, ): ''' @@ -24,7 +25,7 @@ def test_marketstore( async with ( open_test_pikerd( - loglevel='info', + loglevel=loglevel, tsdb=True ) as (s, i, pikerd_portal, services), marketstore.get_client() as client @@ -39,8 +40,9 @@ def test_marketstore( trio.run(main) -def test_elasticsearch( +def test_elasticsearch_startup_and_version( open_test_pikerd: AsyncContextManager, + loglevel, ): ''' Verify elasticsearch starts correctly @@ -53,7 +55,7 @@ def test_elasticsearch( port = 19200 async with open_test_pikerd( - loglevel='info', + loglevel=loglevel, es=True ) as (s, i, pikerd_portal, services):