From 15929457fabe5bd5e768d495ea11689d4d8be634 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Sat, 8 Jul 2023 21:35:07 +0200 Subject: [PATCH] Cleanup after enabling strict default for test files (#15627) --- mypy/test/testcheck.py | 2 -- test-data/unit/hacks.txt | 11 ----------- 2 files changed, 13 deletions(-) diff --git a/mypy/test/testcheck.py b/mypy/test/testcheck.py index 20dfbb77f3e0..7b81deeafe9d 100644 --- a/mypy/test/testcheck.py +++ b/mypy/test/testcheck.py @@ -128,8 +128,6 @@ def run_case_once( options.show_traceback = True # Enable some options automatically based on test file name. - if "optional" in testcase.file: - options.strict_optional = True if "columns" in testcase.file: options.show_column_numbers = True if "errorcodes" in testcase.file: diff --git a/test-data/unit/hacks.txt b/test-data/unit/hacks.txt index 43114a8af004..15b1065cb7a9 100644 --- a/test-data/unit/hacks.txt +++ b/test-data/unit/hacks.txt @@ -5,17 +5,6 @@ Due to historical reasons, test cases contain things that may appear baffling without extra context. This file attempts to describe most of them. -Strict optional is disabled be default --------------------------------------- - -Strict optional checking is enabled in mypy by default, but test cases -must enable it explicitly, either through `# flags: --strict-optional` -or by including `optional` as a substring in your test file name. - -The reason for this is that many test cases written before strict -optional was implemented use the idiom `x = None # type: t`, and -updating all of these test cases would take a lot of work. - Dummy if statements to prevent redefinition -------------------------------------------