Patchwork tests: allow ModuleNotFoundError in addition to ImportError

login
register
mail settings
Submitter via Mercurial-devel
Date March 17, 2017, 5:06 p.m.
Message ID <0308a2a076f5e9591c3f.1489770360@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/19425/
State Accepted
Headers show

Comments

via Mercurial-devel - March 17, 2017, 5:06 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1489769929 25200
#      Fri Mar 17 09:58:49 2017 -0700
# Node ID 0308a2a076f5e9591c3f4b6da8f42a96eb6ec2d4
# Parent  d1ce2124ec83d3eef61aa0e6b7ef89c738a5d8fe
tests: allow ModuleNotFoundError in addition to ImportError

My environment (Python version? PYTHONPATH? something else?) raises
ModuleNotFoundError in test-check-py3-compat.t. This patch allows any
"*Error". The error string contains "error importing", so it seems
specific enough even after.
Yuya Nishihara - March 18, 2017, 5:08 a.m.
On Fri, 17 Mar 2017 10:06:00 -0700, Martin von Zweigbergk via Mercurial-devel wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1489769929 25200
> #      Fri Mar 17 09:58:49 2017 -0700
> # Node ID 0308a2a076f5e9591c3f4b6da8f42a96eb6ec2d4
> # Parent  d1ce2124ec83d3eef61aa0e6b7ef89c738a5d8fe
> tests: allow ModuleNotFoundError in addition to ImportError

Seems fine, queued, thanks.

Patch

diff -r d1ce2124ec83 -r 0308a2a076f5 tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t	Thu Mar 16 14:27:41 2017 -0700
+++ b/tests/test-check-py3-compat.t	Fri Mar 17 09:58:49 2017 -0700
@@ -22,15 +22,15 @@ 
   $ hg files 'set:(**.py) - grep(pygments)' -X hgext/fsmonitor/pywatchman \
   > | sed 's|\\|/|g' | xargs $PYTHON3 contrib/check-py3-compat.py \
   > | sed 's/[0-9][0-9]*)$/*)/'
-  hgext/convert/transport.py: error importing: <ImportError> No module named 'svn.client' (error at transport.py:*)
+  hgext/convert/transport.py: error importing: <*Error> No module named 'svn.client' (error at transport.py:*) (glob)
   hgext/fsmonitor/state.py: error importing: <SyntaxError> from __future__ imports must occur at the beginning of the file (__init__.py, line 30) (error at watchmanclient.py:*)
   hgext/fsmonitor/watchmanclient.py: error importing: <SyntaxError> from __future__ imports must occur at the beginning of the file (__init__.py, line 30) (error at watchmanclient.py:*)
-  mercurial/cffi/bdiff.py: error importing: <ImportError> No module named 'mercurial.cffi' (error at check-py3-compat.py:*)
-  mercurial/cffi/mpatch.py: error importing: <ImportError> No module named 'mercurial.cffi' (error at check-py3-compat.py:*)
-  mercurial/cffi/osutil.py: error importing: <ImportError> No module named 'mercurial.cffi' (error at check-py3-compat.py:*)
-  mercurial/scmwindows.py: error importing: <ImportError> No module named 'msvcrt' (error at win32.py:*)
-  mercurial/win32.py: error importing: <ImportError> No module named 'msvcrt' (error at win32.py:*)
-  mercurial/windows.py: error importing: <ImportError> No module named 'msvcrt' (error at windows.py:*)
+  mercurial/cffi/bdiff.py: error importing: <*Error> No module named 'mercurial.cffi' (error at check-py3-compat.py:*) (glob)
+  mercurial/cffi/mpatch.py: error importing: <*Error> No module named 'mercurial.cffi' (error at check-py3-compat.py:*) (glob)
+  mercurial/cffi/osutil.py: error importing: <*Error> No module named 'mercurial.cffi' (error at check-py3-compat.py:*) (glob)
+  mercurial/scmwindows.py: error importing: <*Error> No module named 'msvcrt' (error at win32.py:*) (glob)
+  mercurial/win32.py: error importing: <*Error> No module named 'msvcrt' (error at win32.py:*) (glob)
+  mercurial/windows.py: error importing: <*Error> No module named 'msvcrt' (error at windows.py:*) (glob)
 
 #endif