[red-knot] Respect typeshed's VERSIONS file when resolving stdlib modules (#12141)

This commit is contained in:
Alex Waygood 2024-07-05 23:43:31 +01:00 committed by GitHub
parent 8198723201
commit a62a432a48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 1995 additions and 585 deletions

View file

@ -179,7 +179,9 @@ impl HasTy for ast::Alias {
#[cfg(test)]
mod tests {
use red_knot_module_resolver::{set_module_resolution_settings, ModuleResolutionSettings};
use red_knot_module_resolver::{
set_module_resolution_settings, RawModuleResolutionSettings, TargetVersion,
};
use ruff_db::file_system::FileSystemPathBuf;
use ruff_db::parsed::parsed_module;
use ruff_db::vfs::system_path_to_file;
@ -192,11 +194,12 @@ mod tests {
let mut db = TestDb::new();
set_module_resolution_settings(
&mut db,
ModuleResolutionSettings {
RawModuleResolutionSettings {
extra_paths: vec![],
workspace_root: FileSystemPathBuf::from("/src"),
site_packages: None,
custom_typeshed: None,
target_version: TargetVersion::Py38,
},
);