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 -------------------------------------------