Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup after enabling strict default for test files #15627

Merged
merged 1 commit into from
Jul 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions mypy/test/testcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 0 additions & 11 deletions test-data/unit/hacks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------------------------------------------

Expand Down