Skip to content

Commit 74ce326

Browse files
committed
[test] Travis: enforce Python 3.4 support in functional tests
Make lint/check-doc.py Python 3.4 compatible. Also add .python-version for pyenv which will cause tests with too modern syntax to fail on developer machine rather than on Travis.
1 parent ed2a2ce commit 74ce326

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.4.9

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
env:
4444
cache: false
4545
language: python
46-
python: '3.6'
46+
python: '3.4' # Oldest supported version according to doc/dependencies.md
4747
install:
4848
- set -o errexit; source .travis/lint_04_install.sh
4949
before_script:

test/lint/check-doc.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@
2626

2727

2828
def main():
29-
used = check_output(CMD_GREP_ARGS, shell=True, universal_newlines=True, encoding='utf8')
30-
docd = check_output(CMD_GREP_DOCS, shell=True, universal_newlines=True, encoding='utf8')
29+
if sys.version_info >= (3, 6):
30+
used = check_output(CMD_GREP_ARGS, shell=True, universal_newlines=True, encoding='utf8')
31+
docd = check_output(CMD_GREP_DOCS, shell=True, universal_newlines=True, encoding='utf8')
32+
else:
33+
used = check_output(CMD_GREP_ARGS, shell=True, universal_newlines=True) # encoding='utf8'
34+
docd = check_output(CMD_GREP_DOCS, shell=True, universal_newlines=True) # encoding='utf8'
3135

3236
args_used = set(re.findall(re.compile(REGEX_ARG), used))
3337
args_docd = set(re.findall(re.compile(REGEX_DOC), docd)).union(SET_DOC_OPTIONAL)

0 commit comments

Comments
 (0)