Commit dc9dcf13 authored by Raymond Hettinger's avatar Raymond Hettinger

This test failed on WindowsME because the full file path did not get

reported consistently with the *nix world.  'Lib/test/test_warnings.py'
came out as 'lib\test\test_warnings.py'.  The basename is all we care
about so I used that.
parent 03204645
...@@ -2,9 +2,9 @@ test_warnings ...@@ -2,9 +2,9 @@ test_warnings
('ignore', False, 'FutureWarning', False, 0) ('ignore', False, 'FutureWarning', False, 0)
('ignore', True, 'OverflowWarning', True, 0) ('ignore', True, 'OverflowWarning', True, 0)
('ignore', True, 'PendingDeprecationWarning', True, 0) ('ignore', True, 'PendingDeprecationWarning', True, 0)
Lib/test/test_warnings.py:31: UserWarning: hello world test_warnings.py:31: UserWarning: hello world
Lib/test/test_warnings.py:32: UserWarning: hello world test_warnings.py:32: UserWarning: hello world
Lib/test/test_warnings.py:33: DeprecationWarning: hello world test_warnings.py:33: DeprecationWarning: hello world
Lib/test/test_warnings.py:35: UserWarning: hello world test_warnings.py:35: UserWarning: hello world
Caught UserWarning: hello world Caught UserWarning: hello world
Caught AssertionError: invalid action: 'booh' Caught AssertionError: invalid action: 'booh'
import warnings import warnings
import os
# The warnings module isn't easily tested, because it relies on module # The warnings module isn't easily tested, because it relies on module
# globals to store configuration information. We need to extract the # globals to store configuration information. We need to extract the
...@@ -8,8 +9,7 @@ _filters = [] ...@@ -8,8 +9,7 @@ _filters = []
_showwarning = None _showwarning = None
def showwarning(message, category, filename, lineno, file=None): def showwarning(message, category, filename, lineno, file=None):
i = filename.find("Lib") filename = os.path.basename(filename)
filename = filename[i:]
print "%s:%s: %s: %s" % (filename, lineno, category.__name__, message) print "%s:%s: %s: %s" % (filename, lineno, category.__name__, message)
def monkey(): def monkey():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment