Mercurial > hg
annotate tests/test-check-pyflakes.t @ 44261:04a3ae7aba14
chg: force-set LC_CTYPE on server start to actual value from the environment
Python 3.7+ will "coerce" the LC_CTYPE variable in many instances, and this can
cause issues with chg being able to start up. D7550 attempted to fix this, but a
combination of a misreading of the way that python3.7 does the coercion and an
untested state (LC_CTYPE being set to an invalid value) meant that this was
still not quite working.
This change will cause differences between chg and hg: hg will have the LC_CTYPE
environment variable coerced, while chg will not. This is unlikely to cause any
detectable behavior differences in what Mercurial itself outputs, but it does
have two known effects:
- When using hg, the coerced LC_CTYPE will be passed to subprocesses, even
non-python ones. Using chg will remove the coercion, and this will not
happen. This is arguably more correct behavior on chg's part.
- On macOS, if you set your region to Brazil but your language to English,
this isn't representable in locale strings, so macOS sets LC_CTYPE=UTF-8. If
this value is passed along when ssh'ing to a non-macOS machine, some
functions (such as locale.setlocale()) may raise an exception due to an
unsupported locale setting. This is most easily encountered when doing an
interactive commit/split/etc. when using ui.interface=curses.
Differential Revision: https://phab.mercurial-scm.org/D8039
author | Kyle Lippincott <spectral@google.com> |
---|---|
date | Wed, 29 Jan 2020 13:39:50 -0800 |
parents | 2ade00f3b03b |
children | e397c6d74652 |
rev | line source |
---|---|
29138
a29f071751df
tests: mark test-check-pyflakes.t as requiring hg1.0+
timeless <timeless@mozdev.org>
parents:
27285
diff
changeset
|
1 #require test-repo pyflakes hg10 |
21208
0e1cbd3d52f7
tests: add repository check for pyflakes test
Matt Mackall <mpm@selenic.com>
parents:
20644
diff
changeset
|
2 |
29219
3c9066ed557c
tests: silence test-repo obsolete warning
timeless <timeless@mozdev.org>
parents:
29138
diff
changeset
|
3 $ . "$TESTDIR/helpers-testrepo.sh" |
19377
0cb996ee8c6d
tests: run pyflakes on files from manifest which could be python files
Simon Heimberg <simohe@besonet.ch>
parents:
16350
diff
changeset
|
4 |
0cb996ee8c6d
tests: run pyflakes on files from manifest which could be python files
Simon Heimberg <simohe@besonet.ch>
parents:
16350
diff
changeset
|
5 run pyflakes on all tracked files ending in .py or without a file ending |
0cb996ee8c6d
tests: run pyflakes on files from manifest which could be python files
Simon Heimberg <simohe@besonet.ch>
parents:
16350
diff
changeset
|
6 (skipping binary file random-seed) |
21208
0e1cbd3d52f7
tests: add repository check for pyflakes test
Matt Mackall <mpm@selenic.com>
parents:
20644
diff
changeset
|
7 |
33367
6029939f7e98
filterpyflakes: move self-test into test file
Augie Fackler <raf@durin42.com>
parents:
33204
diff
changeset
|
8 $ cat > test.py <<EOF |
6029939f7e98
filterpyflakes: move self-test into test file
Augie Fackler <raf@durin42.com>
parents:
33204
diff
changeset
|
9 > print(undefinedname) |
6029939f7e98
filterpyflakes: move self-test into test file
Augie Fackler <raf@durin42.com>
parents:
33204
diff
changeset
|
10 > EOF |
6029939f7e98
filterpyflakes: move self-test into test file
Augie Fackler <raf@durin42.com>
parents:
33204
diff
changeset
|
11 $ pyflakes test.py 2>/dev/null | "$TESTDIR/filterpyflakes.py" |
6029939f7e98
filterpyflakes: move self-test into test file
Augie Fackler <raf@durin42.com>
parents:
33204
diff
changeset
|
12 test.py:1: undefined name 'undefinedname' |
6029939f7e98
filterpyflakes: move self-test into test file
Augie Fackler <raf@durin42.com>
parents:
33204
diff
changeset
|
13 |
33418
1f3b54f392b0
test-check-pyflakes: do not leave test.py in the repo
Jun Wu <quark@fb.com>
parents:
33367
diff
changeset
|
14 $ cd "`dirname "$TESTDIR"`" |
33367
6029939f7e98
filterpyflakes: move self-test into test file
Augie Fackler <raf@durin42.com>
parents:
33204
diff
changeset
|
15 |
33204
ddd65b4f3ae6
tests: alias syshg and syshgenv so they can be switched conditionally
Yuya Nishihara <yuya@tcha.org>
parents:
33116
diff
changeset
|
16 $ testrepohg locate 'set:**.py or grep("^#!.*python")' \ |
33116
6c113a7dec52
tests: use the system hg for examining the local repository
Adam Simpkins <simpkins@fb.com>
parents:
32510
diff
changeset
|
17 > -X hgext/fsmonitor/pywatchman \ |
30894
5b60464efbde
tests: exclude python-zstandard from pyflakes analysis
Augie Fackler <augie@google.com>
parents:
30655
diff
changeset
|
18 > -X mercurial/pycompat.py -X contrib/python-zstandard \ |
37127
0e06d8086295
cbor: fix core test-check*
Pulkit Goyal <7895pulkit@gmail.com>
parents:
33418
diff
changeset
|
19 > -X mercurial/thirdparty/cbor \ |
37625
3ccaf995f549
tests: silence pyflakes for thirdparty/concurrent
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37182
diff
changeset
|
20 > -X mercurial/thirdparty/concurrent \ |
37182
559069689121
tests: ignore zope packages when running pyflakes
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37127
diff
changeset
|
21 > -X mercurial/thirdparty/zope \ |
29584
06587edd1233
pycompat: make pycompat demandimport friendly
Pulkit Goyal <7895pulkit@gmail.com>
parents:
29232
diff
changeset
|
22 > 2>/dev/null \ |
19377
0cb996ee8c6d
tests: run pyflakes on files from manifest which could be python files
Simon Heimberg <simohe@besonet.ch>
parents:
16350
diff
changeset
|
23 > | xargs pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py" |
43068
094d0f4a8edd
tests: allow xrange warning from perf.py
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37625
diff
changeset
|
24 contrib/perf.py:*: undefined name 'xrange' (glob) (?) |
43069
e554cfd93975
hgweb: use importlib.reload() if available
Gregory Szorc <gregory.szorc@gmail.com>
parents:
43068
diff
changeset
|
25 mercurial/hgweb/server.py:*: undefined name 'reload' (glob) (?) |
43109
f244da1fc4c6
tests: allow warning about file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
43069
diff
changeset
|
26 mercurial/util.py:*: undefined name 'file' (glob) (?) |
43496
2ade00f3b03b
encoding: add comment-based type hints for pytype
Augie Fackler <augie@google.com>
parents:
43109
diff
changeset
|
27 mercurial/encoding.py:*: undefined name 'localstr' (glob) (?) |
22053
4354b1e35f53
tests: fix pyflakes test whitespace breakage
Matt Mackall <mpm@selenic.com>
parents:
22047
diff
changeset
|
28 |