From: Steven Bethard Date: Tue, 18 Mar 2008 21:30:13 +0000 (+0000) Subject: Have regrtest skip test_py3kwarn when the -3 flag is missing. X-Git-Tag: v2.6a2~253 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e8e22cf3c0d9e977bc9f13cfc535c026f92bc7aa;p=python Have regrtest skip test_py3kwarn when the -3 flag is missing. --- diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 16f23f3d48..f8eac8c9b7 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -1164,6 +1164,14 @@ class _ExpectedSkips: self.expected.add('test_sunaudiodev') self.expected.add('test_nis') + # TODO: This is a hack to raise TestSkipped if -3 is not enabled. + # Instead of relying on callable to have a warning, we should expose + # the -3 flag to Python code somehow + with test_support.catch_warning() as w: + callable(int) + if w.message is None: + self.expected.add('test_py3kwarn') + self.valid = True def isvalid(self):