summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2007-05-20 23:57:38 (GMT)
committerBrett Cannon <bcannon@gmail.com>2007-05-20 23:57:38 (GMT)
commit41bf2fad62e4c9d0c6310e4aec30bc41cabf4871 (patch)
tree251796bff91ef42723959d7401536799a8fe4d69 /Lib/test
parent49da0ead9589b4baf69586a6cec2f75cb72656af (diff)
downloadcpython-41bf2fad62e4c9d0c6310e4aec30bc41cabf4871.zip
cpython-41bf2fad62e4c9d0c6310e4aec30bc41cabf4871.tar.gz
cpython-41bf2fad62e4c9d0c6310e4aec30bc41cabf4871.tar.bz2
Cause posixfile to raise a DeprecationWarning. Documented as deprecated since
Ptyhon 1.5.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_sundry.py133
1 files changed, 68 insertions, 65 deletions
diff --git a/Lib/test/test_sundry.py b/Lib/test/test_sundry.py
index 42ee257..5711fb2 100644
--- a/Lib/test/test_sundry.py
+++ b/Lib/test/test_sundry.py
@@ -1,71 +1,74 @@
"""Do a minimal test of all the modules that aren't otherwise tested."""
+from test.test_support import guard_warnings_filter
import warnings
-warnings.filterwarnings('ignore', r".*posixfile module",
- DeprecationWarning, 'posixfile$')
-from test.test_support import verbose
+with guard_warnings_filter():
+ warnings.filterwarnings('ignore', r".*posixfile",
+ DeprecationWarning)
-import BaseHTTPServer
-import DocXMLRPCServer
-import CGIHTTPServer
-import SimpleHTTPServer
-import SimpleXMLRPCServer
-import aifc
-import audiodev
-import bdb
-import cgitb
-import cmd
-import code
-import compileall
-import encodings
-import formatter
-import ftplib
-import getpass
-import htmlentitydefs
-import ihooks
-import imghdr
-import imputil
-import keyword
-import linecache
-import macurl2path
-import mailcap
-import mimify
-import mutex
-import nntplib
-import nturl2path
-import opcode
-import os2emxpath
-import pdb
-import pipes
-#import poplib
-import posixfile
-import pstats
-import py_compile
-import pydoc
-import rexec
-import rlcompleter
-import sched
-import smtplib
-import sndhdr
-import statvfs
-import stringold
-import sunau
-import sunaudio
-import symbol
-import tabnanny
-import telnetlib
-import timeit
-import toaiff
-import token
-try:
- import tty # not available on Windows
-except ImportError:
- if verbose:
- print "skipping tty"
+ from test.test_support import verbose
-# Can't test the "user" module -- if the user has a ~/.pythonrc.py, it
-# can screw up all sorts of things (esp. if it prints!).
-#import user
-import webbrowser
-import xml
+ import BaseHTTPServer
+ import DocXMLRPCServer
+ import CGIHTTPServer
+ import SimpleHTTPServer
+ import SimpleXMLRPCServer
+ import aifc
+ import audiodev
+ import bdb
+ import cgitb
+ import cmd
+ import code
+ import compileall
+ import encodings
+ import formatter
+ import ftplib
+ import getpass
+ import htmlentitydefs
+ import ihooks
+ import imghdr
+ import imputil
+ import keyword
+ import linecache
+ import macurl2path
+ import mailcap
+ import mimify
+ import mutex
+ import nntplib
+ import nturl2path
+ import opcode
+ import os2emxpath
+ import pdb
+ import pipes
+ #import poplib
+ import posixfile
+ import pstats
+ import py_compile
+ import pydoc
+ import rexec
+ import rlcompleter
+ import sched
+ import smtplib
+ import sndhdr
+ import statvfs
+ import stringold
+ import sunau
+ import sunaudio
+ import symbol
+ import tabnanny
+ import telnetlib
+ import timeit
+ import toaiff
+ import token
+ try:
+ import tty # not available on Windows
+ except ImportError:
+ if verbose:
+ print "skipping tty"
+
+ # Can't test the "user" module -- if the user has a ~/.pythonrc.py, it
+ # can screw up all sorts of things (esp. if it prints!).
+ #import user
+ import webbrowser
+ import xml