tests: use non-reverse grep in traceback in test-hook.t
authorDenis Laxalde <denis.laxalde@logilab.fr>
Fri, 18 Oct 2019 16:38:37 +0200
changeset 43292 3f1b4d1a90c3
parent 43291 a973a75e92bf
child 43293 d0f89e8c615a
tests: use non-reverse grep in traceback in test-hook.t This will prepare for updating test output for Python 3.
tests/test-hook.t
--- a/tests/test-hook.t	Fri Oct 18 11:44:44 2019 +0200
+++ b/tests/test-hook.t	Fri Oct 18 16:38:37 2019 +0200
@@ -968,9 +968,7 @@
   (run with --traceback for stack trace)
   [255]
 
-The second egrep is to filter out lines like '    ^', which are slightly
-different between Python 2.6 and Python 2.7.
-  $ hg pull ../a --traceback 2>&1 | egrep -v '^( +File|    [_a-zA-Z*(])' | egrep -v '^( )+(\^)?$'
+  $ hg pull ../a --traceback 2>&1 | egrep 'pulling|searching|^exception|Traceback|SyntaxError|ImportError|ModuleNotFoundError|HookLoadError|abort'
   pulling from ../a
   searching for changes
   exception from first failed import attempt:
@@ -1132,7 +1130,7 @@
   $ echo 'precommit.importfail = python:importfail.whatever' >> .hg/hgrc
 
   $ echo a >> a
-  $ hg --traceback commit -ma 2>&1 | egrep -v '^( +File|    [a-zA-Z(])'
+  $ hg --traceback commit -ma 2>&1 | egrep '^exception|ImportError|ModuleNotFoundError|Traceback|HookLoadError|abort'
   exception from first failed import attempt:
   Traceback (most recent call last):
   ImportError: No module named somebogusmodule