Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

unittest types not being pulled from typeshed#301

@jakebailey

Description

@jakebailey

Simplified case:

importunittestclassSimple(unittest.TestCase): deftest_success(self): self.assertEqual(42, 42) deftest_exception(self): withself.assertRaises(Exception) asem: raiseException

These have typeshed types:

defassertEqual(self, first: Any, second: Any, msg: Any= ...) ->None: ... @overloaddefassertRaises(self, exception: Union[Type[_E], Tuple[Type[_E], ...]], msg: Any= ...) ->_AssertRaisesContext[_E]: ...

But in VSC you see:

image

The parameter types aren't shown for assertEqual, and there are no type hints for em in test_exception (not shown in the screenshot).

Metadata

Metadata

Labels

bugSomething isn't workingduplicateThis issue or pull request already exists

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions