'Replace sys.path, for the duration of the test, with the given value.'

def replaceSysPath(self, sysPath):

    originalSysPath = sys.path[:]
    def cleanUpSysPath():
        sys.path[:] = originalSysPath
    self.addCleanup(cleanUpSysPath)
    sys.path[:] = sysPath
