tests: make test-config-env.py a little less hacky
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 12 Dec 2019 09:59:03 -0800
changeset 43872 527eba3013ea
parent 43871 1390bb81163e
child 43873 8caec25f5d8f
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
tests/test-config-env.py
--- 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):