def setup_testdir(name) -> str:
    'Creates a test folder for holding files'
    topdir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'testfiles')
    if (not os.path.exists(topdir)):
        os.mkdir(topdir)
    testdir = os.path.join(topdir, name)
    while os.path.exists(testdir):
        try:
            shutil.rmtree(testdir)
        except:
            print('Waiting a second for test folder to unlock')
            time.sleep(1.0)
    os.mkdir(testdir)
    return testdir
Creates a test folder for holding files
def setup_testdir(name) -> str:
    
    topdir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'testfiles')
    if (not os.path.exists(topdir)):
        os.mkdir(topdir)
    testdir = os.path.join(topdir, name)
    while os.path.exists(testdir):
        try:
            shutil.rmtree(testdir)
        except:
            print('Waiting a second for test folder to unlock')
            time.sleep(1.0)
    os.mkdir(testdir)
    return testdir