Fixed subtle bug in a test case that was resulting in a long hang during unit tests.

This commit is contained in:
Eric Traut 2024-06-11 13:11:42 -07:00
parent 0df185ebd4
commit add2193101
2 changed files with 2 additions and 2 deletions

View File

@ -522,7 +522,7 @@ export class AnalyzerService {
const optionRoot = commandLineOptions.executionRoot;
const executionRootUri = Uri.is(optionRoot)
? optionRoot
: isString(optionRoot)
: isString(optionRoot) && optionRoot.length > 0
? Uri.file(optionRoot, this.serviceProvider, /* checkRelative */ true)
: Uri.defaultWorkspace(this.serviceProvider);

View File

@ -323,7 +323,7 @@ test('BasicPyprojectTomlParsing', () => {
test('FindFilesInMemoryOnly', () => {
const cwd = normalizePath(process.cwd());
const service = createAnalyzer();
const commandLineOptions = new CommandLineOptions('', /* fromVsCodeExtension */ true);
const commandLineOptions = new CommandLineOptions(undefined, /* fromVsCodeExtension */ true);
// Force a lookup of the typeshed path. This causes us to try and generate a module path for the untitled file.
commandLineOptions.typeshedPath = combinePaths(cwd, 'src', 'tests', 'samples');
service.setOptions(commandLineOptions);