Thrift: Python test improvements.

Summary:
- Add a serialization test for forwards/backwards compatibility.
- Hook the Python tests up to "make check".
- Miscellaneous changes to the Python tests.

Reviewed By: mcslee

Test Plan: Ran the test.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665480 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/py/TestClient.py b/test/py/TestClient.py
index 7e58dfe..ab2cba8 100755
--- a/test/py/TestClient.py
+++ b/test/py/TestClient.py
@@ -92,11 +92,13 @@
 class AcceleratedBinaryTest(AbstractTest):
   protocol_factory = TBinaryProtocol.TBinaryProtocolAcceleratedFactory()
 
-suite = unittest.TestSuite()
-loader = unittest.TestLoader()
+def suite():
+  suite = unittest.TestSuite()
+  loader = unittest.TestLoader()
 
-suite.addTest(loader.loadTestsFromTestCase(NormalBinaryTest))
-suite.addTest(loader.loadTestsFromTestCase(AcceleratedBinaryTest))
+  suite.addTest(loader.loadTestsFromTestCase(NormalBinaryTest))
+  suite.addTest(loader.loadTestsFromTestCase(AcceleratedBinaryTest))
+  return suite
 
-testRunner = unittest.TextTestRunner(verbosity=2)
-testRunner.run(suite)
+if __name__ == "__main__":
+  unittest.main(defaultTest="suite", testRunner=unittest.TextTestRunner(verbosity=2))