From a08c97269d5c9903dd4cd037ed2565ce67d47683 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 28 Nov 2022 13:20:07 -0500 Subject: [PATCH 1/4] ignore-without-code & warn-unused-ignores --- pyrightconfig.testcases.json | 3 +-- test_cases/stdlib/builtins/check_dict.py | 6 ++--- test_cases/stdlib/builtins/check_pow.py | 12 ++++----- test_cases/stdlib/builtins/check_round.py | 8 +++--- test_cases/stdlib/builtins/check_sum.py | 12 ++++----- test_cases/stdlib/check_codecs.py | 2 +- test_cases/stdlib/check_unittest.py | 30 +++++++++++------------ tests/mypy_test.py | 1 + tests/regr_test.py | 2 ++ 9 files changed, 39 insertions(+), 37 deletions(-) diff --git a/pyrightconfig.testcases.json b/pyrightconfig.testcases.json index 0e0ec73f0395..b7051148d366 100644 --- a/pyrightconfig.testcases.json +++ b/pyrightconfig.testcases.json @@ -45,7 +45,6 @@ "reportIncompatibleMethodOverride": "error", "reportIncompatibleVariableOverride": "error", "reportOverlappingOverload": "error", + "reportMatchNotExhaustive": "error", "reportUnnecessaryTypeIgnoreComment": "error", - "reportMissingTypeStubs": "error", - "reportMatchNotExhaustive": "error" } diff --git a/test_cases/stdlib/builtins/check_dict.py b/test_cases/stdlib/builtins/check_dict.py index 2161bb2647eb..2a7bc964fc8e 100644 --- a/test_cases/stdlib/builtins/check_dict.py +++ b/test_cases/stdlib/builtins/check_dict.py @@ -29,7 +29,7 @@ def __getitem__(self, __k: _KT) -> _VT: kt1: KeysAndGetItem[int, str] = KeysAndGetItem() assert_type(dict(kt1), Dict[int, str]) -dict(kt1, arg="a") # type: ignore +dict(kt1, arg="a") # type: ignore[arg-type] kt2: KeysAndGetItem[str, int] = KeysAndGetItem() assert_type(dict(kt2, arg=1), Dict[str, int]) @@ -41,11 +41,11 @@ def test_iterable_tuple_overload(x: Iterable[tuple[int, str]]) -> dict[int, str] i1: Iterable[tuple[int, str]] = [(1, "a"), (2, "b")] test_iterable_tuple_overload(i1) -dict(i1, arg="a") # type: ignore +dict(i1, arg="a") # type: ignore[arg-type] i2: Iterable[tuple[str, int]] = [("a", 1), ("b", 2)] assert_type(dict(i2, arg=1), Dict[str, int]) i3: Iterable[str] = ["a.b"] assert_type(dict(string.split(".") for string in i3), Dict[str, str]) -dict(["foo", "bar", "baz"]) # type: ignore +dict(["foo", "bar", "baz"]) # type: ignore[arg-type] diff --git a/test_cases/stdlib/builtins/check_pow.py b/test_cases/stdlib/builtins/check_pow.py index da06229f4d49..b634cc20e6dd 100644 --- a/test_cases/stdlib/builtins/check_pow.py +++ b/test_cases/stdlib/builtins/check_pow.py @@ -80,12 +80,12 @@ assert_type((-95) ** 8.42, Any) # All of the following cases should fail a type-checker. -pow(1.9, 4, 6) # type: ignore -pow(4, 7, 4.32) # type: ignore -pow(6.2, 5.9, 73) # type: ignore -pow(complex(6), 6.2, 7) # type: ignore -pow(Fraction(), 5, 8) # type: ignore -Decimal("8.7") ** 3.14 # type: ignore +pow(1.9, 4, 6) # type: ignore[misc] +pow(4, 7, 4.32) # type: ignore[misc] +pow(6.2, 5.9, 73) # type: ignore[misc] +pow(complex(6), 6.2, 7) # type: ignore[misc] +pow(Fraction(), 5, 8) # type: ignore[call-overload] +Decimal("8.7") ** 3.14 # type: ignore[operator] # TODO: This fails at runtime, but currently passes mypy and pyright: pow(Decimal("8.5"), 3.21) diff --git a/test_cases/stdlib/builtins/check_round.py b/test_cases/stdlib/builtins/check_round.py index 2648208bf7c6..a528e5fd99c3 100644 --- a/test_cases/stdlib/builtins/check_round.py +++ b/test_cases/stdlib/builtins/check_round.py @@ -36,8 +36,8 @@ def __round__(self) -> str: assert_type(round(WithCustomRound1()), str) assert_type(round(WithCustomRound1(), None), str) # Errors: -round(WithCustomRound1(), 1) # type: ignore -round(WithCustomRound1(), CustomIndex()) # type: ignore +round(WithCustomRound1(), 1) # type: ignore[call-overload] +round(WithCustomRound1(), CustomIndex()) # type: ignore[call-overload] class WithCustomRound2: @@ -48,8 +48,8 @@ def __round__(self, digits: int) -> str: assert_type(round(WithCustomRound2(), 1), str) assert_type(round(WithCustomRound2(), CustomIndex()), str) # Errors: -round(WithCustomRound2(), None) # type: ignore -round(WithCustomRound2()) # type: ignore +round(WithCustomRound2(), None) # type: ignore[call-overload] +round(WithCustomRound2()) # type: ignore[call-overload] class WithOverloadedRound: diff --git a/test_cases/stdlib/builtins/check_sum.py b/test_cases/stdlib/builtins/check_sum.py index 1228ff13b45d..79fc8fc1b893 100644 --- a/test_cases/stdlib/builtins/check_sum.py +++ b/test_cases/stdlib/builtins/check_sum.py @@ -43,12 +43,12 @@ def __radd__(self, other: Any) -> Baz: sum([2.5, 5.8], 5) # mypy: `float`; pyright: `float | int` # These all fail at runtime -sum("abcde") # type: ignore -sum([["foo"], ["bar"]]) # type: ignore -sum([("foo",), ("bar", "baz")]) # type: ignore -sum([Foo(), Foo()]) # type: ignore -sum([Bar(), Bar()], Bar()) # type: ignore -sum([Bar(), Bar()]) # type: ignore +sum("abcde") # type: ignore[arg-type] +sum([["foo"], ["bar"]]) # type: ignore[list-item] +sum([("foo",), ("bar", "baz")]) # type: ignore[list-item] +sum([Foo(), Foo()]) # type: ignore[list-item] +sum([Bar(), Bar()], Bar()) # type: ignore[call-overload] +sum([Bar(), Bar()]) # type: ignore[list-item] # TODO: these pass pyright with the current stubs, but mypy erroneously emits an error: # sum([3, Fraction(7, 22), complex(8, 0), 9.83]) diff --git a/test_cases/stdlib/check_codecs.py b/test_cases/stdlib/check_codecs.py index 19e663ceeaaf..4fda4573fefb 100644 --- a/test_cases/stdlib/check_codecs.py +++ b/test_cases/stdlib/check_codecs.py @@ -7,7 +7,7 @@ assert_type(codecs.decode(b"x", "unicode-escape"), str) assert_type(codecs.decode(b"x", "utf-8"), str) -codecs.decode("x", "utf-8") # type: ignore +codecs.decode("x", "utf-8") # type: ignore[call-overload] assert_type(codecs.decode("ab", "hex"), bytes) assert_type(codecs.decode(b"ab", "hex"), bytes) diff --git a/test_cases/stdlib/check_unittest.py b/test_cases/stdlib/check_unittest.py index 7b0de9b300a9..05e4f38d7150 100644 --- a/test_cases/stdlib/check_unittest.py +++ b/test_cases/stdlib/check_unittest.py @@ -22,11 +22,11 @@ case.assertAlmostEqual(2.4, 2.41, delta=0.02) case.assertAlmostEqual(2.4, 2.41, None, "foo", 0.02) -case.assertAlmostEqual(2.4, 2.41, places=9, delta=0.02) # type: ignore -case.assertAlmostEqual("foo", "bar") # type: ignore -case.assertAlmostEqual(datetime(1999, 1, 2), datetime(1999, 1, 2, microsecond=1)) # type: ignore -case.assertAlmostEqual(Decimal("0.4"), Fraction(1, 2)) # type: ignore -case.assertAlmostEqual(complex(2, 3), Decimal("0.9")) # type: ignore +case.assertAlmostEqual(2.4, 2.41, places=9, delta=0.02) # type: ignore[call-overload] +case.assertAlmostEqual("foo", "bar") # type: ignore[call-overload] +case.assertAlmostEqual(datetime(1999, 1, 2), datetime(1999, 1, 2, microsecond=1)) # type: ignore[arg-type] +case.assertAlmostEqual(Decimal("0.4"), Fraction(1, 2)) # type: ignore[misc] +case.assertAlmostEqual(complex(2, 3), Decimal("0.9")) # type: ignore[misc] ### # Tests for assertNotAlmostEqual @@ -38,11 +38,11 @@ case.assertNotAlmostEqual(datetime(1999, 1, 2), datetime(1999, 1, 2, microsecond=1), delta=timedelta(hours=1)) case.assertNotAlmostEqual(datetime(1999, 1, 2), datetime(1999, 1, 2, microsecond=1), None, "foo", timedelta(hours=1)) -case.assertNotAlmostEqual(2.4, 2.41, places=9, delta=0.02) # type: ignore -case.assertNotAlmostEqual("foo", "bar") # type: ignore -case.assertNotAlmostEqual(datetime(1999, 1, 2), datetime(1999, 1, 2, microsecond=1)) # type: ignore -case.assertNotAlmostEqual(Decimal("0.4"), Fraction(1, 2)) # type: ignore -case.assertNotAlmostEqual(complex(2, 3), Decimal("0.9")) # type: ignore +case.assertNotAlmostEqual(2.4, 2.41, places=9, delta=0.02) # type: ignore[call-overload] +case.assertNotAlmostEqual("foo", "bar") # type: ignore[call-overload] +case.assertNotAlmostEqual(datetime(1999, 1, 2), datetime(1999, 1, 2, microsecond=1)) # type: ignore[arg-type] +case.assertNotAlmostEqual(Decimal("0.4"), Fraction(1, 2)) # type: ignore[misc] +case.assertNotAlmostEqual(complex(2, 3), Decimal("0.9")) # type: ignore[misc] ### # Tests for assertGreater @@ -81,8 +81,8 @@ def __gt__(self, other: Bacon) -> bool: case.assertGreater(Ham(), Ham()) case.assertGreater(Bacon(), Bacon()) -case.assertGreater(object(), object()) # type: ignore -case.assertGreater(datetime(1999, 1, 2), 1) # type: ignore -case.assertGreater(Spam(), Eggs()) # type: ignore -case.assertGreater(Ham(), Bacon()) # type: ignore -case.assertGreater(Bacon(), Ham()) # type: ignore +case.assertGreater(object(), object()) # type: ignore[call-overload] +case.assertGreater(datetime(1999, 1, 2), 1) # type: ignore[misc] +case.assertGreater(Spam(), Eggs()) # type: ignore[call-overload] +case.assertGreater(Ham(), Bacon()) # type: ignore[call-overload] +case.assertGreater(Bacon(), Ham()) # type: ignore[misc] diff --git a/tests/mypy_test.py b/tests/mypy_test.py index a0069ae69acd..09fdecb65f54 100644 --- a/tests/mypy_test.py +++ b/tests/mypy_test.py @@ -257,6 +257,7 @@ def get_mypy_flags(args: TestConfig, temp_name: str, *, testing_stdlib: bool) -> "--strict-equality", "--enable-error-code", "ignore-without-code", + "--warn-unused-ignores", "--config-file", temp_name, ] diff --git a/tests/regr_test.py b/tests/regr_test.py index ef084cf652ac..9927fa694e8b 100644 --- a/tests/regr_test.py +++ b/tests/regr_test.py @@ -100,6 +100,8 @@ def test_testcase_directory(package: PackageInfo, version: str, platform: str, q "--show-traceback", "--show-error-codes", "--no-error-summary", + "--enable-error-code", + "ignore-without-code", "--platform", platform, "--no-site-packages", From 673267264805f03429cf3ec4f36d1c6d17042782 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 28 Nov 2022 14:09:12 -0500 Subject: [PATCH 2/4] Stricter mypy_test --- tests/mypy_test.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/mypy_test.py b/tests/mypy_test.py index 09fdecb65f54..6eee3213a037 100644 --- a/tests/mypy_test.py +++ b/tests/mypy_test.py @@ -251,13 +251,13 @@ def get_mypy_flags(args: TestConfig, temp_name: str, *, testing_stdlib: bool) -> "--no-site-packages", "--custom-typeshed-dir", str(Path(__file__).parent.parent), - "--no-implicit-optional", - "--disallow-untyped-decorators", - "--disallow-any-generics", - "--strict-equality", + "--strict", + # Stub completion is checked by pyright (--allow-*-defs) + "--allow-untyped-defs", + "--allow-incomplete-defs", + "--allow-subclassing-any", # Needed until we can use non-types dependencies #5768 "--enable-error-code", "ignore-without-code", - "--warn-unused-ignores", "--config-file", temp_name, ] From f9169b469b8d912e073c1704246b30c7a24a4f54 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 28 Nov 2022 15:22:54 -0500 Subject: [PATCH 3/4] revert --enable-error-code ignore-without-code with explanation --- test_cases/stdlib/builtins/check_dict.py | 6 ++--- test_cases/stdlib/builtins/check_pow.py | 12 ++++----- test_cases/stdlib/builtins/check_round.py | 8 +++--- test_cases/stdlib/builtins/check_sum.py | 12 ++++----- test_cases/stdlib/check_codecs.py | 2 +- test_cases/stdlib/check_unittest.py | 30 +++++++++++------------ tests/regr_test.py | 2 +- 7 files changed, 36 insertions(+), 36 deletions(-) diff --git a/test_cases/stdlib/builtins/check_dict.py b/test_cases/stdlib/builtins/check_dict.py index 2a7bc964fc8e..2161bb2647eb 100644 --- a/test_cases/stdlib/builtins/check_dict.py +++ b/test_cases/stdlib/builtins/check_dict.py @@ -29,7 +29,7 @@ def __getitem__(self, __k: _KT) -> _VT: kt1: KeysAndGetItem[int, str] = KeysAndGetItem() assert_type(dict(kt1), Dict[int, str]) -dict(kt1, arg="a") # type: ignore[arg-type] +dict(kt1, arg="a") # type: ignore kt2: KeysAndGetItem[str, int] = KeysAndGetItem() assert_type(dict(kt2, arg=1), Dict[str, int]) @@ -41,11 +41,11 @@ def test_iterable_tuple_overload(x: Iterable[tuple[int, str]]) -> dict[int, str] i1: Iterable[tuple[int, str]] = [(1, "a"), (2, "b")] test_iterable_tuple_overload(i1) -dict(i1, arg="a") # type: ignore[arg-type] +dict(i1, arg="a") # type: ignore i2: Iterable[tuple[str, int]] = [("a", 1), ("b", 2)] assert_type(dict(i2, arg=1), Dict[str, int]) i3: Iterable[str] = ["a.b"] assert_type(dict(string.split(".") for string in i3), Dict[str, str]) -dict(["foo", "bar", "baz"]) # type: ignore[arg-type] +dict(["foo", "bar", "baz"]) # type: ignore diff --git a/test_cases/stdlib/builtins/check_pow.py b/test_cases/stdlib/builtins/check_pow.py index b634cc20e6dd..da06229f4d49 100644 --- a/test_cases/stdlib/builtins/check_pow.py +++ b/test_cases/stdlib/builtins/check_pow.py @@ -80,12 +80,12 @@ assert_type((-95) ** 8.42, Any) # All of the following cases should fail a type-checker. -pow(1.9, 4, 6) # type: ignore[misc] -pow(4, 7, 4.32) # type: ignore[misc] -pow(6.2, 5.9, 73) # type: ignore[misc] -pow(complex(6), 6.2, 7) # type: ignore[misc] -pow(Fraction(), 5, 8) # type: ignore[call-overload] -Decimal("8.7") ** 3.14 # type: ignore[operator] +pow(1.9, 4, 6) # type: ignore +pow(4, 7, 4.32) # type: ignore +pow(6.2, 5.9, 73) # type: ignore +pow(complex(6), 6.2, 7) # type: ignore +pow(Fraction(), 5, 8) # type: ignore +Decimal("8.7") ** 3.14 # type: ignore # TODO: This fails at runtime, but currently passes mypy and pyright: pow(Decimal("8.5"), 3.21) diff --git a/test_cases/stdlib/builtins/check_round.py b/test_cases/stdlib/builtins/check_round.py index a528e5fd99c3..2648208bf7c6 100644 --- a/test_cases/stdlib/builtins/check_round.py +++ b/test_cases/stdlib/builtins/check_round.py @@ -36,8 +36,8 @@ def __round__(self) -> str: assert_type(round(WithCustomRound1()), str) assert_type(round(WithCustomRound1(), None), str) # Errors: -round(WithCustomRound1(), 1) # type: ignore[call-overload] -round(WithCustomRound1(), CustomIndex()) # type: ignore[call-overload] +round(WithCustomRound1(), 1) # type: ignore +round(WithCustomRound1(), CustomIndex()) # type: ignore class WithCustomRound2: @@ -48,8 +48,8 @@ def __round__(self, digits: int) -> str: assert_type(round(WithCustomRound2(), 1), str) assert_type(round(WithCustomRound2(), CustomIndex()), str) # Errors: -round(WithCustomRound2(), None) # type: ignore[call-overload] -round(WithCustomRound2()) # type: ignore[call-overload] +round(WithCustomRound2(), None) # type: ignore +round(WithCustomRound2()) # type: ignore class WithOverloadedRound: diff --git a/test_cases/stdlib/builtins/check_sum.py b/test_cases/stdlib/builtins/check_sum.py index 79fc8fc1b893..1228ff13b45d 100644 --- a/test_cases/stdlib/builtins/check_sum.py +++ b/test_cases/stdlib/builtins/check_sum.py @@ -43,12 +43,12 @@ def __radd__(self, other: Any) -> Baz: sum([2.5, 5.8], 5) # mypy: `float`; pyright: `float | int` # These all fail at runtime -sum("abcde") # type: ignore[arg-type] -sum([["foo"], ["bar"]]) # type: ignore[list-item] -sum([("foo",), ("bar", "baz")]) # type: ignore[list-item] -sum([Foo(), Foo()]) # type: ignore[list-item] -sum([Bar(), Bar()], Bar()) # type: ignore[call-overload] -sum([Bar(), Bar()]) # type: ignore[list-item] +sum("abcde") # type: ignore +sum([["foo"], ["bar"]]) # type: ignore +sum([("foo",), ("bar", "baz")]) # type: ignore +sum([Foo(), Foo()]) # type: ignore +sum([Bar(), Bar()], Bar()) # type: ignore +sum([Bar(), Bar()]) # type: ignore # TODO: these pass pyright with the current stubs, but mypy erroneously emits an error: # sum([3, Fraction(7, 22), complex(8, 0), 9.83]) diff --git a/test_cases/stdlib/check_codecs.py b/test_cases/stdlib/check_codecs.py index 4fda4573fefb..19e663ceeaaf 100644 --- a/test_cases/stdlib/check_codecs.py +++ b/test_cases/stdlib/check_codecs.py @@ -7,7 +7,7 @@ assert_type(codecs.decode(b"x", "unicode-escape"), str) assert_type(codecs.decode(b"x", "utf-8"), str) -codecs.decode("x", "utf-8") # type: ignore[call-overload] +codecs.decode("x", "utf-8") # type: ignore assert_type(codecs.decode("ab", "hex"), bytes) assert_type(codecs.decode(b"ab", "hex"), bytes) diff --git a/test_cases/stdlib/check_unittest.py b/test_cases/stdlib/check_unittest.py index 05e4f38d7150..7b0de9b300a9 100644 --- a/test_cases/stdlib/check_unittest.py +++ b/test_cases/stdlib/check_unittest.py @@ -22,11 +22,11 @@ case.assertAlmostEqual(2.4, 2.41, delta=0.02) case.assertAlmostEqual(2.4, 2.41, None, "foo", 0.02) -case.assertAlmostEqual(2.4, 2.41, places=9, delta=0.02) # type: ignore[call-overload] -case.assertAlmostEqual("foo", "bar") # type: ignore[call-overload] -case.assertAlmostEqual(datetime(1999, 1, 2), datetime(1999, 1, 2, microsecond=1)) # type: ignore[arg-type] -case.assertAlmostEqual(Decimal("0.4"), Fraction(1, 2)) # type: ignore[misc] -case.assertAlmostEqual(complex(2, 3), Decimal("0.9")) # type: ignore[misc] +case.assertAlmostEqual(2.4, 2.41, places=9, delta=0.02) # type: ignore +case.assertAlmostEqual("foo", "bar") # type: ignore +case.assertAlmostEqual(datetime(1999, 1, 2), datetime(1999, 1, 2, microsecond=1)) # type: ignore +case.assertAlmostEqual(Decimal("0.4"), Fraction(1, 2)) # type: ignore +case.assertAlmostEqual(complex(2, 3), Decimal("0.9")) # type: ignore ### # Tests for assertNotAlmostEqual @@ -38,11 +38,11 @@ case.assertNotAlmostEqual(datetime(1999, 1, 2), datetime(1999, 1, 2, microsecond=1), delta=timedelta(hours=1)) case.assertNotAlmostEqual(datetime(1999, 1, 2), datetime(1999, 1, 2, microsecond=1), None, "foo", timedelta(hours=1)) -case.assertNotAlmostEqual(2.4, 2.41, places=9, delta=0.02) # type: ignore[call-overload] -case.assertNotAlmostEqual("foo", "bar") # type: ignore[call-overload] -case.assertNotAlmostEqual(datetime(1999, 1, 2), datetime(1999, 1, 2, microsecond=1)) # type: ignore[arg-type] -case.assertNotAlmostEqual(Decimal("0.4"), Fraction(1, 2)) # type: ignore[misc] -case.assertNotAlmostEqual(complex(2, 3), Decimal("0.9")) # type: ignore[misc] +case.assertNotAlmostEqual(2.4, 2.41, places=9, delta=0.02) # type: ignore +case.assertNotAlmostEqual("foo", "bar") # type: ignore +case.assertNotAlmostEqual(datetime(1999, 1, 2), datetime(1999, 1, 2, microsecond=1)) # type: ignore +case.assertNotAlmostEqual(Decimal("0.4"), Fraction(1, 2)) # type: ignore +case.assertNotAlmostEqual(complex(2, 3), Decimal("0.9")) # type: ignore ### # Tests for assertGreater @@ -81,8 +81,8 @@ def __gt__(self, other: Bacon) -> bool: case.assertGreater(Ham(), Ham()) case.assertGreater(Bacon(), Bacon()) -case.assertGreater(object(), object()) # type: ignore[call-overload] -case.assertGreater(datetime(1999, 1, 2), 1) # type: ignore[misc] -case.assertGreater(Spam(), Eggs()) # type: ignore[call-overload] -case.assertGreater(Ham(), Bacon()) # type: ignore[call-overload] -case.assertGreater(Bacon(), Ham()) # type: ignore[misc] +case.assertGreater(object(), object()) # type: ignore +case.assertGreater(datetime(1999, 1, 2), 1) # type: ignore +case.assertGreater(Spam(), Eggs()) # type: ignore +case.assertGreater(Ham(), Bacon()) # type: ignore +case.assertGreater(Bacon(), Ham()) # type: ignore diff --git a/tests/regr_test.py b/tests/regr_test.py index 9927fa694e8b..bfe949c35de8 100644 --- a/tests/regr_test.py +++ b/tests/regr_test.py @@ -93,7 +93,7 @@ def test_testcase_directory(package: PackageInfo, version: str, platform: str, q msg = f"Running mypy --platform {platform} --python-version {version} on the " msg += "standard library test cases..." if is_stdlib else f"test cases for {package_name!r}..." print(msg, end=" ") - + # "--enable-error-code ignore-without-code" is purposefully ommited. See https://github.com/python/typeshed/pull/8083 flags = [ "--python-version", version, From e500a857212cc8c01841d38ab6e91bd8375659f2 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 28 Nov 2022 15:23:47 -0500 Subject: [PATCH 4/4] format --- tests/regr_test.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/regr_test.py b/tests/regr_test.py index bfe949c35de8..37d09ef9c26e 100644 --- a/tests/regr_test.py +++ b/tests/regr_test.py @@ -93,6 +93,7 @@ def test_testcase_directory(package: PackageInfo, version: str, platform: str, q msg = f"Running mypy --platform {platform} --python-version {version} on the " msg += "standard library test cases..." if is_stdlib else f"test cases for {package_name!r}..." print(msg, end=" ") + # "--enable-error-code ignore-without-code" is purposefully ommited. See https://github.com/python/typeshed/pull/8083 flags = [ "--python-version", @@ -100,8 +101,6 @@ def test_testcase_directory(package: PackageInfo, version: str, platform: str, q "--show-traceback", "--show-error-codes", "--no-error-summary", - "--enable-error-code", - "ignore-without-code", "--platform", platform, "--no-site-packages",