Skip to content

test_window_without_a_height_is_as_high_as_its_rows fails on Windows (57 vs 56) #834

Done

Description

@neuromechanist

tests/test_guifunc_primitives.py::test_window_without_a_height_is_as_high_as_its_rows fails on windows-latest (Python 3.12) with assert [57, 28] == [56, 28]: the computed window height is one pixel taller than expected. It came in with #776 ("Size a dialog from its rows, one row height per platform") and showed up on #832 after that PR merged develop, twice in a row (run 46188267231 and its rerun). #832 changes only the ASR reconstruction (riemann.py, its test and the changelog), so the failure is independent of it.

Likely a Windows font-metric or DPI rounding difference in the per-platform row height; the expected value may need a one-pixel tolerance on Windows or a platform-specific constant.


Agentic AI tools were used. Workflows follow the Research Skills (doi:10.5281/zenodo.20696515). The author assumes full responsibility for this content and associated changes.

Activity

  1. claude commented on Nov 28, 2026

    @claude
    Contributor

    🤖 Plan:

    Research

    Qt layouts size a widget by max(sizeHint, minimumSizeHint) (QWidgetItem::sizeHint), but _row_height measures only sizeHint(). QLineEdit.minimumSizeHint() adds max(2, fm.leading()) where sizeHint() adds 2, so a font with leading > 2 (Segoe UI on Windows) gives an edit box one pixel taller in the layout than the row height assumes. That one row is then 25 px instead of 24, hence 57 vs 56.

    Relevant code

    Proposed Fix

    Measure the probes (and the test edit box) as the layout does: sizeHint().expandedTo(minimumSizeHint()). This is a product fix: every row then gets the height the edit row actually takes. It does not add a test tolerance. Qt cannot run in this sandbox (no libEGL), so the windows-latest CI job on the PR is the verification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions