Skip to content

Commit 7a10f98

Browse files
committed
Test attributes() invalid attr_type raises
1 parent d2fc9c8 commit 7a10f98

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

apis/python/tests/test_dataset.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ def test_retrieve_attributes(v3_dataset):
8080
assert v3_dataset.attributes(attr_type="fmt") == fmt_attrs
8181

8282

83+
def test_retrieve_attributes_invalid_type_raises(v3_dataset):
84+
"""attributes() raises for an unrecognised attr_type.
85+
Note: the implementation uses '% attr_types' where attr_types is a tuple, so
86+
Python raises TypeError instead of the intended ValueError."""
87+
with pytest.raises(TypeError):
88+
v3_dataset.attributes(attr_type="unknown")
89+
90+
8391
def test_retrieve_samples(v3_dataset):
8492
assert v3_dataset.samples() == ["HG00280", "HG01762"]
8593

0 commit comments

Comments
 (0)