diff options
author | Brett Cannon <brett@python.org> | 2013-06-13 01:25:59 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2013-06-13 01:25:59 (GMT) |
commit | 3e9a9ae09d6fc9169b01cba3efd1ae03ab40b237 (patch) | |
tree | 5ef61b4c8c1b5bfaaafb1e1e0cd03afe7971caf7 /Lib/test/test_getargs2.py | |
parent | e382b5868a4daca614589270b6b3fe5c50059986 (diff) | |
download | cpython-3e9a9ae09d6fc9169b01cba3efd1ae03ab40b237.zip cpython-3e9a9ae09d6fc9169b01cba3efd1ae03ab40b237.tar.gz cpython-3e9a9ae09d6fc9169b01cba3efd1ae03ab40b237.tar.bz2 |
Update various test modules to use unittest.main() for test discovery
instead of manually listing tests for test.support.run_unittest().
Diffstat (limited to 'Lib/test/test_getargs2.py')
-rw-r--r-- | Lib/test/test_getargs2.py | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/Lib/test/test_getargs2.py b/Lib/test/test_getargs2.py index d75ad30..beea76a 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() |