@@ -412,17 +412,20 @@ public void testSourceFileURI() throws Throwable {
412412 Path importingFile = tempDir .resolve ("importing.py" );
413413 Files .write (importedFile , ("def sum(a, b):\n " +
414414 " return a + b\n " ).getBytes ());
415- Files .write (importingFile , ("import imported\n " +
415+ Files .write (importingFile , ("import sys\n " +
416+ "sys.path.insert(0, '" + tempDir .toString () + "')\n " +
417+ "import imported\n " +
416418 "imported.sum(2, 3)\n " ).getBytes ());
417419 Source source = Source .newBuilder ("python" , importingFile .toFile ()).build ();
418420 try (DebuggerSession session = tester .startSession ()) {
419- session .suspendNextExecution ();
421+ Breakpoint breakpoint = Breakpoint .newBuilder (importingFile .toUri ()).lineIs (4 ).build ();
422+ session .install (breakpoint );
420423 tester .startEval (source );
421424 expectSuspended ((SuspendedEvent event ) -> {
422425 assertEquals (importingFile .toUri (), event .getSourceSection ().getSource ().getURI ());
423426 DebugStackFrame frame = event .getTopStackFrame ();
424- assertEquals (1 , frame .getSourceSection ().getStartLine ());
425- event .prepareStepInto (2 );
427+ assertEquals (4 , frame .getSourceSection ().getStartLine ());
428+ event .prepareStepInto (1 );
426429 });
427430 expectSuspended ((SuspendedEvent event ) -> {
428431 assertEquals (importedFile .toUri (), event .getSourceSection ().getSource ().getURI ());
0 commit comments