diff tests/hghave.py @ 37342:4e6a6d0dccee

tests: conditionalize tests based on presence of custom extensions The test harness supports injecting extensions via --extra-config-opt. However, if you do this, various tests that print state about loaded extensions fail. This commit teaches the test harness to recognize when custom extensions are loaded so that tests can use feature sniffing to conditionalize tests based on that. Differential Revision: https://phab.mercurial-scm.org/D3039
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 04 Apr 2018 13:21:34 -0700
parents cbc4425e81b5
children 45a4799174a1
line wrap: on
line diff
--- a/tests/hghave.py	Wed Apr 04 12:16:50 2018 -0700
+++ b/tests/hghave.py	Wed Apr 04 13:21:34 2018 -0700
@@ -718,6 +718,10 @@
     except (ImportError, AttributeError):
         return False
 
+@check('extraextensions', 'whether tests are running with extra extensions')
+def has_extraextensions():
+    return 'HGTESTEXTRAEXTENSIONS' in os.environ
+
 def getrepofeatures():
     """Obtain set of repository features in use.