test: lift diff coverage over the 80 percent gate
CI / lint (push) Skipped
CI / test (3.11) (push) Skipped
CI / test (3.12) (push) Skipped
CI / test (3.13) (push) Skipped
CI / test-with-beamline-plugins (pxi_bec) (push) Skipped
CI / test-with-beamline-plugins (pxii_bec) (push) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (push) Skipped
CI / lint (pull_request) Successful in 1m3s
CI / test (3.11) (pull_request) Successful in 1m25s
CI / test (3.12) (pull_request) Successful in 1m25s
CI / test (3.13) (pull_request) Successful in 1m24s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 1m32s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Successful in 1m37s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 1m41s
CI / test-with-coverage (pull_request) Successful in 2m4s
CI / coverage-analysis (pull_request) Successful in 3s

Promote the illumination panel's __main__ self-check to a real pytest
file so CI counts it, add busy-overlay render checks (status text
paints, video view routes through it), and cover the motor group's
incomplete-entry and below-min Enter paths. Local diff coverage from
the gui suite alone: 82 percent.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
duan_jandClaude Fable 5 committed 2026-08-14 08:52:01 +02:00
1 parent 5871c959e2
commit 16e112f44a
4 files changed
+135 -47

No files matched your search

-47
View File
@@ -84,50 +84,3 @@ class IlluminationPanel(QWidget):
slider.blockSignals(True)
slider.setValue(round(val))
slider.blockSignals(False)
if __name__ == "__main__":
# ponytail: smallest check that fails if the send/readback wiring breaks
import os
from types import SimpleNamespace
os.environ.setdefault("QT_QPA_PLATFORM", "offscreen")
from PySide6.QtCore import QPoint, QPointF
from PySide6.QtGui import QWheelEvent
from PySide6.QtWidgets import QApplication
app = QApplication([])
panel = IlluminationPanel()
sent = []
panel.front_light.connect(sent.append)
# wheel notch must emit (was silently discarded before)
panel.front_light_slider.setFocus()
QApplication.sendEvent(
panel.front_light_slider,
QWheelEvent(
QPointF(5, 5),
QPointF(5, 5),
QPoint(0, 0),
QPoint(0, 120),
Qt.MouseButton.RightButton,
Qt.KeyboardModifier.NoModifier,
Qt.ScrollPhase.NoScrollPhase,
False,
),
)
assert sent, "wheel adjustment must emit front_light"
# readback right after a user change must not clobber the slider
held = panel.front_light_slider.value()
status = SimpleNamespace(bl=SimpleNamespace(front_light=90.0, back_light=10.0))
panel.update_daq_status(status)
assert panel.front_light_slider.value() == held, "grace window must hold user value"
# after the grace window, readback applies without emitting a PUT
panel._last_user_change = time.monotonic() - READBACK_GRACE_S - 1
n_sent = len(sent)
panel.update_daq_status(status)
assert panel.front_light_slider.value() == 90, "readback must apply after grace"
assert len(sent) == n_sent, "readback must not echo a PUT"
print("gude")