Patchwork [5,of,5] py3: add tests in check-code to load modules from util.py

login
register
mail settings
Submitter Pulkit Goyal
Date June 27, 2016, 1:46 p.m.
Message ID <f251c4c4f77bd2be42ff.1467035204@pulkit-goyal>
Download mbox | patch
Permalink /patch/15648/
State Accepted
Headers show

Comments

Pulkit Goyal - June 27, 2016, 1:46 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1467034830 -19800
#      Mon Jun 27 19:10:30 2016 +0530
# Node ID f251c4c4f77bd2be42ff69b71c74c2778febac90
# Parent  c8e0c9bbb94c18dd71cfce4b6223261a7b7097a6
py3: add tests in check-code to load modules from util.py

The conditionalize imports are added in util.py and now we import modules from
there. So adding tests so that someone in future can use that.
Martijn Pieters - June 27, 2016, 3:07 p.m.
This series LGTM, thanks for the extra mile adding the imports to check-code.

On 27 June 2016 at 14:46, Pulkit Goyal <7895pulkit@gmail.com> wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit@gmail.com>
> # Date 1467034830 -19800
> #      Mon Jun 27 19:10:30 2016 +0530
> # Node ID f251c4c4f77bd2be42ff69b71c74c2778febac90
> # Parent  c8e0c9bbb94c18dd71cfce4b6223261a7b7097a6
> py3: add tests in check-code to load modules from util.py
>
> The conditionalize imports are added in util.py and now we import modules from
> there. So adding tests so that someone in future can use that.
>
> diff -r c8e0c9bbb94c -r f251c4c4f77b contrib/check-code.py
> --- a/contrib/check-code.py     Mon Jun 27 16:48:54 2016 +0530
> +++ b/contrib/check-code.py     Mon Jun 27 19:10:30 2016 +0530
> @@ -325,6 +325,11 @@
>      (r'^import Queue', "don't use Queue, use util.queue + util.empty"),
>      (r'^import cStringIO', "don't use cStringIO.StringIO, use util.stringio"),
>      (r'^import urllib', "don't use urllib, use util.urlreq/util.urlerr"),
> +    (r'^import SocketServer', "don't use SockerServer, use util.socketserver"),
> +    (r'^import urlparse', "don't use urlparse, use util.urlparse"),
> +    (r'^import xmlrpclib', "don't use xmlrpclib, use util.xmlrpclib"),
> +    (r'^import cPickle', "don't use cPickle, use util.pickle"),
> +    (r'^import pickle', "don't use pickle, use util.pickle"),
>      (r'\.next\(\)', "don't use .next(), use next(...)"),
>
>      # rules depending on implementation of repquote()
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff -r c8e0c9bbb94c -r f251c4c4f77b contrib/check-code.py
--- a/contrib/check-code.py	Mon Jun 27 16:48:54 2016 +0530
+++ b/contrib/check-code.py	Mon Jun 27 19:10:30 2016 +0530
@@ -325,6 +325,11 @@ 
     (r'^import Queue', "don't use Queue, use util.queue + util.empty"),
     (r'^import cStringIO', "don't use cStringIO.StringIO, use util.stringio"),
     (r'^import urllib', "don't use urllib, use util.urlreq/util.urlerr"),
+    (r'^import SocketServer', "don't use SockerServer, use util.socketserver"),
+    (r'^import urlparse', "don't use urlparse, use util.urlparse"),
+    (r'^import xmlrpclib', "don't use xmlrpclib, use util.xmlrpclib"),
+    (r'^import cPickle', "don't use cPickle, use util.pickle"),
+    (r'^import pickle', "don't use pickle, use util.pickle"),
     (r'\.next\(\)', "don't use .next(), use next(...)"),
 
     # rules depending on implementation of repquote()