diff --git a/run_test.sh b/run_test.sh index 01c4930..b0b0886 100755 --- a/run_test.sh +++ b/run_test.sh @@ -169,7 +169,8 @@ for PY_VER in $PY_VER_UNIT_TESTS; do # Write output to file. Make variant w/ omitted line numbers for easy diffing / CR PY_VER_MYPY_TARGET=$(echo "$1" | cut -d. -f1-2) export MYPYPATH=$MYPYPATH:test/generated - mypy --custom-typeshed-dir="$CUSTOM_TYPESHED_DIR" --python-executable="venv_$1/bin/python" --python-version="$PY_VER_MYPY_TARGET" "${@: 2}" > "$MYPY_OUTPUT/mypy_output" || true + # Use --no-incremental to avoid caching issues: https://github.com/python/mypy/issues/16363 + mypy --custom-typeshed-dir="$CUSTOM_TYPESHED_DIR" --python-executable="venv_$1/bin/python" --no-incremental --python-version="$PY_VER_MYPY_TARGET" "${@: 2}" > "$MYPY_OUTPUT/mypy_output" || true cut -d: -f1,3- "$MYPY_OUTPUT/mypy_output" > "$MYPY_OUTPUT/mypy_output.omit_linenos" } diff --git a/test_negative/output.expected.3.8 b/test_negative/output.expected.3.8 index 0153adf..c9d4c1b 100644 --- a/test_negative/output.expected.3.8 +++ b/test_negative/output.expected.3.8 @@ -74,7 +74,7 @@ test_negative/negative.py:179: error: "_r_None" has no attribute "invalid"; mayb test_negative/negative.py:183: error: Incompatible types in assignment (expression has type "ValueType", variable has type "str") [assignment] test_negative/negative.py:185: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] test_negative/negative.py:185: note: Possible overload variants: -test_negative/negative.py:185: note: def [_MTVDummyService0 in (UnaryUnaryMultiCallable[DummyRequest, DummyReply], UnaryUnaryMultiCallable[DummyRequest, DummyReply]), _MTVDummyService1 in (UnaryStreamMultiCallable[DummyRequest, DummyReply], UnaryStreamMultiCallable[DummyRequest, DummyReply]), _MTVDummyService2 in (StreamUnaryMultiCallable[DummyRequest, DummyReply], StreamUnaryMultiCallable[DummyRequest, DummyReply]), _MTVDummyService3 in (StreamStreamMultiCallable[DummyRequest, DummyReply], StreamStreamMultiCallable[DummyRequest, DummyReply])] DummyServiceStub(self, channel: Channel) -> DummyServiceStub[UnaryUnaryMultiCallable[DummyRequest, DummyReply], UnaryStreamMultiCallable[DummyRequest, DummyReply], StreamUnaryMultiCallable[DummyRequest, DummyReply], StreamStreamMultiCallable[DummyRequest, DummyReply]] +test_negative/negative.py:185: note: def [_MTVDummyService0 in (UnaryUnaryMultiCallable[DummyRequest, DummyReply], UnaryUnaryMultiCallable[DummyRequest, DummyReply]), _MTVDummyService1 in (UnaryStreamMultiCallable[DummyRequest, DummyReply], UnaryStreamMultiCallable[DummyRequest, DummyReply]), _MTVDummyService2 in (StreamUnaryMultiCallable[DummyRequest, DummyReply], StreamUnaryMultiCallable[DummyRequest, DummyReply]), _MTVDummyService3 in (StreamStreamMultiCallable[DummyRequest, DummyReply], StreamStreamMultiCallable[DummyRequest, DummyReply])] __init__(self, channel: Channel) -> DummyServiceStub[UnaryUnaryMultiCallable[DummyRequest, DummyReply], UnaryStreamMultiCallable[DummyRequest, DummyReply], StreamUnaryMultiCallable[DummyRequest, DummyReply], StreamStreamMultiCallable[DummyRequest, DummyReply]] test_negative/negative.py:192: error: "DummyReply" has no attribute "not_exists" [attr-defined] test_negative/negative.py:193: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] test_negative/negative.py:198: error: "DummyReply" has no attribute "not_exists" [attr-defined] diff --git a/test_negative/output.expected.3.8.omit_linenos b/test_negative/output.expected.3.8.omit_linenos index 5e7a04a..d8ea051 100644 --- a/test_negative/output.expected.3.8.omit_linenos +++ b/test_negative/output.expected.3.8.omit_linenos @@ -74,7 +74,7 @@ test_negative/negative.py: error: "_r_None" has no attribute "invalid"; maybe "v test_negative/negative.py: error: Incompatible types in assignment (expression has type "ValueType", variable has type "str") [assignment] test_negative/negative.py: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] test_negative/negative.py: note: Possible overload variants: -test_negative/negative.py: note: def [_MTVDummyService0 in (UnaryUnaryMultiCallable[DummyRequest, DummyReply], UnaryUnaryMultiCallable[DummyRequest, DummyReply]), _MTVDummyService1 in (UnaryStreamMultiCallable[DummyRequest, DummyReply], UnaryStreamMultiCallable[DummyRequest, DummyReply]), _MTVDummyService2 in (StreamUnaryMultiCallable[DummyRequest, DummyReply], StreamUnaryMultiCallable[DummyRequest, DummyReply]), _MTVDummyService3 in (StreamStreamMultiCallable[DummyRequest, DummyReply], StreamStreamMultiCallable[DummyRequest, DummyReply])] DummyServiceStub(self, channel: Channel) -> DummyServiceStub[UnaryUnaryMultiCallable[DummyRequest, DummyReply], UnaryStreamMultiCallable[DummyRequest, DummyReply], StreamUnaryMultiCallable[DummyRequest, DummyReply], StreamStreamMultiCallable[DummyRequest, DummyReply]] +test_negative/negative.py: note: def [_MTVDummyService0 in (UnaryUnaryMultiCallable[DummyRequest, DummyReply], UnaryUnaryMultiCallable[DummyRequest, DummyReply]), _MTVDummyService1 in (UnaryStreamMultiCallable[DummyRequest, DummyReply], UnaryStreamMultiCallable[DummyRequest, DummyReply]), _MTVDummyService2 in (StreamUnaryMultiCallable[DummyRequest, DummyReply], StreamUnaryMultiCallable[DummyRequest, DummyReply]), _MTVDummyService3 in (StreamStreamMultiCallable[DummyRequest, DummyReply], StreamStreamMultiCallable[DummyRequest, DummyReply])] __init__(self, channel: Channel) -> DummyServiceStub[UnaryUnaryMultiCallable[DummyRequest, DummyReply], UnaryStreamMultiCallable[DummyRequest, DummyReply], StreamUnaryMultiCallable[DummyRequest, DummyReply], StreamStreamMultiCallable[DummyRequest, DummyReply]] test_negative/negative.py: error: "DummyReply" has no attribute "not_exists" [attr-defined] test_negative/negative.py: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] test_negative/negative.py: error: "DummyReply" has no attribute "not_exists" [attr-defined]