Find Missing Numbers in an int list
You say 'Doctest'  but then you format them badly with unecessary newlines and you do not actually run the tests.
Your code is much more complex than it should be.
When writing a programme remember that it should be the simplest possible.


The function down below behaves exactly like yours but:


It is 3 lines of code instead of 50.
The doctest is properly formatted so that you can actually run it.
The doctest is actually run when the script is executed as the main file.


:

import doctest

def find_missing(integers_list,start=None,limit=None):
    """
    Given a list of integers and optionally a start and an end, finds all
    the integers from start to end that are not in the list.

    'start' and 'end' default respectivly to the first and the last item of the list.

    Doctest:

    &gt;&gt;&gt; find_missing([1,2,3,5,6,7], 1, 7)
    [4]

    &gt;&gt;&gt; find_missing([2,3,6,4,8], 2, 8)
    [5, 7]

    &gt;&gt;&gt; find_missing([1,2,3,4], 1, 4)
    []

    &gt;&gt;&gt; find_missing([11,1,1,2,3,2,3,2,3,2,4,5,6,7,8,9],1,11)
    [10]

    &gt;&gt;&gt; find_missing([-1,0,1,3,7,20], -1, 7)
    [2, 4, 5, 6]

    &gt;&gt;&gt; find_missing([-2,0,3], -5, 2)
    [-5, -4, -3, -1, 1, 2]

    &gt;&gt;&gt; find_missing([2],4,5)
    [4, 5]

    &gt;&gt;&gt; find_missing([3,5,6,7,8], -3, 5)
    [-3, -2, -1, 0, 1, 2, 4]

    &gt;&gt;&gt; find_missing([1,2,4])
    [3]

    """
    start = start if start is not None else integers_list[0]
    limit = limit if limit is not None else integers_list[-1]
    return [i for i in range(start,limit + 1) if i not in integers_list]


def _test():
    doctest.testmod()

if __name__ == "__main__":
    _test()