Skip to content

Commit

Permalink
update regex for new traceback format (#12197)
Browse files Browse the repository at this point in the history
* re-enable tests

* update regex for new traceback format
  • Loading branch information
amunger committed Nov 29, 2022
1 parent 524aaef commit 959b937
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/interactive-window/outputs/tracebackFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class InteractiveWindowTracebackFormatter implements ITracebackFormatter
let executionCount: number | undefined;
let location: string | undefined;
const inputMatch = /^Input.*?\[.*32mIn\s+\[(\d+).*?0;36m(.*?)\n.*/.exec(traceFrame);
const cellMatch = /^Cell.*?\[.*32mIn\s+\[(\d+)\], (.*).\[0m\n/.exec(traceFrame);
const cellMatch = /^Cell.*?\[.*32mIn\s*\[(\d+)\], (.*).\[0m\n/.exec(traceFrame);

if (inputMatch && inputMatch.length > 1) {
executionCount = parseInt(inputMatch[1]);
Expand Down
6 changes: 2 additions & 4 deletions src/test/datascience/interactiveWindow.vscode.common.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,7 @@ ${actualCode}
await waitForTextOutput(notebookDocument!.cellAt(1), '1', 0, false);
});

test.skip('Error stack traces have correct line hrefs with mix of cell sources', async function () {
// https://github.com/microsoft/vscode-jupyter/issues/12189
test('Error stack traces have correct line hrefs with mix of cell sources', async function () {
const settings = vscode.workspace.getConfiguration('jupyter', null);
await settings.update('interactiveWindowMode', 'single');

Expand Down Expand Up @@ -437,8 +436,7 @@ ${actualCode}
assert.equal(hrefs?.length, 4, '4 hrefs not found in traceback');
});

test.skip('Raising an exception from within a function has a stack trace', async function () {
// https://github.com/microsoft/vscode-jupyter/issues/12190
test('Raising an exception from within a function has a stack trace', async function () {
const { activeInteractiveWindow } = await runNewPythonFile(
interactiveWindowProvider,
'# %%\ndef raiser():\n raise Exception("error")\n# %%\nraiser()',
Expand Down

0 comments on commit 959b937

Please sign in to comment.