Replace assert from Python testcases with code that always runs.
assert code is sometimes not executed, eg when running python -O.
This commit is contained in:
parent
84b06fa21b
commit
cc7319f52f
5 changed files with 18 additions and 9 deletions
|
|
@ -26,8 +26,10 @@ def test1():
|
|||
sys.stderr.flush()
|
||||
sys.stderr = stderr_saved
|
||||
|
||||
assert attributeErrorOccurred
|
||||
assert buffer.getvalue().count("I am the ClassWithThrowingDestructor dtor doing bad things") >= 1
|
||||
if not attributeErrorOccurred:
|
||||
raise RuntimeError("attributeErrorOccurred failed")
|
||||
if not buffer.getvalue().count("I am the ClassWithThrowingDestructor dtor doing bad things") >= 1:
|
||||
raise RuntimeError("ClassWithThrowingDestructor dtor doing bad things failed")
|
||||
|
||||
class VectorHolder(object):
|
||||
def __init__(self, v):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue