comparison contrib/check-code.py @ 29434:7dce56174916

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.
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 27 Jun 2016 19:10:30 +0530
parents 2a54cf92c773
children 0c741fd6158a
comparison
equal deleted inserted replaced
29433:33770d2b6cf9 29434:7dce56174916
323 (r'def.*[( ]\w+=\{\}', "don't use mutable default arguments"), 323 (r'def.*[( ]\w+=\{\}', "don't use mutable default arguments"),
324 (r'\butil\.Abort\b', "directly use error.Abort"), 324 (r'\butil\.Abort\b', "directly use error.Abort"),
325 (r'^import Queue', "don't use Queue, use util.queue + util.empty"), 325 (r'^import Queue', "don't use Queue, use util.queue + util.empty"),
326 (r'^import cStringIO', "don't use cStringIO.StringIO, use util.stringio"), 326 (r'^import cStringIO', "don't use cStringIO.StringIO, use util.stringio"),
327 (r'^import urllib', "don't use urllib, use util.urlreq/util.urlerr"), 327 (r'^import urllib', "don't use urllib, use util.urlreq/util.urlerr"),
328 (r'^import SocketServer', "don't use SockerServer, use util.socketserver"),
329 (r'^import urlparse', "don't use urlparse, use util.urlparse"),
330 (r'^import xmlrpclib', "don't use xmlrpclib, use util.xmlrpclib"),
331 (r'^import cPickle', "don't use cPickle, use util.pickle"),
332 (r'^import pickle', "don't use pickle, use util.pickle"),
328 (r'\.next\(\)', "don't use .next(), use next(...)"), 333 (r'\.next\(\)', "don't use .next(), use next(...)"),
329 334
330 # rules depending on implementation of repquote() 335 # rules depending on implementation of repquote()
331 (r' x+[xpqo%APM][\'"]\n\s+[\'"]x', 336 (r' x+[xpqo%APM][\'"]\n\s+[\'"]x',
332 'string join across lines with no space'), 337 'string join across lines with no space'),