tests/test-doctest.py
changeset 31447 82350f7fa56c
parent 31044 0b8356705de6
child 31448 b70407bd84d5
--- a/tests/test-doctest.py	Wed Mar 15 15:33:24 2017 -0700
+++ b/tests/test-doctest.py	Wed Mar 08 22:13:32 2017 +0900
@@ -5,10 +5,16 @@
 import doctest
 import os
 import sys
+
+ispy3 = (sys.version_info[0] >= 3)
+
 if 'TERM' in os.environ:
     del os.environ['TERM']
 
-def testmod(name, optionflags=0, testtarget=None):
+# TODO: migrate doctests to py3 and enable them on both versions
+def testmod(name, optionflags=0, testtarget=None, py2=True, py3=False):
+    if not (not ispy3 and py2 or ispy3 and py3):
+        return
     __import__(name)
     mod = sys.modules[name]
     if testtarget is not None: