aboutsummaryrefslogtreecommitdiff
path: root/tests/test_mypy.py
diff options
context:
space:
mode:
authorMichael J. Sullivan <sully@msully.net>2021-08-03 13:58:42 -0700
committerElvis Pranskevichus <elvis@magic.io>2021-08-03 17:54:57 -0700
commit4a175499500d176c811eeb3aba29c9449f9e40b3 (patch)
treed74c8b6168f72f2d70bca42048d082a4ec890136 /tests/test_mypy.py
parent39f9f0de168b0149456a1aca09ef3f442f436bbf (diff)
downloadimmutables-4a175499500d176c811eeb3aba29c9449f9e40b3.tar.gz
immutables-4a175499500d176c811eeb3aba29c9449f9e40b3.zip
Add in mypy tests
Diffstat (limited to 'tests/test_mypy.py')
-rw-r--r--tests/test_mypy.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_mypy.py b/tests/test_mypy.py
new file mode 100644
index 0000000..48c7f7f
--- /dev/null
+++ b/tests/test_mypy.py
@@ -0,0 +1,23 @@
+import os
+import mypy.test.testcmdline
+from mypy.test.helpers import normalize_error_messages
+
+
+# I'm upset. There's no other way to deal with the little 'defined here'
+# notes that mypy emits when passing an unexpected keyword argument
+# and at no other time.
+def renormalize_error_messages(messages):
+ messages = [x for x in messages if not x.endswith(' defined here')]
+ return normalize_error_messages(messages)
+
+
+mypy.test.testcmdline.normalize_error_messages = renormalize_error_messages
+
+
+this_file_dir = os.path.dirname(os.path.realpath(__file__))
+test_data_prefix = os.path.join(this_file_dir, 'test-data')
+
+
+class ImmuMypyTest(mypy.test.testcmdline.PythonCmdlineSuite):
+ data_prefix = test_data_prefix
+ files = ['check-immu.test']