diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-07-09 09:03:36 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-07-09 09:03:36 +0200 |
commit | e55faf7dd0c13af4c4eaf94ebe0f2ae18799898a (patch) | |
tree | fd372e8d5686185ad06675f0d93dbe2c61ddd7dd /tests/test_mypy.py | |
parent | ca42184b18f521ac84ed98c371528af4ac2640e3 (diff) | |
parent | 9f7f7386c7fe49b249f6dd8c558266ce65e407dd (diff) | |
download | immutables-e55faf7dd0c13af4c4eaf94ebe0f2ae18799898a.tar.gz immutables-e55faf7dd0c13af4c4eaf94ebe0f2ae18799898a.zip |
Update upstream source from tag 'upstream/0.18'
Update to upstream version '0.18'
with Debian dir 4633953086f923825337301a18d98b4bc0c0e8b4
Diffstat (limited to 'tests/test_mypy.py')
-rw-r--r-- | tests/test_mypy.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/test_mypy.py b/tests/test_mypy.py new file mode 100644 index 0000000..fcdc11c --- /dev/null +++ b/tests/test_mypy.py @@ -0,0 +1,26 @@ +import os + +try: + import mypy.test.testcmdline + from mypy.test.helpers import normalize_error_messages +except (ImportError, AssertionError): + if os.environ.get('IMMU_SKIP_MYPY_TESTS'): + pass + else: + raise +else: + # 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'] |