FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-143955: Prevent schema drift false-positives in asyncio tools tests by johnslavik · Pull Request #148525 · python/cpython · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
26 changes: 20 additions & 6 deletions Lib/test/test_asyncio/test_tools.py
This file contains hidden or 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
Expand Up @@ -2,13 +2,27 @@

from asyncio import tools

from collections import namedtuple
import _remote_debugging

LocationInfo = namedtuple('LocationInfo', ['lineno', 'end_lineno', 'col_offset', 'end_col_offset'], defaults=[None]*4)
FrameInfo = namedtuple('FrameInfo', ['funcname', 'filename', 'location'])
CoroInfo = namedtuple('CoroInfo', ['call_stack', 'task_name'])
TaskInfo = namedtuple('TaskInfo', ['task_id', 'task_name', 'coroutine_stack', 'awaited_by'])
AwaitedInfo = namedtuple('AwaitedInfo', ['thread_id', 'awaited_by'])

def LocationInfo(lineno, end_lineno=None, col_offset=None, end_col_offset=None):
return _remote_debugging.LocationInfo((lineno, end_lineno, col_offset, end_col_offset))


def FrameInfo(funcname, filename, location, opcode=None):
return _remote_debugging.FrameInfo((filename, location, funcname, opcode))


def CoroInfo(call_stack, task_name):
return _remote_debugging.CoroInfo((call_stack, task_name))


def TaskInfo(task_id, task_name, coroutine_stack, awaited_by):
return _remote_debugging.TaskInfo((task_id, task_name, coroutine_stack, awaited_by))


def AwaitedInfo(thread_id, awaited_by):
return _remote_debugging.AwaitedInfo((thread_id, awaited_by))


# mock output of get_all_awaited_by function.
Expand Down
Loading

Back | FazBrowse Home | New Git URL