Commit 9f8301e9 authored by Stefan Behnel's avatar Stefan Behnel

fix test assertions

parent a15add64
...@@ -52,7 +52,10 @@ def test_derived_vtab(): ...@@ -52,7 +52,10 @@ def test_derived_vtab():
# only these can be safely optimised: # only these can be safely optimised:
@cython.test_assert_path_exists('//PythonCapiCallNode') @cython.test_assert_path_exists('//PythonCapiCallNode')
@cython.test_fail_if_path_exists('//SimpleCallNode/AttributeNode') @cython.test_fail_if_path_exists(
'//SimpleCallNode/AttributeNode',
'//PyMethodCallNode',
)
def make_new(): def make_new():
""" """
>>> isinstance(make_new(), MyType) >>> isinstance(make_new(), MyType)
...@@ -63,7 +66,10 @@ def make_new(): ...@@ -63,7 +66,10 @@ def make_new():
return m return m
@cython.test_assert_path_exists('//PythonCapiCallNode') @cython.test_assert_path_exists('//PythonCapiCallNode')
@cython.test_fail_if_path_exists('//SimpleCallNode/AttributeNode') @cython.test_fail_if_path_exists(
'//SimpleCallNode/AttributeNode',
'//PyMethodCallNode',
)
def make_new_typed_target(): def make_new_typed_target():
""" """
>>> isinstance(make_new_typed_target(), MyType) >>> isinstance(make_new_typed_target(), MyType)
...@@ -75,7 +81,10 @@ def make_new_typed_target(): ...@@ -75,7 +81,10 @@ def make_new_typed_target():
return m return m
@cython.test_assert_path_exists('//PythonCapiCallNode') @cython.test_assert_path_exists('//PythonCapiCallNode')
@cython.test_fail_if_path_exists('//SimpleCallNode/AttributeNode') @cython.test_fail_if_path_exists(
'//SimpleCallNode/AttributeNode',
'//PyMethodCallNode',
)
def make_new_with_args(): def make_new_with_args():
""" """
>>> isinstance(make_new_with_args(), MyType) >>> isinstance(make_new_with_args(), MyType)
...@@ -90,7 +99,10 @@ def make_new_with_args(): ...@@ -90,7 +99,10 @@ def make_new_with_args():
return m return m
@cython.test_assert_path_exists('//PythonCapiCallNode') @cython.test_assert_path_exists('//PythonCapiCallNode')
@cython.test_fail_if_path_exists('//SimpleCallNode/AttributeNode') @cython.test_fail_if_path_exists(
'//SimpleCallNode/AttributeNode',
'//PyMethodCallNode',
)
def make_new_with_args_kwargs(): def make_new_with_args_kwargs():
""" """
>>> isinstance(make_new_with_args_kwargs(), MyType) >>> isinstance(make_new_with_args_kwargs(), MyType)
...@@ -105,7 +117,10 @@ def make_new_with_args_kwargs(): ...@@ -105,7 +117,10 @@ def make_new_with_args_kwargs():
return m return m
@cython.test_assert_path_exists('//PythonCapiCallNode') @cython.test_assert_path_exists('//PythonCapiCallNode')
@cython.test_fail_if_path_exists('//SimpleCallNode/AttributeNode') @cython.test_fail_if_path_exists(
'//SimpleCallNode/AttributeNode',
'//PyMethodCallNode',
)
def make_new_builtin(): def make_new_builtin():
""" """
>>> isinstance(make_new_builtin(), tuple) >>> isinstance(make_new_builtin(), tuple)
...@@ -117,7 +132,10 @@ def make_new_builtin(): ...@@ -117,7 +132,10 @@ def make_new_builtin():
return m return m
@cython.test_assert_path_exists('//PythonCapiCallNode') @cython.test_assert_path_exists('//PythonCapiCallNode')
@cython.test_fail_if_path_exists('//SimpleCallNode/AttributeNode') @cython.test_fail_if_path_exists(
'//SimpleCallNode/AttributeNode',
'//PyMethodCallNode',
)
def make_new_none(type t=None): def make_new_none(type t=None):
""" """
>>> make_new_none() # doctest: +ELLIPSIS >>> make_new_none() # doctest: +ELLIPSIS
...@@ -129,7 +147,7 @@ def make_new_none(type t=None): ...@@ -129,7 +147,7 @@ def make_new_none(type t=None):
# these cannot: # these cannot:
@cython.test_assert_path_exists('//SimpleCallNode/AttributeNode') @cython.test_assert_path_exists('//PyMethodCallNode/AttributeNode')
@cython.test_fail_if_path_exists('//PythonCapiCallNode') @cython.test_fail_if_path_exists('//PythonCapiCallNode')
def make_new_pyclass(): def make_new_pyclass():
""" """
...@@ -141,7 +159,7 @@ def make_new_pyclass(): ...@@ -141,7 +159,7 @@ def make_new_pyclass():
m = MyTypeSubClass.__new__(MyTypeSubClass) m = MyTypeSubClass.__new__(MyTypeSubClass)
return m return m
@cython.test_assert_path_exists('//SimpleCallNode/AttributeNode') @cython.test_assert_path_exists('//PyMethodCallNode/AttributeNode')
@cython.test_fail_if_path_exists('//PythonCapiCallNode') @cython.test_fail_if_path_exists('//PythonCapiCallNode')
def make_new_args(type t1=None, type t2=None): def make_new_args(type t1=None, type t2=None):
""" """
...@@ -169,7 +187,7 @@ def make_new_args(type t1=None, type t2=None): ...@@ -169,7 +187,7 @@ def make_new_args(type t1=None, type t2=None):
m = t1.__new__(t2) m = t1.__new__(t2)
return m return m
@cython.test_assert_path_exists('//SimpleCallNode/AttributeNode') @cython.test_assert_path_exists('//PyMethodCallNode/AttributeNode')
@cython.test_fail_if_path_exists('//PythonCapiCallNode') @cython.test_fail_if_path_exists('//PythonCapiCallNode')
def make_new_none_typed(tuple t=None): def make_new_none_typed(tuple t=None):
""" """
...@@ -180,7 +198,7 @@ def make_new_none_typed(tuple t=None): ...@@ -180,7 +198,7 @@ def make_new_none_typed(tuple t=None):
m = t.__new__(t) m = t.__new__(t)
return m return m
@cython.test_assert_path_exists('//SimpleCallNode/AttributeNode') @cython.test_assert_path_exists('//PyMethodCallNode/AttributeNode')
@cython.test_fail_if_path_exists('//PythonCapiCallNode') @cython.test_fail_if_path_exists('//PythonCapiCallNode')
def make_new_untyped(t): def make_new_untyped(t):
""" """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment