| 45 | |
| 46 | @unittest.skip("disabled for now") |
| 47 | def test_cqa_mypy(self): |
| 48 | config_path = PROJECT_ROOT / "pyproject.toml" |
| 49 | if not os.path.exists(config_path): |
| 50 | raise RuntimeError("could not locate pyproject.toml file") |
| 51 | |
| 52 | if not importlib.util.find_spec("mypy"): |
| 53 | raise unittest.SkipTest("mypy is not installed") from None |
| 54 | |
| 55 | try: |
| 56 | subprocess.run( |
| 57 | [ |
| 58 | sys.executable, |
| 59 | "-m", |
| 60 | "mypy", |
| 61 | "--config-file", |
| 62 | config_path, |
| 63 | ], |
| 64 | check=True, |
| 65 | capture_output=True, |
| 66 | cwd=PROJECT_ROOT, |
| 67 | ) |
| 68 | except subprocess.CalledProcessError as ex: |
| 69 | output = ex.stdout.decode() |
| 70 | if ex.stderr: |
| 71 | output += "\n\n" + ex.stderr.decode() |
| 72 | raise AssertionError(f"mypy validation failed:\n{output}") from None |
| 73 | |
| 74 | @unittest.skip("disabled for now") |
| 75 | def test_cqa_pyright(self): |