comparison tests/run.py @ 614:4f6017ba4d3d

testrunner: use demandimport, with an option to disable it
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Fri, 14 May 2010 20:27:24 +0200
parents 58f397523604
children edd112855189
comparison
equal deleted inserted replaced
613:58f397523604 614:4f6017ba4d3d
49 dest="comprehensive", action="store_true", default=False, 49 dest="comprehensive", action="store_true", default=False,
50 help="include slow, but comprehensive tests") 50 help="include slow, but comprehensive tests")
51 parser.add_option("-v", "--verbose", 51 parser.add_option("-v", "--verbose",
52 dest="verbose", action="store_true", default=False, 52 dest="verbose", action="store_true", default=False,
53 help="enable verbose output") 53 help="enable verbose output")
54 parser.add_option("", "--no-demandimport",
55 dest="demandimport", action="store_false", default=True,
56 help="disable Mercurial demandimport loading")
54 57
55 (options, args) = parser.parse_args() 58 (options, args) = parser.parse_args()
56 59
57 if options.verbose: 60 if options.verbose:
58 testargs = { 'descriptions': 3, 'verbosity': 2 } 61 testargs = { 'descriptions': 3, 'verbosity': 2 }
59 else: 62 else:
60 testargs = {'descriptions': 2} 63 testargs = {'descriptions': 2}
64
65 if options.demandimport:
66 from mercurial import demandimport
67 demandimport.enable()
61 68
62 # silence output when running outside nose 69 # silence output when running outside nose
63 sys.stdout = os.tmpfile() 70 sys.stdout = os.tmpfile()
64 71
65 all = tests() 72 all = tests()