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
Boxiang Sun
cython
Commits
a6332d43
Commit
a6332d43
authored
Aug 30, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Py2.5 test fix
parent
2776eeb8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
tests/run/__debug__.srctree
tests/run/__debug__.srctree
+21
-9
No files found.
tests/run/__debug__.srctree
View file @
a6332d43
...
...
@@ -20,10 +20,16 @@ else:
DBG = False
import sys
if DBG == sys.flags.optimize:
try:
optimised = bool(sys.flags.optimize)
except AttributeError:
# Py2.[45]
optimised = eval('not __debug__')
if DBG == optimised:
raise RuntimeError(
"PYTHON: unexpected debug value %s, expected %s" % (
DBG,
sys.flags.optimize
))
DBG,
optimised
))
ASSERT_CALLED = False
def sideeffect():
...
...
@@ -32,14 +38,14 @@ def sideeffect():
return True
assert sideeffect()
if ASSERT_CALLED
and sys.flags.optimize
:
if ASSERT_CALLED
== optimised
:
raise RuntimeError("Assert called in optimised Python run")
import debug_test_cython
if debug_test_cython.DBG ==
sys.flags.optimize
:
if debug_test_cython.DBG ==
optimised
:
raise RuntimeError(
"CYTHON: unexpected debug value %s, expected %s" % (
debug_test_cython.DBG,
sys.flags.optimize
))
debug_test_cython.DBG,
optimised
))
######## debug_test_cython.pyx ########
...
...
@@ -49,17 +55,23 @@ if __debug__:
else:
DBG = False
import sys
try:
optimised = bool(sys.flags.optimize)
except AttributeError:
# Py2.[45]
optimised = eval('not __debug__')
ASSERT_CALLED = False
def sideeffect():
global ASSERT_CALLED
ASSERT_CALLED = True
return True
import sys
if DBG == sys.flags.optimize:
if DBG == optimised:
raise RuntimeError("Unexpected debug value %s, expected %s" % (
DBG,
sys.flags.optimize
))
DBG,
optimised
))
assert sideeffect()
if ASSERT_CALLED
and sys.flags.optimize
:
if ASSERT_CALLED
== optimised
:
raise RuntimeError("Assert called in optimised Python run")
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