Ad
  • Custom User Avatar

    Discovered there's another missing test, when len(integers) < 3, and this is a documented requirement yet there is no test.

    def test6(self):
        print('test6')
        a =  [1,2]
        self.assertEqual(find_outlier(a), None)
    
  • Custom User Avatar

    There appears to be no test for returning None if there is no outlier.

    I created the following and in doing so had to make some code changes to handle a scenario when there is None.

    def test4(self):
        print('test4')
        a = [2, 6, 8, 10, 12]
        self.assertEqual(find_outlier(a), None)
    
    def test5(self):
        print('test5')
        a = [1,3,5,7,9,11]
        self.assertEqual(find_outlier(a), None)
    
  • Custom User Avatar

    this solution seems to break in one of my tests.

    a1 = [121,None,144, 19,161,19,144,19,11]
    a2 = [11 * 11, 121 * 121, 144 * 144, 19 * 19, 161 * 161, 19 * 19, 144 * 144, 19 * 19]
    self.assertFalse(comp(a1,a2))

    and

    a1 = [121,144, 19,161,19,144,19,11]
    a2 = [11 * 11, None]
    self.assertFalse(comp(a1,a2))