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
3be21c3b
Commit
3be21c3b
authored
Dec 02, 2010
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip debugger tests for pre-2.5 python versions and make them 2.5 compatible
parent
c12526e9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
7 deletions
+29
-7
Cython/Compiler/Tests/TestParseTreeTransforms.py
Cython/Compiler/Tests/TestParseTreeTransforms.py
+13
-4
Cython/Debugger/Tests/TestLibCython.py
Cython/Debugger/Tests/TestLibCython.py
+2
-0
runtests.py
runtests.py
+14
-3
No files found.
Cython/Compiler/Tests/TestParseTreeTransforms.py
View file @
3be21c3b
import
os
import
os
from
Cython.Debugger
import
DebugWriter
from
Cython.Compiler
import
CmdLine
from
Cython.Compiler
import
CmdLine
from
Cython.TestUtils
import
TransformTest
from
Cython.TestUtils
import
TransformTest
from
Cython.Compiler.ParseTreeTransforms
import
*
from
Cython.Compiler.ParseTreeTransforms
import
*
from
Cython.Compiler.Nodes
import
*
from
Cython.Compiler.Nodes
import
*
from
Cython.Debugger.Tests
import
TestLibCython
class
TestNormalizeTree
(
TransformTest
):
class
TestNormalizeTree
(
TransformTest
):
def
test_parserbehaviour_is_what_we_coded_for
(
self
):
def
test_parserbehaviour_is_what_we_coded_for
(
self
):
...
@@ -145,7 +144,14 @@ class TestWithTransform(object): # (TransformTest): # Disabled!
...
@@ -145,7 +144,14 @@ class TestWithTransform(object): # (TransformTest): # Disabled!
"""
,
t
)
"""
,
t
)
class
TestDebugTransform
(
TestLibCython
.
DebuggerTestCase
):
if
sys
.
version_info
[:
2
]
>
(
2
,
4
):
from
Cython.Debugger
import
DebugWriter
from
Cython.Debugger.Tests.TestLibCython
import
DebuggerTestCase
else
:
# skip test, don't let it inherit unittest.TestCase
DebuggerTestCase
=
object
class
TestDebugTransform
(
DebuggerTestCase
):
def
elem_hasattrs
(
self
,
elem
,
attrs
):
def
elem_hasattrs
(
self
,
elem
,
attrs
):
# we shall supporteth python 2.3 !
# we shall supporteth python 2.3 !
...
@@ -209,6 +215,9 @@ class TestDebugTransform(TestLibCython.DebuggerTestCase):
...
@@ -209,6 +215,9 @@ class TestDebugTransform(TestLibCython.DebuggerTestCase):
raise
raise
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
import
unittest
import
unittest
unittest
.
main
()
unittest
.
main
()
Cython/Debugger/Tests/TestLibCython.py
View file @
3be21c3b
from
__future__
import
with_statement
import
os
import
os
import
re
import
re
import
sys
import
sys
...
...
runtests.py
View file @
3be21c3b
...
@@ -624,6 +624,8 @@ class CythonUnitTestCase(CythonCompileTestCase):
...
@@ -624,6 +624,8 @@ class CythonUnitTestCase(CythonCompileTestCase):
except
Exception
:
except
Exception
:
pass
pass
include_debugger
=
sys
.
version_info
[:
2
]
>
(
2
,
4
)
def
collect_unittests
(
path
,
module_prefix
,
suite
,
selectors
):
def
collect_unittests
(
path
,
module_prefix
,
suite
,
selectors
):
def
file_matches
(
filename
):
def
file_matches
(
filename
):
return
filename
.
startswith
(
"Test"
)
and
filename
.
endswith
(
".py"
)
return
filename
.
startswith
(
"Test"
)
and
filename
.
endswith
(
".py"
)
...
@@ -633,7 +635,11 @@ def collect_unittests(path, module_prefix, suite, selectors):
...
@@ -633,7 +635,11 @@ def collect_unittests(path, module_prefix, suite, selectors):
loader
=
unittest
.
TestLoader
()
loader
=
unittest
.
TestLoader
()
if
include_debugger
:
skipped_dirs
=
[]
skipped_dirs
=
[]
else
:
cython_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
skipped_dirs
=
[
os
.
path
.
join
(
cython_dir
,
'Cython'
,
'Debugger'
)]
for
dirpath
,
dirnames
,
filenames
in
os
.
walk
(
path
):
for
dirpath
,
dirnames
,
filenames
in
os
.
walk
(
path
):
if
dirpath
!=
path
and
"__init__.py"
not
in
filenames
:
if
dirpath
!=
path
and
"__init__.py"
not
in
filenames
:
...
@@ -658,12 +664,17 @@ def collect_unittests(path, module_prefix, suite, selectors):
...
@@ -658,12 +664,17 @@ def collect_unittests(path, module_prefix, suite, selectors):
module
=
getattr
(
module
,
x
)
module
=
getattr
(
module
,
x
)
suite
.
addTests
([
loader
.
loadTestsFromModule
(
module
)])
suite
.
addTests
([
loader
.
loadTestsFromModule
(
module
)])
def
collect_doctests
(
path
,
module_prefix
,
suite
,
selectors
):
def
collect_doctests
(
path
,
module_prefix
,
suite
,
selectors
):
def
package_matches
(
dirname
):
def
package_matches
(
dirname
):
if
dirname
==
'Debugger'
and
not
include_debugger
:
return
False
return
dirname
not
in
(
"Mac"
,
"Distutils"
,
"Plex"
)
return
dirname
not
in
(
"Mac"
,
"Distutils"
,
"Plex"
)
def
file_matches
(
filename
):
def
file_matches
(
filename
):
filename
,
ext
=
os
.
path
.
splitext
(
filename
)
filename
,
ext
=
os
.
path
.
splitext
(
filename
)
blacklist
=
(
'libcython'
,
'libpython'
,
'test_libcython_in_gdb'
)
blacklist
=
[
'libcython'
,
'libpython'
,
'test_libcython_in_gdb'
,
'TestLibCython'
]
return
(
ext
==
'.py'
and
not
return
(
ext
==
'.py'
and
not
'~'
in
filename
and
not
'~'
in
filename
and
not
'#'
in
filename
and
not
'#'
in
filename
and
not
...
...
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