def METHOD_NAME(self, request):
    pythonpath = os.environ.get("PYTHONPATH")
    if pythonpath is None:
        pythonpath = [os.getcwd()]
    else:
        pythonpath = [os.getcwd()] + pythonpath.split(":")
    os.environ["PYTHONPATH"] = ":".join(pythonpath)
    self.tmpdir = TemporaryDirectory(prefix="signac-flow_")
    request.addfinalizer(self.tmpdir.cleanup)
    self.cwd = os.getcwd()
    os.chdir(self.tmpdir.name)
    request.addfinalizer(self.return_to_cwd)