def _test_dedup_int(self, deduped, deduper, key=None):
    'Test filter_unique results for int.'
    if (not key):
        key = passthrough
    self.assertEqual(len(deduped), 0)
    self.assertEqual(next(deduper), 1)
    self.assertEqual(next(deduper), 3)
    if (key in (hash, passthrough)):
        if isinstance(deduped, tools.OrderedDict):
            self.assertEqual(list(deduped.keys()), [1, 3])
        elif isinstance(deduped, collections.Mapping):
            self.assertCountEqual(list(deduped.keys()), [1, 3])
        else:
            self.assertEqual(deduped, set([1, 3]))
    self.assertEqual(next(deduper), 2)
    self.assertEqual(next(deduper), 4)
    if (key in (hash, passthrough)):
        if isinstance(deduped, tools.OrderedDict):
            self.assertEqual(list(deduped.keys()), [1, 3, 2, 4])
        elif isinstance(deduped, collections.Mapping):
            self.assertCountEqual(list(deduped.keys()), [1, 2, 3, 4])
        else:
            self.assertEqual(deduped, set([1, 2, 3, 4]))
    self.assertRaises(StopIteration, next, deduper)
Test filter_unique results for int.
def _test_dedup_int(self, deduped, deduper, key=None):
    
    if (not key):
        key = passthrough
    self.assertEqual(len(deduped), 0)
    self.assertEqual(next(deduper), 1)
    self.assertEqual(next(deduper), 3)
    if (key in (hash, passthrough)):
        if isinstance(deduped, tools.OrderedDict):
            self.assertEqual(list(deduped.keys()), [1, 3])
        elif isinstance(deduped, collections.Mapping):
            self.assertCountEqual(list(deduped.keys()), [1, 3])
        else:
            self.assertEqual(deduped, set([1, 3]))
    self.assertEqual(next(deduper), 2)
    self.assertEqual(next(deduper), 4)
    if (key in (hash, passthrough)):
        if isinstance(deduped, tools.OrderedDict):
            self.assertEqual(list(deduped.keys()), [1, 3, 2, 4])
        elif isinstance(deduped, collections.Mapping):
            self.assertCountEqual(list(deduped.keys()), [1, 2, 3, 4])
        else:
            self.assertEqual(deduped, set([1, 2, 3, 4]))
    self.assertRaises(StopIteration, next, deduper)