def test_check_unique_dups(): lst = list(range(40)) + [39] with assert_raises(ValueError) as cm: check_unique(lst) assert str(cm.exception) == "Duplicates found in list: [(39, 2)]"
def test_check_unique_dups(self): lst = list(range(40)) + [39] with self.assertRaises(ValueError) as context: check_unique(lst) self.assertEqual(str(context.exception), "Duplicates found in list: [(39, 2)]")
def test_check_unique_no_dups(): check_unique(range(40))
def test_check_unique_no_dups(self): # pylint: disable=no-self-use check_unique(range(40))