void () { runPythonTest(new PyDebuggerTask("/debug", "test_load_elements_for_groups_on_demand.py") { @Override public void before() { toggleBreakpoint(getFilePath(getScriptName()), 2); toggleBreakpoint(getFilePath(getScriptName()), 8); final PyDebuggerSettings debuggerSettings = PyDebuggerSettings.getInstance(); debuggerSettings.setWatchReturnValues(true); } @Override public void doFinally() { final PyDebuggerSettings debuggerSettings = PyDebuggerSettings.getInstance(); debuggerSettings.setWatchReturnValues(false); } @Override public void testing() throws Exception { waitForPause(); resume(); waitForPause(); List<PyDebugValue> defaultVariables = loadSpecialVariables(ProcessDebugger.GROUP_TYPE.DEFAULT); List<String> names = List.of("_dummy_ret_val", "_dummy_special_var", "boolean", "get_foo", "string"); List<String> values = List.of("", "True", "1", "Hello!"); containsValue(defaultVariables, names, values); List<PyDebugValue> specialVariables = loadSpecialVariables(ProcessDebugger.GROUP_TYPE.SPECIAL); names = List.of("__builtins__", "__doc__", "__file__", "__loader__", "__name__", "__package__", "__spec__"); values = List.of("<module 'builtins' (built-in)>", "None", "test_load_elements_for_groups_on_demand.py", " ", "__main__", ""); containsValue(specialVariables, names, values); List<PyDebugValue> returnVariables = loadSpecialVariables(ProcessDebugger.GROUP_TYPE.RETURN); names = List.of("foo"); values = List.of("1"); containsValue(returnVariables, names, values); resume(); waitForTerminate(); } private static void containsValue(List<PyDebugValue> variablesGroup, List<String> names, List<String> values) { for (PyDebugValue elem : variablesGroup) { assertTrue(names.contains(elem.getName())); assertTrue(values.contains(elem.getValue())); } } }); }