comparison tests/test-config-env.py @ 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 2372284d9457
children 1864efbe90d9
comparison
equal deleted inserted replaced
43871:1390bb81163e 43872:527eba3013ea
4 4
5 import os 5 import os
6 6
7 from mercurial import ( 7 from mercurial import (
8 encoding, 8 encoding,
9 extensions,
9 rcutil, 10 rcutil,
10 ui as uimod, 11 ui as uimod,
11 util, 12 util,
12 ) 13 )
13 14
33 34
34 def userrcpath(): 35 def userrcpath():
35 return [join(b'userrc')] 36 return [join(b'userrc')]
36 37
37 38
39 extensions.wrapfunction(rcutil, 'defaultrcpath', lambda orig: [])
40
38 rcutil.systemrcpath = systemrcpath 41 rcutil.systemrcpath = systemrcpath
39 rcutil.userrcpath = userrcpath 42 rcutil.userrcpath = userrcpath
40 os.path.isdir = lambda x: False # hack: do not load default.d/*.rc
41 43
42 # utility to print configs 44 # utility to print configs
43 def printconfigs(env): 45 def printconfigs(env):
44 encoding.environ = env 46 encoding.environ = env
45 rcutil._rccomponents = None # reset cache 47 rcutil._rccomponents = None # reset cache