Mercurial > hg
changeset 40092:58786930ea27
tests: use environment variable indirectly
Using environment variable directly in heredoc python code will cause
syntax error at checking module importation by import-checker.py
strictly, because "$varname" is invalid in Python syntax. "$varname"
becomes valid after environment variable substitution by shell at
writing text into file.
Current import-checker.py overlooks code fragment changed in this
patch, because of a restriction below for a line starting code
fragment.
- filename must be specified before limit mark
NG: cat <<EOF > FILE.py
OK: cat > FILE.py <<EOF
import-checker.py itself is fixed in subsequent patch.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Thu, 23 Aug 2018 12:24:41 +0900 |
parents | c36846abbcd3 |
children | 726cfc47f17a |
files | tests/test-pending.t |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-pending.t Thu Aug 23 12:20:41 2018 +0900 +++ b/tests/test-pending.t Thu Aug 23 12:24:41 2018 +0900 @@ -50,7 +50,7 @@ > f = open(fpath, 'w') > f.close() > # wait for ack - caller should delete the notify file - > i = $maxwait + > i = int("$maxwait") > while os.path.exists(fpath) and i > 0: > time.sleep(1) > i -= 1