Use doctest module instead of assert statement