diff tests/hghave.py @ 52050:d1b54c152673

extdiff: don't run gui programs when in a cli-only environment In order to provide a useful error message to override the behavior, we also need to slightly change the way that tool.gui is found in the config. Before, it had to be where tool.diffargs is located, which might not exist. Now, tool.isgui can exist on its own. A test is added for the new error message. We also need to force procutil.isgui() to return true, so we set $DISPLAY to a non-empty value before running any test expecting to have a gui.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 04 Feb 2019 23:32:20 -0800
parents e679697a6ca4
children 73cf8b56c2f5
line wrap: on
line diff
--- a/tests/hghave.py	Wed Dec 28 21:33:44 2022 -0800
+++ b/tests/hghave.py	Mon Feb 04 23:32:20 2019 -0800
@@ -738,6 +738,13 @@
         return False
 
 
+@check("gui", "whether a gui environment is available or not")
+def has_gui():
+    from mercurial.utils import procutil
+
+    return procutil.gui()
+
+
 @check("test-repo", "running tests from repository")
 def has_test_repo():
     t = os.environ["TESTDIR"]