mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
This patch removes all uses of "assert" in the regression test suite
and replaces them with a new API verify(). As a result the regression suite will also perform its tests in optimization mode. Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
This commit is contained in:
parent
8551dd6078
commit
3661908a6a
70 changed files with 436 additions and 412 deletions
|
@ -1,3 +1,4 @@
|
|||
from test_support import verify, verbose
|
||||
from UserList import UserList
|
||||
from test_support import TestFailed
|
||||
import string
|
||||
|
@ -79,11 +80,11 @@ g(*Nothing())
|
|||
# make sure the function call doesn't stomp on the dictionary?
|
||||
d = {'a': 1, 'b': 2, 'c': 3}
|
||||
d2 = d.copy()
|
||||
assert d == d2
|
||||
verify(d == d2)
|
||||
g(1, d=4, **d)
|
||||
print d
|
||||
print d2
|
||||
assert d == d2, "function call modified dictionary"
|
||||
verify(d == d2, "function call modified dictionary")
|
||||
|
||||
# what about willful misconduct?
|
||||
def saboteur(**kw):
|
||||
|
@ -91,7 +92,7 @@ def saboteur(**kw):
|
|||
return kw
|
||||
d = {}
|
||||
kw = saboteur(a=1, **d)
|
||||
assert d == {}
|
||||
verify(d == {})
|
||||
# break the cycle
|
||||
del kw['x']
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue