toga
toga copied to clipboard
Changing Android emulator skin to `pixel_7_pro` breaks scroll tests
Originally posted by @rmartin16 in https://github.com/beeware/toga/issues/2249#issuecomment-1830617979
I/python.stdout: =================================== FAILURES ===================================
I/python.stdout: _________________________________ test_scroll __________________________________
I/python.stdout: Traceback (most recent call last):
I/python.stdout: File "/data/data/org.beeware.toga.testbed/files/chaquopy/AssetFinder/app/tests/widgets/test_detailedlist.py", line 107, in test_scroll
I/python.stdout: assert probe.scroll_position == pytest.approx(
I/python.stdout: AssertionError: assert 4000.0 == 3469.5238095238096 ± 4.0e+02
I/python.stdout: comparison failed
I/python.stdout: Obtained: 4000.0
I/python.stdout: Expected: 3469.5238095238096 ± 4.0e+02
I/python.stdout: _________________________________ test_scroll __________________________________
I/python.stdout: Traceback (most recent call last):
I/python.stdout: File "/data/data/org.beeware.toga.testbed/files/chaquopy/AssetFinder/app/tests/widgets/test_table.py", line 126, in test_scroll
I/python.stdout: assert probe.max_scroll_position > probe.height * 2
I/python.stdout: AssertionError: assert 1286.095238095238 > (1061 * 2)
I/python.stdout: + where 1286.095238095238 = <tests_backend.widgets.table.TableProbe object at 0x70811b283d60>.max_scroll_position
I/python.stdout: + and 1061 = <tests_backend.widgets.table.TableProbe object at 0x70811b283d60>.height
I/python.stdout: =========================== short test summary info ============================
I/python.stdout: FAILED tests/widgets/test_detailedlist.py::test_scroll - assert 4000.0 == 346...
I/python.stdout: FAILED tests/widgets/test_table.py::test_scroll - assert 1286.095238095238 > ...
I/python.stdout: ====== 2 failed, 328 passed, 61 skipped, 25 xfailed in 195.32s (0:03:15) =======
I was able to resolve the testbed failures by having the AVD use pixel_3a skin again.
We likely need to address this before we release a new version of Briefcase, because we don't have any way to (easily) create a pixel3a device as an end user.
For someone wanting to address this - I believe the two issues are related to the size of the device window.
If so, the tests should be updated so they'll work on any reasonably-sized screen.
I would like to give this a shot