def test_has_dataset_fail(): """Test if check works to fail for an empty list.""" obj = [] with pytest.raises(DatasetError) as e: has_dataset(obj, "test", "something") assert "You need to add at least one test dataset" in str(e.value)
def test_has_dataset(): """Test if check works for a non-empty list.""" obj = [5] assert has_dataset(obj, "list", "something")