Skip to content

Commit

Permalink
see if its because of 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonykim1 committed Feb 2, 2025
1 parent f2fbb9f commit 70629bf
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions src/test/terminals/codeExecution/helper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { IServiceContainer } from '../../../client/ioc/types';
import { EnvironmentType, PythonEnvironment } from '../../../client/pythonEnvironments/info';
import { CodeExecutionHelper } from '../../../client/terminals/codeExecution/helper';
import { ICodeExecutionHelper } from '../../../client/terminals/types';
import { PYTHON_PATH } from '../../common';
import { PYTHON_PATH, getPythonSemVer } from '../../common';
import { ReplType } from '../../../client/repl/types';

const TEST_FILES_PATH = path.join(EXTENSION_ROOT_DIR, 'src', 'test', 'python_files', 'terminalExec');
Expand Down Expand Up @@ -233,27 +233,28 @@ suite('Terminal - Code Execution Helper', async () => {
const normalizedExpected = expectedSource.replace(/\r\n/g, '\n');
expect(normalizedCode).to.be.equal(normalizedExpected);
}

['', '1', '2', '3', '4', '5', '6', '7', '8'].forEach((fileNameSuffix) => {
test(`Ensure code is normalized (Sample${fileNameSuffix})`, async () => {
configurationService
.setup((c) => c.getSettings(TypeMoq.It.isAny()))
.returns({
REPL: {
EnableREPLSmartSend: false,
REPLSmartSend: false,
},
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} as any);
const code = await fs.readFile(path.join(TEST_FILES_PATH, `sample${fileNameSuffix}_raw.py`), 'utf8');
const expectedCode = await fs.readFile(
path.join(TEST_FILES_PATH, `sample${fileNameSuffix}_normalized_selection.py`),
'utf8',
);
await ensureCodeIsNormalized(code, expectedCode);
const pythonVersion = await getPythonSemVer();
if (pythonVersion && pythonVersion.minor < 13) {
['', '1', '2', '3', '4', '5', '6', '7', '8'].forEach((fileNameSuffix) => {
test(`Ensure code is normalized (Sample${fileNameSuffix})`, async () => {
configurationService
.setup((c) => c.getSettings(TypeMoq.It.isAny()))
.returns({
REPL: {
EnableREPLSmartSend: false,
REPLSmartSend: false,
},
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} as any);
const code = await fs.readFile(path.join(TEST_FILES_PATH, `sample${fileNameSuffix}_raw.py`), 'utf8');
const expectedCode = await fs.readFile(
path.join(TEST_FILES_PATH, `sample${fileNameSuffix}_normalized_selection.py`),
'utf8',
);
await ensureCodeIsNormalized(code, expectedCode);
});
});
});

}
test("Display message if there's no active file", async () => {
documentManager.setup((doc) => doc.activeTextEditor).returns(() => undefined);

Expand Down

0 comments on commit 70629bf

Please sign in to comment.