fix: type bug intruduced in #2492

This now tests the old form too, and fixes the bug introduced.
This commit is contained in:
Henry Fredrick Schreiner
2020-09-16 22:02:09 -04:00
committed by Henry Schreiner
parent dec33c29f2
commit 11f756f5a9
3 changed files with 12 additions and 3 deletions

View File

@@ -45,6 +45,12 @@ def test_type_of_py():
assert m.get_type_of(int) == type
def test_type_of_classic():
assert m.get_type_classic(1) == int
assert m.get_type_classic(m.DerivedClass1()) == m.DerivedClass1
assert m.get_type_classic(int) == type
def test_type_of_py_nodelete():
# If the above test deleted the class, this will segfault
assert m.get_type_of(m.DerivedClass1()) == m.DerivedClass1