Skip to content

Commit b8afef6

Browse files
author
steven.bethard
committed
Have regrtest skip test_py3kwarn when the -3 flag is missing.
git-svn-id: http://svn.python.org/projects/python/trunk@61565 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent b1d9d23 commit b8afef6

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Lib/test/regrtest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,14 @@ def __init__(self):
11641164
self.expected.add('test_sunaudiodev')
11651165
self.expected.add('test_nis')
11661166

1167+
# TODO: This is a hack to raise TestSkipped if -3 is not enabled.
1168+
# Instead of relying on callable to have a warning, we should expose
1169+
# the -3 flag to Python code somehow
1170+
with test_support.catch_warning() as w:
1171+
callable(int)
1172+
if w.message is None:
1173+
self.expected.add('test_py3kwarn')
1174+
11671175
self.valid = True
11681176

11691177
def isvalid(self):

0 commit comments

Comments
 (0)