Patchwork D7623: tests: make test-config-env.py a little less hacky

login
register
mail settings
Submitter phabricator
Date Dec. 12, 2019, 11:44 p.m.
Message ID <differential-rev-PHID-DREV-t6ophsnbp2xrhafx2ley-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43764/
State Superseded
Headers show

Comments

phabricator - Dec. 12, 2019, 11:44 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Overriding os.path.isdir to always returns False is very
  confusing. Let's make it more explicit by specifically not returning
  any defaultrc/ configs.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D7623

AFFECTED FILES
  tests/test-config-env.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-config-env.py b/tests/test-config-env.py
--- a/tests/test-config-env.py
+++ b/tests/test-config-env.py
@@ -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):