(self)
| 106 | |
| 107 | @unittest.skipIf(sys.platform == "win32", "clean up fails on Windows") |
| 108 | def test_module_not_found(self) -> None: |
| 109 | current = os.getcwd() |
| 110 | captured_output = io.StringIO() |
| 111 | sys.stdout = captured_output |
| 112 | with tempfile.TemporaryDirectory() as tmp: |
| 113 | try: |
| 114 | os.chdir(tmp) |
| 115 | self.make_file(tmp, "mymodule.py", content="import a") |
| 116 | opts = parse_options(["-m", "mymodule"]) |
| 117 | collect_build_targets(opts, mypy_options(opts)) |
| 118 | assert captured_output.getvalue() == "" |
| 119 | finally: |
| 120 | sys.stdout = sys.__stdout__ |
| 121 | os.chdir(current) |
| 122 | |
| 123 | def make_file(self, *path: str, content: str = "") -> None: |
| 124 | file = os.path.join(*path) |
nothing calls this directly
no test coverage detected