Skip to content

Commit

Permalink
Try fix test issues on github actions/Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
t20100 committed Aug 30, 2024
1 parent 7526945 commit 960610f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/silx/gui/plot/test/test_plotwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def testResizeWidget(self):
"""Test resizing the widget and receiving limitsChanged events"""
self.plot.resize(200, 200)
self.qapp.processEvents()
self.qWait(100)
self.qWait(500)

xlim = self.plot.getXAxis().getLimits()
ylim = self.plot.getYAxis().getLimits()
Expand All @@ -133,19 +133,19 @@ def testResizeWidget(self):
# Resize without aspect ratio
self.plot.resize(200, 300)
self.qapp.processEvents()
self.qWait(100)
self.qWait(500)
self._checkLimits(expectedXLim=xlim, expectedYLim=ylim)
self.assertEqual(listener.callCount(), 0)

# Resize with aspect ratio
self.plot.setKeepDataAspectRatio(True)
self.qapp.processEvents()
self.qWait(1000)
self.qWait(500)
listener.clear() # Clean-up received signal

self.plot.resize(200, 200)
self.qapp.processEvents()
self.qWait(100)
self.qWait(500)
self.assertNotEqual(listener.callCount(), 0)

def testAddRemoveItemSignals(self):
Expand Down
4 changes: 3 additions & 1 deletion src/silx/gui/plot/test/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /*##########################################################################
#
# Copyright (c) 2016-2021 European Synchrotron Radiation Facility
# Copyright (c) 2016-2024 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -59,6 +59,8 @@ def setUp(self):
self.plot.show()
self.plotAlive = True
self.qWaitForWindowExposed(self.plot)
self.plot.raise_()
self.qapp.processEvents()
TestCaseQt.mouseClick(self, self.plot, button=qt.Qt.LeftButton, pos=(0, 0))

def __onPlotDestroyed(self):
Expand Down
8 changes: 5 additions & 3 deletions src/silx/gui/plot3d/test/test_scenewidgetpicking.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /*##########################################################################
#
# Copyright (c) 2018-2019 European Synchrotron Radiation Facility
# Copyright (c) 2018-2024 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -45,9 +45,11 @@ class TestSceneWidgetPicking(TestCaseQt, ParametricTestCase):
def setUp(self):
super(TestSceneWidgetPicking, self).setUp()
self.widget = SceneWidget()
self.widget.resize(300, 300)
self.widget.show()
# self.qWaitForWindowExposed(self.widget)
self.qWaitForWindowExposed(self.widget)
self.widget.raise_()
self.widget.resize(300, 300)
self.qapp.processEvents()

def tearDown(self):
self.qapp.processEvents()
Expand Down

0 comments on commit 960610f

Please sign in to comment.