Skip to content

Commit

Permalink
Chore: This and that
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Oct 10, 2023
1 parent 68f9a7e commit fd4b7be
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions cratedb_toolkit/util/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class DatabaseAdapter:

def __init__(self, dburi: str):
self.dburi = dburi
# TODO: Make `echo=True` configurable.
self.engine = sa.create_engine(self.dburi, echo=False)
self.connection = self.engine.connect()

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ testpaths = [
]
xfail_strict = true
markers = [
"examples",
"slow",
]

Expand Down
4 changes: 3 additions & 1 deletion tests/retention/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright (c) 2023, Crate.io Inc.
# Distributed under the terms of the AGPLv3 license, see LICENSE.
import logging
import typing as t

import pytest
Expand Down Expand Up @@ -33,6 +34,7 @@ def test_setup_brief(caplog, cratedb, settings):
database_url = cratedb.get_connection_url()
runner = CliRunner()

caplog.set_level(logging.ERROR, "sqlalchemy")
result = runner.invoke(
cli,
args=f'setup "{database_url}"',
Expand All @@ -59,7 +61,7 @@ def test_setup_verbose(caplog, cratedb, settings):
assert result.exit_code == 0

assert cratedb.database.table_exists(settings.policy_table.fullname) is True
assert 3 <= len(caplog.records) <= 5
assert 3 <= len(caplog.records) <= 7


def test_setup_dryrun(caplog, cratedb, settings):
Expand Down

0 comments on commit fd4b7be

Please sign in to comment.