mirror of
https://github.com/microsoft/debugpy.git
synced 2025-12-23 08:48:12 +00:00
Properly validate/change django/jinja2 template breakpoints lines. Fixes #213
This commit is contained in:
parent
ac360f4857
commit
ddb083cc25
17 changed files with 650 additions and 104 deletions
|
|
@ -317,6 +317,7 @@ def test_breakpoint_in_nonexistent_file(pyfile, target, run):
|
|||
{"path": some.path("nonexistent_file.py")}
|
||||
),
|
||||
"line": 1,
|
||||
"id": 0,
|
||||
}
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -60,10 +60,19 @@ def test_django_breakpoint_no_multiproc(start_django, bp_target):
|
|||
|
||||
with debug.Session() as session:
|
||||
with start_django(session):
|
||||
session.set_breakpoints(bp_file, [bp_line])
|
||||
breakpoints = session.set_breakpoints(bp_file, [bp_line])
|
||||
for bp in breakpoints:
|
||||
# They'll be verified later on for templates.
|
||||
assert bp["verified"] == (bp_target == "code")
|
||||
|
||||
with django_server:
|
||||
home_request = django_server.get("/home")
|
||||
|
||||
if bp_target == "template":
|
||||
breakpoint_body = session.wait_for_next_event("breakpoint")
|
||||
assert breakpoint_body["reason"] == "changed"
|
||||
assert breakpoint_body["breakpoint"]["verified"]
|
||||
|
||||
session.wait_for_stop(
|
||||
"breakpoint",
|
||||
expected_frames=[
|
||||
|
|
@ -144,6 +153,7 @@ def test_django_exception_no_multiproc(start_django, exc_type):
|
|||
|
||||
with django_server:
|
||||
django_server.get("/" + exc_type)
|
||||
|
||||
stopped = session.wait_for_stop(
|
||||
"exception",
|
||||
expected_frames=[
|
||||
|
|
|
|||
|
|
@ -79,10 +79,19 @@ def test_flask_breakpoint_no_multiproc(start_flask, bp_target):
|
|||
|
||||
with debug.Session() as session:
|
||||
with start_flask(session):
|
||||
session.set_breakpoints(bp_file, [bp_line])
|
||||
breakpoints = session.set_breakpoints(bp_file, [bp_line])
|
||||
for bp in breakpoints:
|
||||
# They'll be verified later on for templates.
|
||||
assert bp["verified"] == (bp_target == "code")
|
||||
|
||||
with flask_server:
|
||||
home_request = flask_server.get("/")
|
||||
|
||||
if bp_target == "template":
|
||||
breakpoint_body = session.wait_for_next_event("breakpoint")
|
||||
assert breakpoint_body["reason"] == "changed"
|
||||
assert breakpoint_body["breakpoint"]["verified"]
|
||||
|
||||
session.wait_for_stop(
|
||||
"breakpoint",
|
||||
expected_frames=[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue