forked from microsoft/ptvsd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test case for issue microsoft#1301
- Loading branch information
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import sys | ||
from _pydevd_bundle.pydevd_constants import int_types | ||
from _pydevd_bundle.pydevd_resolver import MAX_ITEMS_TO_HANDLE | ||
|
||
def get_frame(): | ||
lst = {} | ||
for idx in range(0, MAX_ITEMS_TO_HANDLE + 1): | ||
lst[idx] = (1) | ||
return sys._getframe() | ||
|
||
def test_get_child_variables(): | ||
from _pydevd_bundle.pydevd_suspended_frames import SuspendedFramesManager | ||
suspended_frames_manager = SuspendedFramesManager() | ||
py_db = None | ||
with suspended_frames_manager.track_frames(py_db) as tracker: | ||
# : :type tracker: _FramesTracker | ||
thread_id = 'thread1' | ||
frame = get_frame() | ||
tracker.track(thread_id, frame, frame_id_to_lineno={}) | ||
|
||
assert suspended_frames_manager.get_thread_id_for_variable_reference(id(frame)) == thread_id | ||
|
||
variable = suspended_frames_manager.get_variable(id(frame)) | ||
|
||
for x in variable.get_children_variables(): | ||
try: | ||
x.get_children_variables() | ||
except: | ||
raise AssertionError() | ||
|