Patchwork D1162: tests: make test-extension.t's baduisetup.py test fail even if bdiff exists

login
register
mail settings
Submitter phabricator
Date Oct. 18, 2017, 12:47 p.m.
Message ID <e4df18528cd38dd29d87e7bb26a2518f@localhost.localdomain>
Download mbox | patch
Permalink /patch/25161/
State Not Applicable
Headers show

Comments

phabricator - Oct. 18, 2017, 12:47 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGdf871c41bd00: tests: make test-extension.t&#039;s baduisetup.py test fail even if bdiff exists (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1162?vs=2937&id=2973

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

AFFECTED FILES
  tests/test-extension.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-extension.t b/tests/test-extension.t
--- a/tests/test-extension.t
+++ b/tests/test-extension.t
@@ -516,21 +516,13 @@ 
 
 Make sure a broken uisetup doesn't globally break hg:
   $ cat > $TESTTMP/baduisetup.py <<EOF
-  > from mercurial import (
-  >     bdiff,
-  >     extensions,
-  > )
-  > 
-  > def blockswrapper(orig, *args, **kwargs):
-  >     return orig(*args, **kwargs)
-  > 
   > def uisetup(ui):
-  >     extensions.wrapfunction(bdiff, 'blocks', blockswrapper)
+  >     1/0
   > EOF
 
 Even though the extension fails during uisetup, hg is still basically usable:
   $ hg --config extensions.baduisetup=$TESTTMP/baduisetup.py version
-  \*\*\* failed to set up extension baduisetup: No module named (mercurial\.)?bdiff (re)
+  *** failed to set up extension baduisetup: integer division or modulo by zero
   Mercurial Distributed SCM (version *) (glob)
   (see https://mercurial-scm.org for more information)
   
@@ -542,18 +534,10 @@ 
   Traceback (most recent call last):
     File "*/mercurial/extensions.py", line *, in _runuisetup (glob)
       uisetup(ui)
-    File "$TESTTMP/baduisetup.py", line 10, in uisetup
-      extensions.wrapfunction(bdiff, 'blocks', blockswrapper)
-    File "*/mercurial/extensions.py", line *, in wrapfunction (glob)
-      origfn = getattr(container, funcname)
-    File "*/hgdemandimport/demandimportpy2.py", line *, in __getattr__ (glob)
-      self._load()
-    File "*/hgdemandimport/demandimportpy2.py", line *, in _load (glob)
-      mod = _hgextimport(_origimport, head, globals, locals, None, level)
-    File "*/hgdemandimport/demandimportpy2.py", line *, in _hgextimport (glob)
-      return importfunc(name, globals, *args, **kwargs)
-  ImportError: No module named (mercurial\.)?bdiff (re)
-  \*\*\* failed to set up extension baduisetup: No module named (mercurial\.)?bdiff (re)
+    File "$TESTTMP/baduisetup.py", line 2, in uisetup
+      1/0
+  ZeroDivisionError: integer division or modulo by zero
+  *** failed to set up extension baduisetup: integer division or modulo by zero
   Mercurial Distributed SCM (version *) (glob)
   (see https://mercurial-scm.org for more information)