Patchwork [2,of,5] test-module-imports: pass mercurial/__version__.py to checker

login
register
mail settings
Submitter Jun Wu
Date Feb. 24, 2016, 10:30 p.m.
Message ID <0f9e0de14b62ea174bf0.1456353013@x1c>
Download mbox | patch
Permalink /patch/13374/
State Changes Requested
Delegated to: Yuya Nishihara
Headers show

Comments

Jun Wu - Feb. 24, 2016, 10:30 p.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1456351726 0
#      Wed Feb 24 22:08:46 2016 +0000
# Node ID 0f9e0de14b62ea174bf0af8284a17ef6801ca2ae
# Parent  fbc26e0249811675aaa764b7c74fabc46cd421e5
test-module-imports: pass mercurial/__version__.py to checker

Before this patch, 'from mercurial import __version__' will fail the test
because mercurial/__version__.py is in hgignore and the test uses 'hg locate'
to find .py files.

The patch fixes it by explicitly pass mercurial/__version__.py to the checker.
Yuya Nishihara - Feb. 25, 2016, 2:34 p.m.
On Wed, 24 Feb 2016 22:30:13 +0000, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark@fb.com>
> # Date 1456351726 0
> #      Wed Feb 24 22:08:46 2016 +0000
> # Node ID 0f9e0de14b62ea174bf0af8284a17ef6801ca2ae
> # Parent  fbc26e0249811675aaa764b7c74fabc46cd421e5
> test-module-imports: pass mercurial/__version__.py to checker
> 
> Before this patch, 'from mercurial import __version__' will fail the test
> because mercurial/__version__.py is in hgignore and the test uses 'hg locate'
> to find .py files.
> 
> The patch fixes it by explicitly pass mercurial/__version__.py to the checker.

hg should run without __version__.py. So it would be wrong to import
__version__ mandatory.

Patch

diff --git a/tests/test-module-imports.t b/tests/test-module-imports.t
--- a/tests/test-module-imports.t
+++ b/tests/test-module-imports.t
@@ -141,6 +141,6 @@ 
 hidden by deduplication algorithm in the cycle detector, so fixing
 these may expose other cycles.
 
-  $ hg locate 'mercurial/**.py' 'hgext/**.py' | sed 's-\\-/-g' | python "$import_checker" -
+  $ (hg locate 'mercurial/**.py' 'hgext/**.py' | sed 's-\\-/-g'; echo mercurial/__version__.py) | python "$import_checker" -
   Import cycle: hgext.largefiles.basestore -> hgext.largefiles.localstore -> hgext.largefiles.basestore
   [1]