r62091 - python/trunk/Lib/test/test_code.py python/trunk/Lib/test/test_dl.py python/trunk/Lib/test/test_frozen.py python/trunk/Lib/test/test_lib2to3.py
![](https://secure.gravatar.com/avatar/8ac615df352a970211b0e3d94a307c6d.jpg?s=120&d=mm&r=g)
Author: brett.cannon Date: Tue Apr 1 14:46:02 2008 New Revision: 62091 Modified: python/trunk/Lib/test/test_code.py python/trunk/Lib/test/test_dl.py python/trunk/Lib/test/test_frozen.py python/trunk/Lib/test/test_lib2to3.py Log: Add ``if __name__ == '__main__'`` to some test files where it didn't take a lot of effort to do so. Modified: python/trunk/Lib/test/test_code.py ============================================================================== --- python/trunk/Lib/test/test_code.py (original) +++ python/trunk/Lib/test/test_code.py Tue Apr 1 14:46:02 2008 @@ -100,3 +100,7 @@ from test.test_support import run_doctest from test import test_code run_doctest(test_code, verbose) + + +if __name__ == '__main__': + test_main() Modified: python/trunk/Lib/test/test_dl.py ============================================================================== --- python/trunk/Lib/test/test_dl.py (original) +++ python/trunk/Lib/test/test_dl.py Tue Apr 1 14:46:02 2008 @@ -13,22 +13,27 @@ ('/usr/lib/libc.dylib', 'getpid'), ] -for s, func in sharedlibs: - try: - if verbose: - print 'trying to open:', s, - l = dl.open(s) - except dl.error, err: - if verbose: - print 'failed', repr(str(err)) - pass +def test_main(): + for s, func in sharedlibs: + try: + if verbose: + print 'trying to open:', s, + l = dl.open(s) + except dl.error, err: + if verbose: + print 'failed', repr(str(err)) + pass + else: + if verbose: + print 'succeeded...', + l.call(func) + l.close() + if verbose: + print 'worked!' + break else: - if verbose: - print 'succeeded...', - l.call(func) - l.close() - if verbose: - print 'worked!' - break -else: - raise TestSkipped, 'Could not open any shared libraries' + raise TestSkipped, 'Could not open any shared libraries' + + +if __name__ == '__main__': + test_main() Modified: python/trunk/Lib/test/test_frozen.py ============================================================================== --- python/trunk/Lib/test/test_frozen.py (original) +++ python/trunk/Lib/test/test_frozen.py Tue Apr 1 14:46:02 2008 @@ -38,3 +38,8 @@ def test_main(): run_unittest(FrozenTests) + + + +if __name__ == '__main__': + test_main() Modified: python/trunk/Lib/test/test_lib2to3.py ============================================================================== --- python/trunk/Lib/test/test_lib2to3.py (original) +++ python/trunk/Lib/test/test_lib2to3.py Tue Apr 1 14:46:02 2008 @@ -13,3 +13,7 @@ def test_main(): run_unittest(suite()) + + +if __name__ == '__main__': + test_main()
participants (1)
-
brett.cannon