diff options
author | Marc-André Lemburg <mal@egenix.com> | 2001-01-17 19:11:13 (GMT) |
---|---|---|
committer | Marc-André Lemburg <mal@egenix.com> | 2001-01-17 19:11:13 (GMT) |
commit | 3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e (patch) | |
tree | eea0f44df59aaaf014eb4580f1fad308e31601bf /Lib/test/test_poll.py | |
parent | 8551dd60781f738e5e5ef4e22b6f071d27e20b50 (diff) | |
download | cpython-3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e.zip cpython-3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e.tar.gz cpython-3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e.tar.bz2 |
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.
Diffstat (limited to 'Lib/test/test_poll.py')
-rw-r--r-- | Lib/test/test_poll.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_poll.py b/Lib/test/test_poll.py index 576e4cc..f6d427c 100644 --- a/Lib/test/test_poll.py +++ b/Lib/test/test_poll.py @@ -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 |