def run_test(self, script, args):
        """
        Run the script and return stdout and stderr flows
        """
        old_cwd = os.getcwd()
        test_dir = os.path.dirname(os.path.dirname(__file__))

        cmd = '%s "%s"' % (sys.executable, script)
        cmd += ''.join([' %s' % arg for arg in args])

        os.chdir(test_dir)
        try:
            from subprocess import Popen, PIPE
            p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)
            stdin, stdout, stderr = (p.stdin, p.stdout, p.stderr)
        except ImportError:
            stdin, stdout, stderr = os.popen3(cmd)
        out, err = stdout.read(), stderr.read()

        os.chdir(old_cwd)

        return out, err
dataset/ETHPy150Open jcbagneris/fms/tests/startfms_tests.py/LauncherTests.run_test/original