def build_doctest_call(modulename, testfilename):
    "create method to call doctest on module and module test file"
    s = """
def test():
    "test method tests examples and testfile"
    print '\\n**** %s test ****\\n'
    import doctest
    import %s

    doctest.testmod(%s, verbose=True, report=True)
    print doctest.master.summarize()

    doctest.testfile('%s', verbose=True, report=True)
    print doctest.master.summarize()
    
if __name__ == '__main__':
    test()
""" % (modulename,modulename,modulename,testfilename)
    return s
create method to call doctest on module and module test file
recipes/Python/577652_Unit_Conversions_Using_Decimal/recipe-577652.py