Add a test that verifies ruff, black, and mypy all pass

This fels good!

Topic: clean_rewrite
This commit is contained in:
Hayk Martiros 2022-12-26 17:28:53 -08:00
parent dc4e2d8d64
commit 6a5f572374
1 changed files with 24 additions and 0 deletions

24
test/linter_test.py Normal file
View File

@ -0,0 +1,24 @@
from pathlib import Path
import subprocess
from .test_case import TestCase
class LinterTest(TestCase):
"""
Test that ruff, black, and mypy run cleanly.
"""
HOME = Path(__file__).parent.parent
def test_ruff(self) -> None:
code = subprocess.check_call(["ruff", str(self.HOME)])
self.assertEqual(code, 0)
def test_black(self) -> None:
code = subprocess.check_call(["black", "--check", str(self.HOME)])
self.assertEqual(code, 0)
def test_mypy(self) -> None:
code = subprocess.check_call(["mypy", str(self.HOME)])
self.assertEqual(code, 0)