changeset 43732:2d8d4e08c493

tests: verify that Python scripts are blackened Scripts are Python too. They should be blackened. (As suggested by Pierre-Yves in D7420.) Differential Revision: https://phab.mercurial-scm.org/D7447
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 16 Nov 2019 11:54:39 -0800
parents 47ef023d0165
children f0b33e5f0cf4
files tests/test-check-format.t tests/test-check-shbang.t
diffstat 2 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-check-format.t	Sat Nov 16 11:53:47 2019 -0800
+++ b/tests/test-check-format.t	Sat Nov 16 11:54:39 2019 -0800
@@ -1,5 +1,5 @@
 #require black
 
   $ cd $RUNTESTDIR/..
-  $ black --config=black.toml --check --diff `hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**"'`
+  $ black --config=black.toml --check --diff `hg files 'set:(**.py + grep("^#!.*python")) - mercurial/thirdparty/** - "contrib/python-zstandard/**"'`
 
--- a/tests/test-check-shbang.t	Sat Nov 16 11:53:47 2019 -0800
+++ b/tests/test-check-shbang.t	Sat Nov 16 11:54:39 2019 -0800
@@ -11,6 +11,7 @@
 In tests, enforce $PYTHON and *not* /usr/bin/env python or similar:
   $ testrepohg files 'set:grep(r"#!.*?python") and **/*.t' \
   > -X tests/test-check-execute.t \
+  > -X tests/test-check-format.t \
   > -X tests/test-check-module-imports.t \
   > -X tests/test-check-pyflakes.t \
   > -X tests/test-check-shbang.t