##// END OF EJS Templates
tests: make test-extension.t's baduisetup.py test fail even if bdiff exists...
Martin von Zweigbergk -
r34844:df871c41 default
parent child Browse files
Show More
@@ -516,21 +516,13 b' See also issue5208 for detail about exam'
516
516
517 Make sure a broken uisetup doesn't globally break hg:
517 Make sure a broken uisetup doesn't globally break hg:
518 $ cat > $TESTTMP/baduisetup.py <<EOF
518 $ cat > $TESTTMP/baduisetup.py <<EOF
519 > from mercurial import (
520 > bdiff,
521 > extensions,
522 > )
523 >
524 > def blockswrapper(orig, *args, **kwargs):
525 > return orig(*args, **kwargs)
526 >
527 > def uisetup(ui):
519 > def uisetup(ui):
528 > extensions.wrapfunction(bdiff, 'blocks', blockswrapper)
520 > 1/0
529 > EOF
521 > EOF
530
522
531 Even though the extension fails during uisetup, hg is still basically usable:
523 Even though the extension fails during uisetup, hg is still basically usable:
532 $ hg --config extensions.baduisetup=$TESTTMP/baduisetup.py version
524 $ hg --config extensions.baduisetup=$TESTTMP/baduisetup.py version
533 \*\*\* failed to set up extension baduisetup: No module named (mercurial\.)?bdiff (re)
525 *** failed to set up extension baduisetup: integer division or modulo by zero
534 Mercurial Distributed SCM (version *) (glob)
526 Mercurial Distributed SCM (version *) (glob)
535 (see https://mercurial-scm.org for more information)
527 (see https://mercurial-scm.org for more information)
536
528
@@ -542,18 +534,10 b' Even though the extension fails during u'
542 Traceback (most recent call last):
534 Traceback (most recent call last):
543 File "*/mercurial/extensions.py", line *, in _runuisetup (glob)
535 File "*/mercurial/extensions.py", line *, in _runuisetup (glob)
544 uisetup(ui)
536 uisetup(ui)
545 File "$TESTTMP/baduisetup.py", line 10, in uisetup
537 File "$TESTTMP/baduisetup.py", line 2, in uisetup
546 extensions.wrapfunction(bdiff, 'blocks', blockswrapper)
538 1/0
547 File "*/mercurial/extensions.py", line *, in wrapfunction (glob)
539 ZeroDivisionError: integer division or modulo by zero
548 origfn = getattr(container, funcname)
540 *** failed to set up extension baduisetup: integer division or modulo by zero
549 File "*/hgdemandimport/demandimportpy2.py", line *, in __getattr__ (glob)
550 self._load()
551 File "*/hgdemandimport/demandimportpy2.py", line *, in _load (glob)
552 mod = _hgextimport(_origimport, head, globals, locals, None, level)
553 File "*/hgdemandimport/demandimportpy2.py", line *, in _hgextimport (glob)
554 return importfunc(name, globals, *args, **kwargs)
555 ImportError: No module named (mercurial\.)?bdiff (re)
556 \*\*\* failed to set up extension baduisetup: No module named (mercurial\.)?bdiff (re)
557 Mercurial Distributed SCM (version *) (glob)
541 Mercurial Distributed SCM (version *) (glob)
558 (see https://mercurial-scm.org for more information)
542 (see https://mercurial-scm.org for more information)
559
543
General Comments 0
You need to be logged in to leave comments. Login now