comparison tests/run-tests.py @ 31950:cc70c6dbac30

util: add a way to issue deprecation warning without a UI object Our current deprecation warning mechanism relies on ui object. They are case where we cannot have access to the UI object. On a general basis we avoid using the python mechanism for deprecation warning because up to Python 2.6 it is exposing warning to unsuspecting user who cannot do anything to deal with them. So we build a "safe" strategy to hide this warnings behind a flag in an environment variable. The test runner set this flag so that tests show these warning. This will help us marker API as deprecated for extensions to update their code.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Tue, 04 Apr 2017 11:03:29 +0200
parents 4eec2f04a672
children 8627cf4de929
comparison
equal deleted inserted replaced
31949:eaf3819631c2 31950:cc70c6dbac30
882 offset = '' if i == 0 else '%s' % i 882 offset = '' if i == 0 else '%s' % i
883 env["HGPORT%s" % offset] = '%s' % (self._startport + i) 883 env["HGPORT%s" % offset] = '%s' % (self._startport + i)
884 env = os.environ.copy() 884 env = os.environ.copy()
885 if sysconfig is not None: 885 if sysconfig is not None:
886 env['PYTHONUSERBASE'] = sysconfig.get_config_var('userbase') 886 env['PYTHONUSERBASE'] = sysconfig.get_config_var('userbase')
887 env['HGEMITWARNINGS'] = '1'
887 env['TESTTMP'] = self._testtmp 888 env['TESTTMP'] = self._testtmp
888 env['HOME'] = self._testtmp 889 env['HOME'] = self._testtmp
889 # This number should match portneeded in _getport 890 # This number should match portneeded in _getport
890 for port in xrange(3): 891 for port in xrange(3):
891 # This list should be parallel to _portmap in _getreplacements 892 # This list should be parallel to _portmap in _getreplacements