summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2020-06-23 18:33:47 +0200
committerFlorian Bruhin <me@the-compiler.org>2020-06-23 18:33:47 +0200
commit0518571f910176d07298ea3d5f63e8e68f7a9c1f (patch)
tree9e07a4d2ba1f42dc0eda9066218ba7242300962d
parentadbaf092a26f77d028974add44c55de5bc17a9be (diff)
downloadqutebrowser-0518571f910176d07298ea3d5f63e8e68f7a9c1f.tar.gz
qutebrowser-0518571f910176d07298ea3d5f63e8e68f7a9c1f.zip
tests: Set splitter handle width for InspectorSplitter tests
How the handle width of 5 is distributed on macOS seems like totally random. Instead of trying to get our calculations to work, just force the handle width to an even number.
-rw-r--r--tests/unit/misc/test_miscwidgets.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/unit/misc/test_miscwidgets.py b/tests/unit/misc/test_miscwidgets.py
index e48c9721c..c31c53373 100644
--- a/tests/unit/misc/test_miscwidgets.py
+++ b/tests/unit/misc/test_miscwidgets.py
@@ -17,7 +17,6 @@
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
-import math
import logging
from unittest import mock
@@ -271,7 +270,9 @@ class TestInspectorSplitter:
splitter.show()
resize(old_window_size)
- handle_width = splitter.handleWidth()
+ handle_width = 4
+ splitter.setHandleWidth(handle_width)
+
splitter_idx = 1
if position in [inspector.Position.left, inspector.Position.top]:
splitter_pos = preferred_size - handle_width//2
@@ -284,9 +285,9 @@ class TestInspectorSplitter:
sizes = splitter.sizes()
inspector_size = sizes[splitter._inspector_idx]
main_size = sizes[splitter._main_idx]
- exp_main_size = (new_window_size -
- exp_inspector_size -
- math.ceil(handle_width/2))
+ exp_main_size = new_window_size - exp_inspector_size
+
+ exp_main_size -= handle_width // 2
exp_inspector_size -= handle_width // 2
assert (inspector_size, main_size) == (exp_inspector_size,