Regression tests for #632.
authorRobert Bradshaw <robertwb@math.washington.edu>
Tue, 21 Dec 2010 08:31:05 +0000 (00:31 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Tue, 21 Dec 2010 08:31:05 +0000 (00:31 -0800)
tests/run/isinstance.pyx

index 858f9ab2f60d39971959432171e07fbb35ff9f55..db54a9de3c2ccb274aee46031571cd0e961b4367 100644 (file)
@@ -5,6 +5,8 @@ from cpython.bool cimport bool
 cdef class A:
     pass
 
+cdef an_A = A()
+
 @cython.test_assert_path_exists('//SimpleCallNode//SimpleCallNode')
 @cython.test_fail_if_path_exists('//SimpleCallNode//PythonCapiCallNode',
                                  '//PythonCapiCallNode//SimpleCallNode')
@@ -48,6 +50,11 @@ def test_optimised():
     assert isinstance(complex(), complex)
     assert not isinstance(u"foo", int)
     assert isinstance(A, type)
+    assert isinstance(an_A, A)
+    cdef type typed_type = A
+    assert isinstance(an_A, typed_type)
+    cdef object untyped_type = A
+    assert isinstance(an_A, <type>untyped_type)
     return True
 
 @cython.test_assert_path_exists('//PythonCapiCallNode')