def test_obj_id(self):
    'Test filter_unique with objects using id as key, which fails.'
    deduped = set()
    deduper = tools.filter_unique(self.decs, container=deduped, key=id)
    self.assertEqual(len(deduped), 0)
    for _ in self.decs:
        self.assertEqual(id(next(deduper)), deduped.pop())
    self.assertRaises(StopIteration, next, deduper)
    deduper_ids = list(tools.filter_unique(self.decs, key=id))
    self.assertNotEqual(len(deduper_ids), len(set(deduper_ids)))
Test filter_unique with objects using id as key, which fails.
def test_obj_id(self):
    
    deduped = set()
    deduper = tools.filter_unique(self.decs, container=deduped, key=id)
    self.assertEqual(len(deduped), 0)
    for _ in self.decs:
        self.assertEqual(id(next(deduper)), deduped.pop())
    self.assertRaises(StopIteration, next, deduper)
    deduper_ids = list(tools.filter_unique(self.decs, key=id))
    self.assertNotEqual(len(deduper_ids), len(set(deduper_ids)))