def _use_sqlite_cli(self, env):
        test = []
        expected = []
        for line in self._setup + self._code + self._teardown:
            if isinstance(line, interpreter.CodeAnswer):
                expected.extend(line.output)
            elif line.startswith(self.PS1):
                test.append(line[len(self.PS1):])
            elif line.startswith(self.PS2):
                test.append(line[len(self.PS2):])
        test = '\n'.join(test)
        process = subprocess.Popen(['sqlite3'],
                                    universal_newlines=True,
                                    stdin=subprocess.PIPE,
                                    stdout=subprocess.PIPE,
                                    stderr=subprocess.PIPE,
                                    env=env)
        try:
            result, error = process.communicate(test, timeout=self.timeout)
        except subprocess.TimeoutExpired as e:
            process.kill()
            print('# Error: evaluation exceeded {} seconds.'.format(self.timeout))
            raise interpreter.ConsoleException(exceptions.Timeout(self.timeout))
        return test, '\n'.join(expected), (error + '\n' + result).strip()
Pipes the test case into the "sqlite3" executable.
dataset/ETHPy150Open Cal-CS-61A-Staff/ok-client/client/sources/ok_test/sqlite.py/SqliteConsole._use_sqlite_cli