mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Add new semantic analyzer to mypy tests (#3037)
This also removes two redundant definitions in curses/__init__.pyi star-imported from _curses.
This commit is contained in:
@@ -13,8 +13,16 @@ matrix:
|
||||
env:
|
||||
- TEST_CMD="./tests/mypy_test.py"
|
||||
- INSTALL="mypy"
|
||||
- name: "mypy new analyzer"
|
||||
env:
|
||||
- TEST_CMD="./tests/mypy_test.py -a"
|
||||
- INSTALL="mypy"
|
||||
- name: "mypy self test"
|
||||
env: TEST_CMD="./tests/mypy_selftest.py"
|
||||
- name: "mypy self test (new analyzer)"
|
||||
env:
|
||||
- NEWSEMANAL=1
|
||||
- TEST_CMD="./tests/mypy_selftest.py"
|
||||
- name: "check file consistency"
|
||||
env: TEST_CMD="./tests/check_consistent.py"
|
||||
- name: "flake8"
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import _curses
|
||||
from _curses import * # noqa: F403
|
||||
from typing import TypeVar, Callable, Any, Sequence, Mapping
|
||||
from typing import TypeVar, Callable, Any
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
LINES: int
|
||||
COLS: int
|
||||
|
||||
def initscr() -> _curses._CursesWindow: ...
|
||||
def start_color() -> None: ...
|
||||
def wrapper(func: Callable[..., _T], *arg: Any, **kwds: Any) -> _T: ...
|
||||
|
||||
@@ -21,6 +21,7 @@ parser = argparse.ArgumentParser(description="Test runner for typeshed. "
|
||||
"Patterns are unanchored regexps on the full path.")
|
||||
parser.add_argument('-v', '--verbose', action='count', default=0, help="More output")
|
||||
parser.add_argument('-n', '--dry-run', action='store_true', help="Don't actually run mypy")
|
||||
parser.add_argument('-a', '--new-analyzer', action='store_true', help="Use new mypy semantic analyzer")
|
||||
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])")
|
||||
@@ -132,6 +133,8 @@ def main():
|
||||
flags.append('--no-site-packages')
|
||||
flags.append('--show-traceback')
|
||||
flags.append('--no-implicit-optional')
|
||||
if args.new_analyzer:
|
||||
flags.append('--new-semantic-analyzer')
|
||||
if args.warn_unused_ignores:
|
||||
flags.append('--warn-unused-ignores')
|
||||
sys.argv = ['mypy'] + flags + files
|
||||
|
||||
Reference in New Issue
Block a user