style: narrow the log pop-out view for the pyright gate
The Optional _popout_view is assert-narrowed once after opening; the unguarded accesses were the last three diff-gate violations. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,11 +13,13 @@ def test_log_popout_mirrors_and_clears(qtbot):
|
||||
dock._open_popout()
|
||||
assert dock._popout is not None
|
||||
assert dock._popout.isVisible()
|
||||
popout_view = dock._popout_view
|
||||
assert popout_view is not None
|
||||
# History copied on open, live lines reach both views.
|
||||
assert "first line" in dock._popout_view.toPlainText()
|
||||
assert "first line" in popout_view.toPlainText()
|
||||
dock.emitter.message.emit("second line")
|
||||
assert "second line" in dock.view.toPlainText()
|
||||
assert "second line" in dock._popout_view.toPlainText()
|
||||
assert "second line" in popout_view.toPlainText()
|
||||
|
||||
# Reopening reuses the window instead of stacking mirrors.
|
||||
popout = dock._popout
|
||||
@@ -26,4 +28,4 @@ def test_log_popout_mirrors_and_clears(qtbot):
|
||||
|
||||
dock.clear()
|
||||
assert dock.view.toPlainText() == ""
|
||||
assert dock._popout_view.toPlainText() == ""
|
||||
assert popout_view.toPlainText() == ""
|
||||
|
||||
Reference in New Issue
Block a user