diff --git a/.travis.yml b/.travis.yml index 0a315e7668d8..3c595d768833 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ dist: bionic language: python -python: 3.7 +python: 3.8 jobs: include: @@ -11,11 +11,17 @@ jobs: - name: "mypy (typed-ast)" python: 3.7 install: pip install -U git+git://github.com/python/mypy git+git://github.com/python/typed_ast - script: ./tests/mypy_test.py + script: ./tests/mypy_test.py --platform=linux - name: "mypy (ast)" - python: 3.8-dev + python: 3.8 install: pip install -U git+git://github.com/python/mypy - script: ./tests/mypy_test.py + script: ./tests/mypy_test.py --platform=linux + - name: "mypy (Windows)" + install: pip install -U git+git://github.com/python/mypy + script: ./tests/mypy_test.py --platform=win32 + - name: "mypy (Darwin)" + install: pip install -U git+git://github.com/python/mypy + script: ./tests/mypy_test.py --platform=darwin - name: "mypy self test" script: ./tests/mypy_selftest.py - name: "check file consistency" diff --git a/tests/mypy_test.py b/tests/mypy_test.py index cba411abb8ce..48ad62e98a2e 100755 --- a/tests/mypy_test.py +++ b/tests/mypy_test.py @@ -24,6 +24,8 @@ parser.add_argument('-x', '--exclude', type=str, nargs='*', help="Exclude pattern") parser.add_argument('-p', '--python-version', type=str, nargs='*', help="These versions only (major[.minor])") +parser.add_argument('--platform', + help="Run mypy for a certain OS platform (defaults to sys.platform)") parser.add_argument('--warn-unused-ignores', action='store_true', help="Run mypy with --warn-unused-ignores " "(hint: only get rid of warnings that are " @@ -135,6 +137,8 @@ def main(): flags.append('--disallow-any-generics') if args.warn_unused_ignores: flags.append('--warn-unused-ignores') + if args.platform: + flags.extend(['--platform', args.platform]) sys.argv = ['mypy'] + flags + files if args.verbose: print("running", ' '.join(sys.argv))