Skip to content

Commit

Permalink
fixing tests?
Browse files Browse the repository at this point in the history
  • Loading branch information
kylemann16 committed May 13, 2024
1 parent 207c3d9 commit bfbe25d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,13 @@ def storage_config(tmp_path_factory, bounds, resolution, crs, attrs, metrics) ->
version = svversion)
Storage.create(sc)
yield sc
rmtree(path)

@pytest.fixture(scope='function')
def storage(storage_config):
yield Storage.from_db(storage_config.tdb_dir)

@pytest.fixture(scope='function')
def shatter_config(copc_filepath, storage_config, bounds, date
) -> Generator[ShatterConfig, None, None]:
def shatter_config(copc_filepath, storage_config, bounds, date) -> Generator[ShatterConfig, None, None]:
log = Log('INFO') # INFO
s = ShatterConfig(tdb_dir = storage_config.tdb_dir,
log = log,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from silvimetric.cli import cli
from silvimetric.commands import shatter, info
from silvimetric import ShatterConfig
from silvimetric import ShatterConfig, Storage

class TestCli(object):
def test_cli_init(self, tmp_path_factory, runner, bounds):
Expand Down Expand Up @@ -51,7 +51,7 @@ def test_cli_info(self, tdb_filepath, runner, shatter_config):
res = runner.invoke(cli.cli, args=['-d', tdb_filepath, '--scheduler', 'single-threaded', 'info'])
assert res.exit_code == 0

def test_cli_extract(self, runner, extract_config):
def test_cli_extract(self, runner, extract_config, storage):
atts = ' '.join([f'-a {a.name}' for a in extract_config.attrs])
ms = ' '.join([f'-m {m.name}' for m in extract_config.metrics])
out_dir = extract_config.out_dir
Expand Down

0 comments on commit bfbe25d

Please sign in to comment.