add tests
diff --git a/test/py/RunClientServer.py b/test/py/RunClientServer.py
index 56a408e..cb0decf 100755
--- a/test/py/RunClientServer.py
+++ b/test/py/RunClientServer.py
@@ -259,7 +259,7 @@
     parser = OptionParser()
     parser.add_option('--all', action="store_true", dest='all')
     parser.add_option('--genpydirs', type='string', dest='genpydirs',
-                      default='default,slots,oldstyle,no_utf8strings,dynamic,dynamicslots',
+                      default='default,slots,oldstyle,no_utf8strings,dynamic,dynamicslots,enum',
                       help='directory extensions for generated code, used as suffixes for \"gen-py-*\" added sys.path for individual tests')
     parser.add_option("--port", type="int", dest="port", default=9090,
                       help="port number for server to listen on")
diff --git a/test/py/SerializationTest.py b/test/py/SerializationTest.py
index ef79835..f47c3d4 100755
--- a/test/py/SerializationTest.py
+++ b/test/py/SerializationTest.py
@@ -432,7 +432,19 @@
         self.assertEquals(obj, objcopy)
 
         # test enums
-        for num, name in Numberz._VALUES_TO_NAMES.items():
+        def _enumerate_enum(enum_class):
+            if hasattr(enum_class, '_VALUES_TO_NAMES'):
+                # old-style enums
+                for num, name in enum_class._VALUES_TO_NAMES.items():
+                    yield (num, name)
+            else:
+                # assume Python 3.4+ IntEnum-based
+                from enum import IntEnum
+                self.assertTrue((issubclass(enum_class, IntEnum)))
+                for num in enum_class:
+                    yield (num.value, num.name)
+
+        for num, name in _enumerate_enum(Numberz):
             obj = Bonk(message='enum Numberz value %d is string %s' % (num, name), type=num)
             objcopy = Bonk()
             deserialize(objcopy, serialize(obj))
diff --git a/test/py/generate.cmake b/test/py/generate.cmake
index 4ed14cc..e6a6735 100644
--- a/test/py/generate.cmake
+++ b/test/py/generate.cmake
@@ -13,6 +13,7 @@
 generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:no_utf8strings gen-py-no_utf8strings)
 generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:dynamic gen-py-dynamic)
 generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:dynamic,slots gen-py-dynamicslots)
+generate(${MY_PROJECT_DIR}/test/ThriftTest.thrift py:enum gen-py-enum)
 
 generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py gen-py-default)
 generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:slots gen-py-slots)
@@ -20,6 +21,7 @@
 generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:no_utf8strings gen-py-no_utf8strings)
 generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:dynamic gen-py-dynamic)
 generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:dynamic,slots gen-py-dynamicslots)
+generate(${MY_PROJECT_DIR}/test/DebugProtoTest.thrift py:enum gen-py-enum)
 
 generate(${MY_PROJECT_DIR}/test/DoubleConstantsTest.thrift py gen-py-default)
 generate(${MY_PROJECT_DIR}/test/DoubleConstantsTest.thrift py:slots gen-py-slots)
@@ -27,6 +29,7 @@
 generate(${MY_PROJECT_DIR}/test/DoubleConstantsTest.thrift py:no_utf8strings gen-py-no_utf8strings)
 generate(${MY_PROJECT_DIR}/test/DoubleConstantsTest.thrift py:dynamic gen-py-dynamic)
 generate(${MY_PROJECT_DIR}/test/DoubleConstantsTest.thrift py:dynamic,slots gen-py-dynamicslots)
+generate(${MY_PROJECT_DIR}/test/DoubleConstantsTest.thrift py:enum gen-py-enum)
 
 generate(${MY_PROJECT_DIR}/test/Recursive.thrift py gen-py-default)
 generate(${MY_PROJECT_DIR}/test/Recursive.thrift py:slots gen-py-slots)
@@ -34,3 +37,4 @@
 generate(${MY_PROJECT_DIR}/test/Recursive.thrift py:no_utf8strings gen-py-no_utf8strings)
 generate(${MY_PROJECT_DIR}/test/Recursive.thrift py:dynamic gen-py-dynamic)
 generate(${MY_PROJECT_DIR}/test/Recursive.thrift py:dynamic,slots gen-py-dynamicslots)
+generate(${MY_PROJECT_DIR}/test/Recursive.thrift py:enum gen-py-enum)