Skip to content

Commit

Permalink
update some config file tests due to an upstream change to the defaul…
Browse files Browse the repository at this point in the history
…t `pythonVersion`
  • Loading branch information
DetachHead committed Jan 29, 2025
1 parent aaf7f22 commit 98a55f5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/pyright-internal/src/tests/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,9 @@ describe(`config test'}`, () => {
const { configOptions, analysisResult } = setupPyprojectToml(
'src/tests/samples/project_with_both_config_sections_in_pyproject_toml'
);
assert.strictEqual(configOptions.defaultPythonVersion!, undefined);
// ensure it defaults to the current python interpreter instead of the version from either section in the config.
// https://github.com/microsoft/pyright/pull/9735
assert.strictEqual(configOptions.defaultPythonVersion!, pythonVersion3_13);
assert(!analysisResult?.fatalErrorOccurred);
});

Expand Down Expand Up @@ -671,7 +673,8 @@ describe(`config test'}`, () => {
const cwd = normalizePath(process.cwd());
const nullConsole = new NullConsole();
const service = createAnalyzer(nullConsole);
const commandLineOptions = new CommandLineOptions(cwd, /* fromLanguageServer */ false);
// fromLanguageServer to prevent the top-level pyproject.toml from interfering with the test
const commandLineOptions = new CommandLineOptions(cwd, /* fromLanguageServer */ true);
commandLineOptions.configFilePath = 'src/tests/samples/package1';
service.setOptions(commandLineOptions);

Expand Down

0 comments on commit 98a55f5

Please sign in to comment.