(self)
| 156 | self.assertIn(expected, out) |
| 157 | |
| 158 | def test_stdin_loader(self): |
| 159 | # Unfortunately, there's no way to automatically test the fully |
| 160 | # interactive REPL, since that code path only gets executed when |
| 161 | # stdin is an interactive tty. |
| 162 | p = spawn_python() |
| 163 | try: |
| 164 | p.stdin.write(b"print(__loader__)\n") |
| 165 | p.stdin.flush() |
| 166 | finally: |
| 167 | out = kill_python(p) |
| 168 | expected = repr(importlib.machinery.BuiltinImporter).encode("utf-8") |
| 169 | self.assertIn(expected, out) |
| 170 | |
| 171 | @contextlib.contextmanager |
| 172 | def interactive_python(self, separate_stderr=False): |
nothing calls this directly
no test coverage detected