Skip to content

Commit

Permalink
[test] Travis: enforce Python 3.4 support in functional tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Sjors committed Dec 12, 2018
1 parent ed2a2ce commit 74ce326
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.4.9
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
env:
cache: false
language: python
python: '3.6'
python: '3.4' # Oldest supported version according to doc/dependencies.md
install:
- set -o errexit; source .travis/lint_04_install.sh
before_script:
Expand Down
8 changes: 6 additions & 2 deletions test/lint/check-doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@


def main():
used = check_output(CMD_GREP_ARGS, shell=True, universal_newlines=True, encoding='utf8')
docd = check_output(CMD_GREP_DOCS, shell=True, universal_newlines=True, encoding='utf8')
if sys.version_info >= (3, 6):
used = check_output(CMD_GREP_ARGS, shell=True, universal_newlines=True, encoding='utf8')
docd = check_output(CMD_GREP_DOCS, shell=True, universal_newlines=True, encoding='utf8')
else:
used = check_output(CMD_GREP_ARGS, shell=True, universal_newlines=True) # encoding='utf8'
docd = check_output(CMD_GREP_DOCS, shell=True, universal_newlines=True) # encoding='utf8'

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

0 comments on commit 74ce326

Please sign in to comment.