Skip to content

Remove tests from the environment.root default #1782

@MichaReiser

Description

@MichaReiser

ty currently adds tests as a search path if the user didn't specify any. This is problematic because it prevents ty from detecting test modules being imported into production code.

The main reason we added the fallback tests was to make imports work within the test folders. This is no longer required now that we have desperate module resolution.

We should try changing the default and see how big the fallout on mypy primer is. If it's small, I suggest landing this change before the beta.

We should also update ty's module resolution documentation to mention the new desperate module resolution algorithm.

Metadata

Metadata

Assignees

Labels

configurationRelated to settings and configurationimportsModule resolution, site-packages discovery, import-related diagnostics

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions