mirror of
https://github.com/python/cpython.git
synced 2025-12-10 11:00:14 +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,7 +1,7 @@
|
|||
# Test case for the os.poll() function
|
||||
|
||||
import sys, os, select, random
|
||||
from test_support import verbose, TestSkipped, TESTFN
|
||||
from test_support import verify, verbose, TestSkipped, TESTFN
|
||||
|
||||
try:
|
||||
select.poll
|
||||
|
|
@ -55,7 +55,7 @@ def test_poll1():
|
|||
raise RuntimeError, "no pipes ready for reading"
|
||||
rd = random.choice(ready_readers)
|
||||
buf = os.read(rd, MSG_LEN)
|
||||
assert len(buf) == MSG_LEN
|
||||
verify(len(buf) == MSG_LEN)
|
||||
print buf
|
||||
os.close(r2w[rd]) ; os.close( rd )
|
||||
p.unregister( r2w[rd] )
|
||||
|
|
@ -75,17 +75,17 @@ def poll_unit_tests():
|
|||
p = select.poll()
|
||||
p.register(FD)
|
||||
r = p.poll()
|
||||
assert r[0] == (FD, select.POLLNVAL)
|
||||
verify(r[0] == (FD, select.POLLNVAL))
|
||||
|
||||
f = open(TESTFN, 'w')
|
||||
fd = f.fileno()
|
||||
p = select.poll()
|
||||
p.register(f)
|
||||
r = p.poll()
|
||||
assert r[0][0] == fd
|
||||
verify(r[0][0] == fd)
|
||||
f.close()
|
||||
r = p.poll()
|
||||
assert r[0] == (fd, select.POLLNVAL)
|
||||
verify(r[0] == (fd, select.POLLNVAL))
|
||||
os.unlink(TESTFN)
|
||||
|
||||
# type error for invalid arguments
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue