[PATCH 3 of 4] tests: use non-reverse grep in traceback in test-hook.t

Denis Laxalde denis at laxalde.org
Fri Oct 18 10:52:24 EDT 2019


# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1571409517 -7200
#      Fri Oct 18 16:38:37 2019 +0200
# Node ID a2e16cda007faf54c2674db8de0eaf30faa15206
# Parent  4b3b99d99919d5140c5311975e142408627e61fa
tests: use non-reverse grep in traceback in test-hook.t

This will prepare for updating test output for Python 3.

diff --git a/tests/test-hook.t b/tests/test-hook.t
index 1eeb537..38a960d 100644
--- a/tests/test-hook.t
+++ b/tests/test-hook.t
@@ -968,9 +968,7 @@ test python hooks
   (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 @@ make sure --traceback works on hook impo
   $ 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


More information about the Mercurial-devel mailing list