[Python-checkins] python/dist/src/Lib/test test___all__.py,1.25,1.26 test_coercion.py,1.4,1.5 test_exceptions.py,1.16,1.17 test_os.py,1.9,1.10 test_regex.py,1.10,1.11 test_repr.py,1.11,1.12 test_strop.py,1.15,1.16 test_sundry.py,1.9,1.10 test_xmllib.py,1.9,1.10
tim_one@sourceforge.net
tim_one@sourceforge.net
Mon, 15 Apr 2002 18:27:46 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv27580/python/Lib/test
Modified Files:
test___all__.py test_coercion.py test_exceptions.py test_os.py
test_regex.py test_repr.py test_strop.py test_sundry.py
test_xmllib.py
Log Message:
Tighten up some warning filters, and break some dependencies on the
order in which the tests are normally run.
Index: test___all__.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test___all__.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** test___all__.py 16 Apr 2002 00:01:09 -0000 1.25
--- test___all__.py 16 Apr 2002 01:27:44 -0000 1.26
***************
*** 3,9 ****
import warnings
! warnings.filterwarnings("ignore", ".* 'pre' .*", DeprecationWarning)
! warnings.filterwarnings("ignore", ".* regsub .*", DeprecationWarning)
! warnings.filterwarnings("ignore", ".* statcache .*", DeprecationWarning)
def check_all(modname):
--- 3,12 ----
import warnings
! warnings.filterwarnings("ignore", ".* 'pre' .*", DeprecationWarning,
! r'pre$')
! warnings.filterwarnings("ignore", ".* regsub .*", DeprecationWarning,
! r'^regsub$')
! warnings.filterwarnings("ignore", ".* statcache .*", DeprecationWarning,
! r'statcache$')
def check_all(modname):
Index: test_coercion.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_coercion.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** test_coercion.py 16 Apr 2002 00:01:09 -0000 1.4
--- test_coercion.py 16 Apr 2002 01:27:44 -0000 1.5
***************
*** 113,117 ****
warnings.filterwarnings("ignore",
r'complex divmod\(\), // and % are deprecated',
! DeprecationWarning)
do_infix_binops()
do_prefix_binops()
--- 113,118 ----
warnings.filterwarnings("ignore",
r'complex divmod\(\), // and % are deprecated',
! DeprecationWarning,
! r'test_coercion$')
do_infix_binops()
do_prefix_binops()
Index: test_exceptions.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_exceptions.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** test_exceptions.py 8 Dec 2001 10:15:48 -0000 1.16
--- test_exceptions.py 16 Apr 2002 01:27:44 -0000 1.17
***************
*** 6,11 ****
import sys, traceback
- warnings.filterwarnings("error", "", OverflowWarning, __name__)
-
print '5. Built-in exceptions'
# XXX This is not really enough, each *operation* should be tested!
--- 6,9 ----
***************
*** 87,90 ****
--- 85,94 ----
r(OverflowError)
+ # XXX
+ # Obscure: this test relies on int+int raising OverflowError if the
+ # ints are big enough. But ints no longer do that by default. This
+ # test will have to go away someday. For now, we can convert the
+ # transitional OverflowWarning into an error.
+ warnings.filterwarnings("error", "", OverflowWarning, __name__)
x = 1
try:
Index: test_os.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_os.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** test_os.py 18 Oct 2001 21:57:37 -0000 1.9
--- test_os.py 16 Apr 2002 01:27:44 -0000 1.10
***************
*** 34,38 ****
return
warnings.filterwarnings("ignore", "tempnam", RuntimeWarning,
! "test_os")
self.check_tempfile(os.tempnam())
--- 34,38 ----
return
warnings.filterwarnings("ignore", "tempnam", RuntimeWarning,
! r"test_os$")
self.check_tempfile(os.tempnam())
***************
*** 58,62 ****
return
warnings.filterwarnings("ignore", "tmpnam", RuntimeWarning,
! "test_os")
self.check_tempfile(os.tmpnam())
--- 58,62 ----
return
warnings.filterwarnings("ignore", "tmpnam", RuntimeWarning,
! r"test_os$")
self.check_tempfile(os.tmpnam())
Index: test_regex.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_regex.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** test_regex.py 13 May 2001 00:19:31 -0000 1.10
--- test_regex.py 16 Apr 2002 01:27:44 -0000 1.11
***************
*** 2,6 ****
import warnings
warnings.filterwarnings("ignore", "the regex module is deprecated",
! DeprecationWarning, __name__)
import regex
from regex_syntax import *
--- 2,6 ----
import warnings
warnings.filterwarnings("ignore", "the regex module is deprecated",
! DeprecationWarning, r'test_regex$')
import regex
from regex_syntax import *
Index: test_repr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_repr.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** test_repr.py 29 Dec 2001 00:25:42 -0000 1.11
--- test_repr.py 16 Apr 2002 01:27:44 -0000 1.12
***************
*** 106,109 ****
--- 106,110 ----
def test_xrange(self):
+ import warnings
eq = self.assertEquals
eq(repr(xrange(1)), 'xrange(1)')
***************
*** 111,117 ****
eq(repr(xrange(1, 2, 3)), 'xrange(1, 4, 3)')
# Turn off warnings for deprecated multiplication
! import warnings
! warnings.filterwarnings('ignore', category=DeprecationWarning,
! module=ReprTests.__module__)
eq(repr(xrange(1) * 3), '(xrange(1) * 3)')
--- 112,121 ----
eq(repr(xrange(1, 2, 3)), 'xrange(1, 4, 3)')
# Turn off warnings for deprecated multiplication
! warnings.filterwarnings('ignore',
! r'xrange object multiplication is deprecated',
! DeprecationWarning, module=ReprTests.__module__)
! warnings.filterwarnings('ignore',
! r"PyRange_New's 'repetitions' argument is deprecated",
! DeprecationWarning, module=ReprTests.__module__)
eq(repr(xrange(1) * 3), '(xrange(1) * 3)')
Index: test_strop.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_strop.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** test_strop.py 20 Sep 2001 21:33:42 -0000 1.15
--- test_strop.py 16 Apr 2002 01:27:44 -0000 1.16
***************
*** 1,5 ****
import warnings
! warnings.filterwarnings("ignore", "", DeprecationWarning, __name__)
! warnings.filterwarnings("ignore", "", DeprecationWarning, "unittest")
import strop
import test_support
--- 1,6 ----
import warnings
! warnings.filterwarnings("ignore", "strop functions are obsolete;",
! DeprecationWarning,
! r'test_strop|unittest')
import strop
import test_support
Index: test_sundry.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sundry.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** test_sundry.py 22 Mar 2002 02:48:57 -0000 1.9
--- test_sundry.py 16 Apr 2002 01:27:44 -0000 1.10
***************
*** 2,6 ****
import warnings
! warnings.filterwarnings('ignore', '', DeprecationWarning, 'posixfile')
from test_support import verbose
--- 2,11 ----
import warnings
! warnings.filterwarnings('ignore', r".*posixfile module",
! DeprecationWarning, 'posixfile$')
! warnings.filterwarnings('ignore', r".*statcache module",
! DeprecationWarning, 'statcache$')
! warnings.filterwarnings('ignore', r".*'re' module",
! DeprecationWarning, 'pre$')
from test_support import verbose
Index: test_xmllib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_xmllib.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** test_xmllib.py 16 Apr 2002 00:01:09 -0000 1.9
--- test_xmllib.py 16 Apr 2002 01:27:44 -0000 1.10
***************
*** 16,20 ****
import warnings
warnings.filterwarnings("ignore", ".* xmllib .* obsolete.*",
! DeprecationWarning)
import test_support
--- 16,20 ----
import warnings
warnings.filterwarnings("ignore", ".* xmllib .* obsolete.*",
! DeprecationWarning, r'xmllib$')
import test_support