comparison tests/test-hook.t @ 43293:d0f89e8c615a

py3: adjust expected traceback in test-hook.t In Python 3, traceback.format_exception() displays the chain of exceptions so we get extra results from our grep. Also, ModuleNotFoundError is raised instead of ImportError from Python 3.6.
author Denis Laxalde <denis.laxalde@logilab.fr>
date Fri, 18 Oct 2019 16:51:26 +0200
parents 3f1b4d1a90c3
children 40bf3d7ecc42
comparison
equal deleted inserted replaced
43292:3f1b4d1a90c3 43293:d0f89e8c615a
973 searching for changes 973 searching for changes
974 exception from first failed import attempt: 974 exception from first failed import attempt:
975 Traceback (most recent call last): 975 Traceback (most recent call last):
976 SyntaxError: * (glob) 976 SyntaxError: * (glob)
977 exception from second failed import attempt: 977 exception from second failed import attempt:
978 Traceback (most recent call last): (py3 !)
979 SyntaxError: * (glob) (py3 !)
978 Traceback (most recent call last): 980 Traceback (most recent call last):
979 ImportError: No module named hgext_syntaxerror 981 ImportError: No module named hgext_syntaxerror (no-py3 !)
982 ImportError: No module named 'hgext_syntaxerror' (py3 no-py36 !)
983 ModuleNotFoundError: No module named 'hgext_syntaxerror' (py36 !)
980 Traceback (most recent call last): 984 Traceback (most recent call last):
985 SyntaxError: * (glob) (py3 !)
986 Traceback (most recent call last): (py3 !)
987 ImportError: No module named 'hgext_syntaxerror' (py3 no-py36 !)
988 ModuleNotFoundError: No module named 'hgext_syntaxerror' (py36 !)
989 Traceback (most recent call last): (py3 !)
981 HookLoadError: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed (no-py3 !) 990 HookLoadError: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed (no-py3 !)
982 mercurial.error.HookLoadError: b'preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed' (py3 !) 991 mercurial.error.HookLoadError: b'preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed' (py3 !)
983 abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed 992 abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed
984 993
985 $ echo '[hooks]' > ../a/.hg/hgrc 994 $ echo '[hooks]' > ../a/.hg/hgrc
1131 1140
1132 $ echo a >> a 1141 $ echo a >> a
1133 $ hg --traceback commit -ma 2>&1 | egrep '^exception|ImportError|ModuleNotFoundError|Traceback|HookLoadError|abort' 1142 $ hg --traceback commit -ma 2>&1 | egrep '^exception|ImportError|ModuleNotFoundError|Traceback|HookLoadError|abort'
1134 exception from first failed import attempt: 1143 exception from first failed import attempt:
1135 Traceback (most recent call last): 1144 Traceback (most recent call last):
1136 ImportError: No module named somebogusmodule 1145 ImportError: No module named somebogusmodule (no-py3 !)
1146 ImportError: No module named 'somebogusmodule' (py3 no-py36 !)
1147 ModuleNotFoundError: No module named 'somebogusmodule' (py36 !)
1137 exception from second failed import attempt: 1148 exception from second failed import attempt:
1149 Traceback (most recent call last): (py3 !)
1150 ImportError: No module named 'somebogusmodule' (py3 no-py36 !)
1151 ModuleNotFoundError: No module named 'somebogusmodule' (py36 !)
1152 Traceback (most recent call last): (py3 !)
1153 ImportError: No module named 'hgext_importfail' (py3 no-py36 !)
1154 ModuleNotFoundError: No module named 'hgext_importfail' (py36 !)
1155 Traceback (most recent call last): (py3 !)
1156 ImportError: No module named 'somebogusmodule' (py3 no-py36 !)
1157 ModuleNotFoundError: No module named 'somebogusmodule' (py36 !)
1138 Traceback (most recent call last): 1158 Traceback (most recent call last):
1139 ImportError: No module named hgext_importfail 1159 ImportError: No module named hgext_importfail (no-py3 !)
1160 ImportError: No module named 'hgext_importfail' (py3 no-py36 !)
1161 ModuleNotFoundError: No module named 'hgext_importfail' (py36 !)
1140 Traceback (most recent call last): 1162 Traceback (most recent call last):
1141 HookLoadError: precommit.importfail hook is invalid: import of "importfail" failed (no-py3 !) 1163 HookLoadError: precommit.importfail hook is invalid: import of "importfail" failed (no-py3 !)
1142 mercurial.error.HookLoadError: b'precommit.importfail hook is invalid: import of "importfail" failed' (py3 !) 1164 mercurial.error.HookLoadError: b'precommit.importfail hook is invalid: import of "importfail" failed' (py3 !)
1143 abort: precommit.importfail hook is invalid: import of "importfail" failed 1165 abort: precommit.importfail hook is invalid: import of "importfail" failed
1144 1166