Skip to content

Commit

Permalink
TST: ensure test datasets are loaded to tmp cache (#76)
Browse files Browse the repository at this point in the history
* TST: ensure test datasets are loaded to tmp cache

* Refine test
  • Loading branch information
hagenw authored Apr 3, 2024
1 parent 03180c3 commit 423b572
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def repository(tmpdir, scope="session"):
def bare_db(
tmpdir,
repository,
audb_cache,
scope="session",
autouse=True,
):
Expand All @@ -76,13 +77,17 @@ def bare_db(

# Publish and load database
audb.publish(db_path, pytest.VERSION, repository)
return audb.load(name, version=pytest.VERSION, verbose=False)
db = audb.load(name, version=pytest.VERSION, verbose=False)
tmp_root = str(tmpdir.parts()[1])
assert db.root.startswith(tmp_root)
return db


@pytest.fixture
def minimal_db(
tmpdir,
repository,
audb_cache,
scope="session",
autouse=True,
):
Expand Down Expand Up @@ -125,13 +130,17 @@ def minimal_db(

# Publish and load database
audb.publish(db_path, pytest.VERSION, repository)
return audb.load(name, version=pytest.VERSION, verbose=False)
db = audb.load(name, version=pytest.VERSION, verbose=False)
tmp_root = str(tmpdir.parts()[1])
assert db.root.startswith(tmp_root)
return db


@pytest.fixture
def medium_db(
tmpdir,
repository,
audb_cache,
scope="session",
autouse=True,
):
Expand Down Expand Up @@ -216,7 +225,10 @@ def medium_db(

# Publish and load database
audb.publish(db_path, pytest.VERSION, repository)
return audb.load(name, version=pytest.VERSION, verbose=False)
db = audb.load(name, version=pytest.VERSION, verbose=False)
tmp_root = str(tmpdir.parts()[1])
assert db.root.startswith(tmp_root)
return db


def create_audio_files(
Expand Down

0 comments on commit 423b572

Please sign in to comment.