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
91db44ae
Commit
91db44ae
authored
Feb 08, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
patch inspect.isfunction() in pyregr tests to include CyFunction
parent
e1440248
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
runtests.py
runtests.py
+19
-0
No files found.
runtests.py
View file @
91db44ae
...
@@ -87,6 +87,23 @@ EXT_DEP_MODULES = {
...
@@ -87,6 +87,23 @@ EXT_DEP_MODULES = {
'tag:array'
:
'array'
,
'tag:array'
:
'array'
,
}
}
def
patch_inspect_isfunction
():
import
inspect
orig_isfunction
=
inspect
.
isfunction
def
isfunction
(
obj
):
return
orig_isfunction
(
obj
)
or
type
(
obj
).
__name__
==
'cython_function_or_method'
isfunction
.
_orig_isfunction
=
orig_isfunction
inspect
.
isfunction
=
isfunction
def
unpatch_inspect_isfunction
():
import
inspect
try
:
orig_isfunction
=
inspect
.
isfunction
.
_orig_isfunction
except
AttributeError
:
pass
else
:
inspect
.
isfunction
=
orig_isfunction
def
update_numpy_extension
(
ext
):
def
update_numpy_extension
(
ext
):
import
numpy
import
numpy
ext
.
include_dirs
.
append
(
numpy
.
get_include
())
ext
.
include_dirs
.
append
(
numpy
.
get_include
())
...
@@ -489,6 +506,7 @@ class CythonCompileTestCase(unittest.TestCase):
...
@@ -489,6 +506,7 @@ class CythonCompileTestCase(unittest.TestCase):
for name, value in self._saved_options:
for name, value in self._saved_options:
setattr(Options, name, value)
setattr(Options, name, value)
Options.directive_defaults = dict(self._saved_default_directives)
Options.directive_defaults = dict(self._saved_default_directives)
unpatch_inspect_isfunction()
try:
try:
sys.path.remove(self.workdir)
sys.path.remove(self.workdir)
...
@@ -918,6 +936,7 @@ class CythonPyregrTestCase(CythonRunTestCase):
...
@@ -918,6 +936,7 @@ class CythonPyregrTestCase(CythonRunTestCase):
Options.directive_defaults.update(dict(
Options.directive_defaults.update(dict(
binding=True, always_allow_keywords=True,
binding=True, always_allow_keywords=True,
set_initial_path="
SOURCEFILE
"))
set_initial_path="
SOURCEFILE
"))
patch_inspect_isfunction()
def _run_unittest(self, result, *classes):
def _run_unittest(self, result, *classes):
"""Run tests from unittest.TestCase-derived classes."""
"""Run tests from unittest.TestCase-derived classes."""
...
...
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