Skip to content

Commit 6677863

Browse files
srittauJelleZijlstra
authored andcommitted
Run CI tests against win32 and darwin platform (#3457)
Also use Python 3.8 as default Python version for tests
1 parent 05780a0 commit 6677863

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

.travis.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dist: bionic
22
language: python
3-
python: 3.7
3+
python: 3.8
44

55
jobs:
66
include:
@@ -11,11 +11,17 @@ jobs:
1111
- name: "mypy (typed-ast)"
1212
python: 3.7
1313
install: pip install -U git+git://github.com/python/mypy git+git://github.com/python/typed_ast
14-
script: ./tests/mypy_test.py
14+
script: ./tests/mypy_test.py --platform=linux
1515
- name: "mypy (ast)"
16-
python: 3.8-dev
16+
python: 3.8
1717
install: pip install -U git+git://github.com/python/mypy
18-
script: ./tests/mypy_test.py
18+
script: ./tests/mypy_test.py --platform=linux
19+
- name: "mypy (Windows)"
20+
install: pip install -U git+git://github.com/python/mypy
21+
script: ./tests/mypy_test.py --platform=win32
22+
- name: "mypy (Darwin)"
23+
install: pip install -U git+git://github.com/python/mypy
24+
script: ./tests/mypy_test.py --platform=darwin
1925
- name: "mypy self test"
2026
script: ./tests/mypy_selftest.py
2127
- name: "check file consistency"

tests/mypy_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
parser.add_argument('-x', '--exclude', type=str, nargs='*', help="Exclude pattern")
2525
parser.add_argument('-p', '--python-version', type=str, nargs='*',
2626
help="These versions only (major[.minor])")
27+
parser.add_argument('--platform',
28+
help="Run mypy for a certain OS platform (defaults to sys.platform)")
2729
parser.add_argument('--warn-unused-ignores', action='store_true',
2830
help="Run mypy with --warn-unused-ignores "
2931
"(hint: only get rid of warnings that are "
@@ -135,6 +137,8 @@ def main():
135137
flags.append('--disallow-any-generics')
136138
if args.warn_unused_ignores:
137139
flags.append('--warn-unused-ignores')
140+
if args.platform:
141+
flags.extend(['--platform', args.platform])
138142
sys.argv = ['mypy'] + flags + files
139143
if args.verbose:
140144
print("running", ' '.join(sys.argv))

0 commit comments

Comments
 (0)