Skip to content

Commit 8028931

Browse files
authored
Add tests for log points in the experimental debugger (DonJayamanne#1583)
* Add tests for log points in the experimental debugger * remove retry limitation
1 parent 0526967 commit 8028931

3 files changed

Lines changed: 28 additions & 1 deletion

File tree

news/3 Code Health/1582.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add tests for log points in the experimental debugger.

src/test/debugger/misc.test.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ let testCounter = 0;
467467
await Promise.all([
468468
debugClient.configurationSequence(),
469469
setBreakpointFilter(),
470-
debugClient.launch(buildLauncArgs('sampleWithAssertEx.py', false)),
470+
debugClient.launch(buildLaunchArgs('sampleWithAssertEx.py', false)),
471471
waitToStopDueToException(),
472472
debugClient.assertStoppedLocation('exception', pauseLocation)
473473
]);
@@ -612,5 +612,27 @@ let testCounter = 0;
612612
debugClient.waitForEvent('terminated')
613613
]);
614614
});
615+
test('Test Logpoints', async function () {
616+
if (debuggerType !== 'pythonExperimental') {
617+
return this.skip();
618+
}
619+
const breakpointLocation = { path: path.join(debugFilesPath, 'logMessage.py'), line: 4 };
620+
const breakpointArgs: DebugProtocol.SetBreakpointsArguments = {
621+
lines: [breakpointLocation.line],
622+
breakpoints: [{ line: breakpointLocation.line, logMessage: 'Sum of {a} and {b} is 3' }],
623+
source: { path: breakpointLocation.path }
624+
};
625+
await Promise.all([
626+
debugClient.launch(buildLaunchArgs('logMessage.py', false)),
627+
debugClient.waitForEvent('initialized')
628+
.then(() => debugClient.setBreakpointsRequest(breakpointArgs))
629+
.then(() => debugClient.configurationDoneRequest())
630+
.then(() => debugClient.threadsRequest()),
631+
debugClient.waitForEvent('thread')
632+
.then(() => debugClient.threadsRequest()),
633+
debugClient.assertOutput('stdout', 'Sum of 1 and 2 is 3'),
634+
debugClient.waitForEvent('terminated')
635+
]);
636+
});
615637
});
616638
});
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import time
2+
a = 1
3+
b = 2
4+
c = a + b

0 commit comments

Comments
 (0)