conftest.py
def workspace(workspace_folder, doctest_namespace):
    """Fill temporary folder for each test."""
    # move data to workspace:
    source = os.path.join(os.path.dirname(inspect.stack()[0][1]), "test", "data")
    if os.path.isdir(workspace_folder):
        shutil.rmtree(workspace_folder)
    shutil.copytree(source, workspace_folder)

    # add content to doctest namespace:
    doctest_namespace["workspace"] = workspace_folder
    doctest_namespace["matlab2cpp"] = matlab2cpp
    doctest_namespace["collection"] = collection

    # change to workspace:
    curdir = os.path.abspath(os.path.curdir)
    os.chdir(workspace_folder)

    yield workspace_folder

    # clean up:
    os.chdir(curdir)
    shutil.rmtree(workspace_folder)
Fill temporary folder for each test.
Fill temporary folder for each test.
Fill temporary folder for each test .
def workspace(workspace_folder, doctest_namespace):
    source = os.path.join(os.path.dirname(inspect.stack()[0][1]), "test", "data")
    if os.path.isdir(workspace_folder):
        shutil.rmtree(workspace_folder)
    shutil.copytree(source, workspace_folder)
    doctest_namespace["workspace"] = workspace_folder
    doctest_namespace["matlab2cpp"] = matlab2cpp
    doctest_namespace["collection"] = collection
    curdir = os.path.abspath(os.path.curdir)
    os.chdir(workspace_folder)
    yield workspace_folder
    os.chdir(curdir)
    shutil.rmtree(workspace_folder)
def workspace ( workspace_folder , doctest_namespace ) : source = os . path . join ( os . path . dirname ( inspect . stack ( ) [ 0 ] [ 1 ] ) , "test" , "data" ) if os . path . isdir ( workspace_folder ) : shutil . rmtree ( workspace_folder ) shutil . copytree ( source , workspace_folder ) doctest_namespace [ "workspace" ] = workspace_folder doctest_namespace [ "matlab2cpp" ] = matlab2cpp doctest_namespace [ "collection" ] = collection curdir = os . path . abspath ( os . path . curdir ) os . chdir ( workspace_folder ) yield workspace_folder os . chdir ( curdir ) shutil . rmtree ( workspace_folder )
Fill temporary folder for each test.
Fill temporary folder for each test .
"""Fill temporary folder for each test.""" # move data to workspace: # add content to doctest namespace: # change to workspace: # clean up:
workspace_folder
doctest_namespace