Skip to content
Snippets Groups Projects
Commit feace540 authored by Sybren A. Stüvel's avatar Sybren A. Stüvel
Browse files

Added MyPy runner to unit tests

parent d004d961
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@ python_version = 3.7
warn_unused_ignores = True
ignore_missing_imports = True
follow_imports = skip
incremental = True
[pep8]
max-line-length = 100
import pathlib
import unittest
import mypy.api
test_modules = ['flamenco_worker', 'tests']
class MypyRunnerTest(unittest.TestCase):
def test_run_mypy(self):
proj_root = pathlib.Path(__file__).parent.parent
args = ['--incremental', '--ignore-missing-imports'] + [str(proj_root / dirname) for dirname
in test_modules]
result = mypy.api.run(args)
stdout, stderr, status = result
messages = []
if stderr:
messages.append(stderr)
if stdout:
messages.append(stdout)
if status:
messages.append('Mypy failed with status %d' % status)
if messages:
self.fail('\n'.join(['Mypy errors:'] + messages))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment