(input: str)
| 77 | |
| 78 | |
| 79 | def run_cmd(input: str) -> tuple[int, str]: |
| 80 | if input[1:].startswith("mypy run --") and "--show-error-codes" not in input: |
| 81 | input += " --hide-error-codes" |
| 82 | if input.startswith("dmypy "): |
| 83 | input = sys.executable + " -m mypy." + input |
| 84 | if input.startswith("mypy "): |
| 85 | input = sys.executable + " -m" + input |
| 86 | env = os.environ.copy() |
| 87 | env["PYTHONPATH"] = PREFIX |
| 88 | try: |
| 89 | output = subprocess.check_output( |
| 90 | input, shell=True, stderr=subprocess.STDOUT, text=True, cwd=test_temp_dir, env=env |
| 91 | ) |
| 92 | return 0, output |
| 93 | except subprocess.CalledProcessError as err: |
| 94 | return err.returncode, err.output |
| 95 | |
| 96 | |
| 97 | class DaemonUtilitySuite(unittest.TestCase): |
no test coverage detected
searching dependent graphs…