()
| 222 | # from http://stackoverflow.com/a/17981937/398212 - thanks @rkennedy |
| 223 | @contextmanager |
| 224 | def captured_output(): |
| 225 | new_out, new_err = io.StringIO(), io.StringIO() |
| 226 | old_out, old_err = sys.stdout, sys.stderr |
| 227 | try: |
| 228 | sys.stdout, sys.stderr = new_out, new_err |
| 229 | yield sys.stdout, sys.stderr |
| 230 | finally: |
| 231 | sys.stdout, sys.stderr = old_out, old_err |
| 232 | |
| 233 | |
| 234 | def create_repl(**kwargs): |
no outgoing calls
no test coverage detected