def test_automatic_upcasting(): from pybind11_tests import return_class_1, return_class_2, return_class_n, return_none if type(return_class_1()).__name__ != "DerivedClass1": raise AssertionError if type(return_class_2()).__name__ != "DerivedClass2": raise AssertionError if type(return_none()).__name__ != "NoneType": raise AssertionError # Repeat these a few times in a random order to ensure no invalid caching # is applied if type(return_class_n(1)).__name__ != "DerivedClass1": raise AssertionError if type(return_class_n(2)).__name__ != "DerivedClass2": raise AssertionError if type(return_class_n(0)).__name__ != "BaseClass": raise AssertionError if type(return_class_n(2)).__name__ != "DerivedClass2": raise AssertionError if type(return_class_n(2)).__name__ != "DerivedClass2": raise AssertionError if type(return_class_n(0)).__name__ != "BaseClass": raise AssertionError if type(return_class_n(1)).__name__ != "DerivedClass1": raise AssertionError
def test_automatic_upcasting(): from pybind11_tests import return_class_1, return_class_2, return_class_n, return_none assert type(return_class_1()).__name__ == "DerivedClass1" assert type(return_class_2()).__name__ == "DerivedClass2" assert type(return_none()).__name__ == "NoneType" # Repeat these a few times in a random order to ensure no invalid caching is applied assert type(return_class_n(1)).__name__ == "DerivedClass1" assert type(return_class_n(2)).__name__ == "DerivedClass2" assert type(return_class_n(0)).__name__ == "BaseClass" assert type(return_class_n(2)).__name__ == "DerivedClass2" assert type(return_class_n(2)).__name__ == "DerivedClass2" assert type(return_class_n(0)).__name__ == "BaseClass" assert type(return_class_n(1)).__name__ == "DerivedClass1"
def test_automatic_upcasting(): from pybind11_tests import return_class_1, return_class_2, return_class_n, return_none assert type(return_class_1()).__name__ == "DerivedClass1" assert type(return_class_2()).__name__ == "DerivedClass2" assert type(return_none()).__name__ == "NoneType" # Repeat these a few times in a random order to ensure no invalid caching is applied assert type(return_class_n(1)).__name__ == "DerivedClass1" assert type(return_class_n(2)).__name__ == "DerivedClass2" assert type(return_class_n(0)).__name__ == "BaseClass" assert type(return_class_n(2)).__name__ == "DerivedClass2" assert type(return_class_n(2)).__name__ == "DerivedClass2" assert type(return_class_n(0)).__name__ == "BaseClass" assert type(return_class_n(1)).__name__ == "DerivedClass1"
def test_automatic_upcasting(): from pybind11_tests import return_class_1, return_class_2, return_none assert type(return_class_1()).__name__ == "DerivedClass1" assert type(return_class_2()).__name__ == "DerivedClass2" assert type(return_none()).__name__ == "NoneType"