changeset 43872:527eba3013ea

tests: make test-config-env.py a little less hacky Overriding os.path.isdir to always returns False is very confusing. Let's make it more explicit by specifically not returning any defaultrc/ configs. Differential Revision: https://phab.mercurial-scm.org/D7623
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 12 Dec 2019 09:59:03 -0800
parents 1390bb81163e
children 8caec25f5d8f
files tests/test-config-env.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-config-env.py	Thu Dec 12 12:57:13 2019 -0800
+++ b/tests/test-config-env.py	Thu Dec 12 09:59:03 2019 -0800
@@ -6,6 +6,7 @@
 
 from mercurial import (
     encoding,
+    extensions,
     rcutil,
     ui as uimod,
     util,
@@ -35,9 +36,10 @@
     return [join(b'userrc')]
 
 
+extensions.wrapfunction(rcutil, 'defaultrcpath', lambda orig: [])
+
 rcutil.systemrcpath = systemrcpath
 rcutil.userrcpath = userrcpath
-os.path.isdir = lambda x: False  # hack: do not load default.d/*.rc
 
 # utility to print configs
 def printconfigs(env):