Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fail_example.py #13

Open
shuttle1987 opened this issue Aug 20, 2018 · 0 comments
Open

Fix fail_example.py #13

shuttle1987 opened this issue Aug 20, 2018 · 0 comments
Labels
bug Something isn't working testing

Comments

@shuttle1987
Copy link
Member

shuttle1987 commented Aug 20, 2018

When run outside the test runner you get this:

$ mypy tests/fail/fail_example.py 
tests/fail/fail_example.py:6: error: No overload variant of "int" matches argument type "Dict[Any, Any]"
tests/fail/fail_example.py:6: note: Possible overload variant:
tests/fail/fail_example.py:6: note:     def int(self, x: Union[str, bytes, SupportsInt] = ...) -> int
tests/fail/fail_example.py:6: note:     <1 more non-matching overload not shown>

When run in the test runner the lines starting with "note" cause problems with the tests.

            if "# E:" in target_line:
                marker = target_line.split("# E:")[-1].strip()
                assert lineno in errors, f'Extra error "{marker}"'
                assert marker in errors[lineno]
            else:
>               pytest.fail(f'Error {repr(errors[lineno])} not found')
E               Failed: Error 'tests/fail/fail_example.py:6: note:     def int(self, x: Union[str, unicode, bytearray], base: int = ...) -> int' not found
@shuttle1987 shuttle1987 added bug Something isn't working testing labels Aug 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working testing
Projects
None yet
Development

No branches or pull requests

1 participant