Skip to content

Commit 7b990b6

Browse files
committed
Add unit test for inheritance builtin type.
1 parent a4ad5cd commit 7b990b6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

mypy/test/teststubgen.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,16 @@ class TestClass(argparse.Action):
710710
assert_equal(output, ['class C(argparse.Action): ...', ])
711711
assert_equal(imports, ['import argparse'])
712712

713+
def test_generate_c_type_inheritance_builtin_type(self) -> None:
714+
class TestClass(type):
715+
pass
716+
output = [] # type: List[str]
717+
imports = [] # type: List[str]
718+
mod = ModuleType('module', '')
719+
generate_c_type_stub(mod, 'C', TestClass, output, imports)
720+
assert_equal(output, ['class C(type): ...', ])
721+
assert_equal(imports, [])
722+
713723
def test_generate_c_type_with_docstring(self) -> None:
714724
class TestClass:
715725
def test(self, arg0: str) -> None:

0 commit comments

Comments
 (0)