Skip to content

Commit

Permalink
Fix backend comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
hagenw committed May 2, 2024
1 parent 2fdb29b commit 0e413fe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ def test_dataset(audb_cache, tmpdir, repository, db, request):
assert dataset.version == pytest.VERSION
assert dataset.repository_object == repository
with backend_interface.backend:
assert dataset.backend == backend_interface
# Compare only string,
# as backends are not identical
assert str(dataset.backend) == str(backend_interface)
expected_header = audb.info.header(
db.name,
version=pytest.VERSION,
Expand Down Expand Up @@ -431,7 +433,9 @@ def test_dataset_cache_loading(audb_cache, tmpdir, repository, db, request):
load_tables=True,
cache_root=audb_cache,
)
assert dataset.backend == backend_interface
# Compare only string representation,
# as objects are not identical
assert str(dataset.backend) == str(backend_interface)
assert dataset.deps == deps
# The dataset header is a not fully loaded `audformat.Database` object,
# so we cannot directly use `audformat.Database.__eq__()`
Expand Down

0 comments on commit 0e413fe

Please sign in to comment.