[PATCH 5 of 5] tests: enable import checker for all python files (including no .py files)
Augie Fackler
raf at durin42.com
Tue May 24 11:06:44 EDT 2016
On Tue, May 24, 2016 at 11:32:53PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1463276885 -32400
> # Sun May 15 10:48:05 2016 +0900
> # Node ID e14076fabb922f83d062e46971058fa0a35a4ff1
> # Parent 4d300af3b3f7fb3d4664b4fc577c4714747a03e2
> tests: enable import checker for all python files (including no .py files)
Queued these, very nice work.
>
> i18n/posplit is excluded as it couldn't be trivially fixed. That's the same
> as 99a2bdad0fda.
>
> diff --git a/contrib/import-checker.py b/contrib/import-checker.py
> --- a/contrib/import-checker.py
> +++ b/contrib/import-checker.py
> @@ -663,7 +663,7 @@ def sources(f, modname):
> the input file.
> """
> py = False
> - if f.endswith('.py'):
> + if not f.endswith('.t'):
> with open(f) as src:
> yield src.read(), modname, f, 0
> py = True
> diff --git a/tests/test-check-module-imports.t b/tests/test-check-module-imports.t
> --- a/tests/test-check-module-imports.t
> +++ b/tests/test-check-module-imports.t
> @@ -155,12 +155,13 @@ these may expose other cycles.
> Known-bad files are excluded by -X as some of them would produce unstable
> outputs, which should be fixed later.
>
> - $ hg locate '**.py' \
> + $ hg locate 'set:**.py or grep(r"^#!.*?python")' \
> > 'tests/**.t' \
> > -X contrib/debugshell.py \
> > -X contrib/win32/hgwebdir_wsgi.py \
> > -X doc/gendoc.py \
> > -X doc/hgmanpage.py \
> + > -X i18n/posplit \
> > -X tests/test-hgweb-auth.py \
> > -X tests/hypothesishelpers.py \
> > -X tests/test-ctxmanager.py \
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
More information about the Mercurial-devel
mailing list