def test_filter(): col = NamedCollection(*BASIC_DATA) col.filter(lambda x: x['a'] < 2) assert len(col) == 1 col = NamedCollection(*BASIC_DATA, filter=(lambda x: x['a'] < 2,)) assert len(col) == 1