(self)
| 80 | |
| 81 | @unittest.skipIf(sys.platform == "win32", "clean up fails on Windows") |
| 82 | def test_packages_found(self) -> None: |
| 83 | current = os.getcwd() |
| 84 | with tempfile.TemporaryDirectory() as tmp: |
| 85 | try: |
| 86 | os.chdir(tmp) |
| 87 | os.mkdir("pack") |
| 88 | self.make_file("pack", "__init__.py", content="from . import a, b") |
| 89 | self.make_file("pack", "a.py") |
| 90 | self.make_file("pack", "b.py") |
| 91 | opts = parse_options(["-p", "pack"]) |
| 92 | py_mods, pyi_mods, c_mods = collect_build_targets(opts, mypy_options(opts)) |
| 93 | assert_equal(pyi_mods, []) |
| 94 | assert_equal(c_mods, []) |
| 95 | files = {os.path.relpath(mod.path or "FAIL") for mod in py_mods} |
| 96 | assert_equal( |
| 97 | files, |
| 98 | { |
| 99 | os.path.join("pack", "__init__.py"), |
| 100 | os.path.join("pack", "a.py"), |
| 101 | os.path.join("pack", "b.py"), |
| 102 | }, |
| 103 | ) |
| 104 | finally: |
| 105 | os.chdir(current) |
| 106 | |
| 107 | @unittest.skipIf(sys.platform == "win32", "clean up fails on Windows") |
| 108 | def test_module_not_found(self) -> None: |
nothing calls this directly
no test coverage detected