Mercurial > public > mercurial-scm > hg-stable
diff tests/test-doctest.py @ 49952: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 | 6000f5b25c9b |
children | 7b8769cca23d 4f0fad8da04c |
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('/', '.')