changeset 49872:40060267df22

tests: drop py2 support from test-doctest.py
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 03 Jan 2023 23:47:29 -0500
parents ecde742a5a9d
children e9d06ed64161
files tests/test-doctest.py
diffstat 1 files changed, 2 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-doctest.py	Tue Jan 03 23:44:12 2023 -0500
+++ b/tests/test-doctest.py	Tue Jan 03 23:47:29 2023 -0500
@@ -7,8 +7,6 @@
 import subprocess
 import sys
 
-ispy3 = sys.version_info[0] >= 3
-
 if 'TERM' in os.environ:
     del os.environ['TERM']
 
@@ -40,9 +38,7 @@
 
     # minimal copy of doctest.testmod()
     finder = doctest.DocTestFinder()
-    checker = None
-    if ispy3:
-        checker = py3docchecker()
+    checker = py3docchecker()
     runner = doctest.DocTestRunner(checker=checker, optionflags=optionflags)
     for test in finder.find(mod, name):
         runner.run(test)
@@ -91,8 +87,7 @@
         if not re.search(br'\n\s*>>>', fh.read()):
             continue
 
-    if ispy3:
-        f = f.decode()
+    f = f.decode()
 
     modname = f.replace('.py', '').replace('\\', '.').replace('/', '.')