changeset 44080: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 03dae1044edd
files tests/test-hook.t
diffstat 1 files changed, 25 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-hook.t
+++ b/tests/test-hook.t
@@ -975,9 +975,18 @@
   Traceback (most recent call last):
   SyntaxError: * (glob)
   exception from second failed import attempt:
+  Traceback (most recent call last): (py3 !)
+  SyntaxError: * (glob) (py3 !)
   Traceback (most recent call last):
-  ImportError: No module named hgext_syntaxerror
+  ImportError: No module named hgext_syntaxerror (no-py3 !)
+  ImportError: No module named 'hgext_syntaxerror' (py3 no-py36 !)
+  ModuleNotFoundError: No module named 'hgext_syntaxerror' (py36 !)
   Traceback (most recent call last):
+  SyntaxError: * (glob) (py3 !)
+  Traceback (most recent call last): (py3 !)
+  ImportError: No module named 'hgext_syntaxerror' (py3 no-py36 !)
+  ModuleNotFoundError: No module named 'hgext_syntaxerror' (py36 !)
+  Traceback (most recent call last): (py3 !)
   HookLoadError: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed (no-py3 !)
   mercurial.error.HookLoadError: b'preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed' (py3 !)
   abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed
@@ -1133,10 +1142,23 @@
   $ 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
+  ImportError: No module named somebogusmodule (no-py3 !)
+  ImportError: No module named 'somebogusmodule' (py3 no-py36 !)
+  ModuleNotFoundError: No module named 'somebogusmodule' (py36 !)
   exception from second failed import attempt:
+  Traceback (most recent call last): (py3 !)
+  ImportError: No module named 'somebogusmodule' (py3 no-py36 !)
+  ModuleNotFoundError: No module named 'somebogusmodule' (py36 !)
+  Traceback (most recent call last): (py3 !)
+  ImportError: No module named 'hgext_importfail' (py3 no-py36 !)
+  ModuleNotFoundError: No module named 'hgext_importfail' (py36 !)
+  Traceback (most recent call last): (py3 !)
+  ImportError: No module named 'somebogusmodule' (py3 no-py36 !)
+  ModuleNotFoundError: No module named 'somebogusmodule' (py36 !)
   Traceback (most recent call last):
-  ImportError: No module named hgext_importfail
+  ImportError: No module named hgext_importfail (no-py3 !)
+  ImportError: No module named 'hgext_importfail' (py3 no-py36 !)
+  ModuleNotFoundError: No module named 'hgext_importfail' (py36 !)
   Traceback (most recent call last):
   HookLoadError: precommit.importfail hook is invalid: import of "importfail" failed (no-py3 !)
   mercurial.error.HookLoadError: b'precommit.importfail hook is invalid: import of "importfail" failed' (py3 !)