Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
9f8301e9
Commit
9f8301e9
authored
Aug 09, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix test assertions
parent
a15add64
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
10 deletions
+28
-10
tests/run/tp_new.pyx
tests/run/tp_new.pyx
+28
-10
No files found.
tests/run/tp_new.pyx
View file @
9f8301e9
...
@@ -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
(
'//
Simple
CallNode/AttributeNode'
)
@
cython
.
test_assert_path_exists
(
'//
PyMethod
CallNode/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
(
'//
Simple
CallNode/AttributeNode'
)
@
cython
.
test_assert_path_exists
(
'//
PyMethod
CallNode/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
(
'//
Simple
CallNode/AttributeNode'
)
@
cython
.
test_assert_path_exists
(
'//
PyMethod
CallNode/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
(
'//
Simple
CallNode/AttributeNode'
)
@
cython
.
test_assert_path_exists
(
'//
PyMethod
CallNode/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
):
"""
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment