From 3e9a9ae09d6fc9169b01cba3efd1ae03ab40b237 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 12 Jun 2013 21:25:59 -0400 Subject: Update various test modules to use unittest.main() for test discovery instead of manually listing tests for test.support.run_unittest(). --- Lib/test/test_getargs2.py | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'Lib/test/test_getargs2.py') diff --git a/Lib/test/test_getargs2.py b/Lib/test/test_getargs2.py index d75ad3006c..beea76a920 100644 --- a/Lib/test/test_getargs2.py +++ b/Lib/test/test_getargs2.py @@ -1,6 +1,10 @@ import unittest from test import support from _testcapi import getargs_keywords, getargs_keyword_only +try: + from _testcapi import getargs_L, getargs_K +except ImportError: + getargs_L = None # PY_LONG_LONG not available # > How about the following counterproposal. This also changes some of # > the other format codes to be a little more regular. @@ -182,6 +186,7 @@ class Signed_TestCase(unittest.TestCase): self.assertRaises(OverflowError, getargs_n, VERY_LARGE) +@unittest.skipIf(getargs_L is None, 'PY_LONG_LONG is not available') class LongLong_TestCase(unittest.TestCase): def test_L(self): from _testcapi import getargs_L @@ -534,24 +539,5 @@ class Unicode_TestCase(unittest.TestCase): self.assertIsNone(getargs_Z_hash(None)) -def test_main(): - tests = [ - Signed_TestCase, - Unsigned_TestCase, - Boolean_TestCase, - Tuple_TestCase, - Keywords_TestCase, - KeywordOnly_TestCase, - Bytes_TestCase, - Unicode_TestCase, - ] - try: - from _testcapi import getargs_L, getargs_K - except ImportError: - pass # PY_LONG_LONG not available - else: - tests.append(LongLong_TestCase) - support.run_unittest(*tests) - if __name__ == "__main__": - test_main() + unittest.main() -- cgit v1.2.1