##// END OF EJS Templates
hook: add tests for failing post- python hooks...
Siddharth Agarwal -
r28107:88e309a0 default
parent child Browse files
Show More
@@ -532,6 +532,45 b' test python hooks'
532 532 adding remote bookmark quux
533 533 (run 'hg update' to get a working copy)
534 534
535 post- python hooks that fail to *run* don't cause an abort
536 $ rm ../a/.hg/hgrc
537 $ echo '[hooks]' > .hg/hgrc
538 $ echo 'post-pull.broken = python:hooktests.brokenhook' >> .hg/hgrc
539 $ hg pull ../a
540 pulling from ../a
541 searching for changes
542 no changes found
543 error: post-pull.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict'
544
545 but post- python hooks that fail to *load* do
546 $ echo '[hooks]' > .hg/hgrc
547 $ echo 'post-pull.nomodule = python:nomodule' >> .hg/hgrc
548 $ hg pull ../a
549 pulling from ../a
550 searching for changes
551 no changes found
552 abort: post-pull.nomodule hook is invalid: "nomodule" not in a module
553 [255]
554
555 $ echo '[hooks]' > .hg/hgrc
556 $ echo 'post-pull.badmodule = python:nomodule.nowhere' >> .hg/hgrc
557 $ hg pull ../a
558 pulling from ../a
559 searching for changes
560 no changes found
561 abort: post-pull.badmodule hook is invalid: import of "nomodule" failed
562 (run with --traceback for stack trace)
563 [255]
564
565 $ echo '[hooks]' > .hg/hgrc
566 $ echo 'post-pull.nohook = python:hooktests.nohook' >> .hg/hgrc
567 $ hg pull ../a
568 pulling from ../a
569 searching for changes
570 no changes found
571 abort: post-pull.nohook hook is invalid: "hooktests.nohook" is not defined
572 [255]
573
535 574 make sure --traceback works
536 575
537 576 $ echo '[hooks]' > .hg/hgrc
General Comments 0
You need to be logged in to leave comments. Login now