Skip to content

Commit 70629bf

Browse files
committed
see if its because of 3.13
1 parent f2fbb9f commit 70629bf

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

src/test/terminals/codeExecution/helper.test.ts

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { IServiceContainer } from '../../../client/ioc/types';
3333
import { EnvironmentType, PythonEnvironment } from '../../../client/pythonEnvironments/info';
3434
import { CodeExecutionHelper } from '../../../client/terminals/codeExecution/helper';
3535
import { ICodeExecutionHelper } from '../../../client/terminals/types';
36-
import { PYTHON_PATH } from '../../common';
36+
import { PYTHON_PATH, getPythonSemVer } from '../../common';
3737
import { ReplType } from '../../../client/repl/types';
3838

3939
const TEST_FILES_PATH = path.join(EXTENSION_ROOT_DIR, 'src', 'test', 'python_files', 'terminalExec');
@@ -233,27 +233,28 @@ suite('Terminal - Code Execution Helper', async () => {
233233
const normalizedExpected = expectedSource.replace(/\r\n/g, '\n');
234234
expect(normalizedCode).to.be.equal(normalizedExpected);
235235
}
236-
237-
['', '1', '2', '3', '4', '5', '6', '7', '8'].forEach((fileNameSuffix) => {
238-
test(`Ensure code is normalized (Sample${fileNameSuffix})`, async () => {
239-
configurationService
240-
.setup((c) => c.getSettings(TypeMoq.It.isAny()))
241-
.returns({
242-
REPL: {
243-
EnableREPLSmartSend: false,
244-
REPLSmartSend: false,
245-
},
246-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
247-
} as any);
248-
const code = await fs.readFile(path.join(TEST_FILES_PATH, `sample${fileNameSuffix}_raw.py`), 'utf8');
249-
const expectedCode = await fs.readFile(
250-
path.join(TEST_FILES_PATH, `sample${fileNameSuffix}_normalized_selection.py`),
251-
'utf8',
252-
);
253-
await ensureCodeIsNormalized(code, expectedCode);
236+
const pythonVersion = await getPythonSemVer();
237+
if (pythonVersion && pythonVersion.minor < 13) {
238+
['', '1', '2', '3', '4', '5', '6', '7', '8'].forEach((fileNameSuffix) => {
239+
test(`Ensure code is normalized (Sample${fileNameSuffix})`, async () => {
240+
configurationService
241+
.setup((c) => c.getSettings(TypeMoq.It.isAny()))
242+
.returns({
243+
REPL: {
244+
EnableREPLSmartSend: false,
245+
REPLSmartSend: false,
246+
},
247+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
248+
} as any);
249+
const code = await fs.readFile(path.join(TEST_FILES_PATH, `sample${fileNameSuffix}_raw.py`), 'utf8');
250+
const expectedCode = await fs.readFile(
251+
path.join(TEST_FILES_PATH, `sample${fileNameSuffix}_normalized_selection.py`),
252+
'utf8',
253+
);
254+
await ensureCodeIsNormalized(code, expectedCode);
255+
});
254256
});
255-
});
256-
257+
}
257258
test("Display message if there's no active file", async () => {
258259
documentManager.setup((doc) => doc.activeTextEditor).returns(() => undefined);
259260

0 commit comments

Comments
 (0)