diff 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
line wrap: on
line diff
--- a/tests/run-tests.py	Thu Apr 13 09:49:48 2017 +0200
+++ b/tests/run-tests.py	Tue Apr 04 11:03:29 2017 +0200
@@ -884,6 +884,7 @@
         env = os.environ.copy()
         if sysconfig is not None:
             env['PYTHONUSERBASE'] = sysconfig.get_config_var('userbase')
+        env['HGEMITWARNINGS'] = '1'
         env['TESTTMP'] = self._testtmp
         env['HOME'] = self._testtmp
         # This number should match portneeded in _getport