Patchwork doctest: drop hack to run py2/3 tests selectively

login
register
mail settings
Submitter Yuya Nishihara
Date Oct. 1, 2017, 8:25 a.m.
Message ID <8de6dc4ab3304251a0bc.1506846315@mimosa>
Download mbox | patch
Permalink /patch/24279/
State Accepted
Headers show

Comments

Yuya Nishihara - Oct. 1, 2017, 8:25 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1506515928 -32400
#      Wed Sep 27 21:38:48 2017 +0900
# Node ID 8de6dc4ab3304251a0bce4154603b784d4d519a0
# Parent  b52f22d9afa5a8abd4acd6aa27f8c2e413d087c1
doctest: drop hack to run py2/3 tests selectively

All doctests pass on Python 3.
Pulkit Goyal - Oct. 1, 2017, 9:34 a.m.
This looks good to me. :)

On Sun, Oct 1, 2017 at 1:55 PM, Yuya Nishihara <yuya@tcha.org> wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1506515928 -32400
> #      Wed Sep 27 21:38:48 2017 +0900
> # Node ID 8de6dc4ab3304251a0bce4154603b784d4d519a0
> # Parent  b52f22d9afa5a8abd4acd6aa27f8c2e413d087c1
> doctest: drop hack to run py2/3 tests selectively
>
> All doctests pass on Python 3.
>
> diff --git a/tests/test-doctest.py b/tests/test-doctest.py
> --- a/tests/test-doctest.py
> +++ b/tests/test-doctest.py
> @@ -24,10 +24,7 @@ class py3docchecker(doctest.OutputChecke
>          return any(doctest.OutputChecker.check_output(self, w, g, optionflags)
>                     for w, g in [(want, got), (want2, got2)])
>
> -# TODO: migrate doctests to py3 and enable them on both versions
> -def testmod(name, optionflags=0, testtarget=None, py2=True, py3=True):
> -    if not (not ispy3 and py2 or ispy3 and py3):
> -        return
> +def testmod(name, optionflags=0, testtarget=None):
>      __import__(name)
>      mod = sys.modules[name]
>      if testtarget is not None:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Augie Fackler - Oct. 1, 2017, 10:23 p.m.
On Sun, Oct 01, 2017 at 09:25:15AM +0100, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1506515928 -32400
> #      Wed Sep 27 21:38:48 2017 +0900
> # Node ID 8de6dc4ab3304251a0bce4154603b784d4d519a0
> # Parent  b52f22d9afa5a8abd4acd6aa27f8c2e413d087c1
> doctest: drop hack to run py2/3 tests selectively

queued, thanks

Patch

diff --git a/tests/test-doctest.py b/tests/test-doctest.py
--- a/tests/test-doctest.py
+++ b/tests/test-doctest.py
@@ -24,10 +24,7 @@  class py3docchecker(doctest.OutputChecke
         return any(doctest.OutputChecker.check_output(self, w, g, optionflags)
                    for w, g in [(want, got), (want2, got2)])
 
-# TODO: migrate doctests to py3 and enable them on both versions
-def testmod(name, optionflags=0, testtarget=None, py2=True, py3=True):
-    if not (not ispy3 and py2 or ispy3 and py3):
-        return
+def testmod(name, optionflags=0, testtarget=None):
     __import__(name)
     mod = sys.modules[name]
     if testtarget is not None: