# HG changeset patch # User Simon Farnsworth # Date 2016-02-12 14:25:05 # Node ID 550097d01ca3573626ae2eebe6c63b53f6084cde # Parent db90cb1e89c8b7aa5cba363ba2f8d9c08fd5e07e tests: confirm that a badly documented extension doesn't cause a crash An external extension whose docstring doesn't conform to Mercurial standards used to cause crashes. Test that we omit such extensions when you do a keyword search. diff --git a/tests/test-bad-extension.t b/tests/test-bad-extension.t --- a/tests/test-bad-extension.t +++ b/tests/test-bad-extension.t @@ -1,11 +1,19 @@ $ echo 'raise Exception("bit bucket overflow")' > badext.py - $ abspath=`pwd`/badext.py + $ abspathexc=`pwd`/badext.py + + $ cat >baddocext.py < """ + > baddocext is bad + > """ + > EOF + $ abspathdoc=`pwd`/baddocext.py $ cat <> $HGRCPATH > [extensions] > gpg = > hgext.gpg = - > badext = $abspath + > badext = $abspathexc + > baddocext = $abspathdoc > badext2 = > EOF @@ -38,3 +46,12 @@ show traceback for ImportError of hgext. *** failed to import extension badext2: No module named badext2 Traceback (most recent call last): ImportError: No module named badext2 + +confirm that there's no crash when an extension's documentation is bad + + $ hg help --keyword baddocext + *** failed to import extension badext from $TESTTMP/badext.py: bit bucket overflow + *** failed to import extension badext2: No module named badext2 + Topics: + + extensions Using Additional Features