Skip to content

Fix fail_example.py #13

@shuttle1987

Description

@shuttle1987

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtesting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions