diff --git a/pyqtgraph/widgets/SpinBox.py b/pyqtgraph/widgets/SpinBox.py index 1289bd4acb..642c3b32ec 100644 --- a/pyqtgraph/widgets/SpinBox.py +++ b/pyqtgraph/widgets/SpinBox.py @@ -1,5 +1,6 @@ import decimal import re +import warnings from math import isinf, isnan from .. import functions as fn @@ -447,11 +448,11 @@ def valueInRange(self, value): return False return True - def updateText(self): + def updateText(self, **kwargs): # temporarily disable validation self.skipValidate = True - txt = self.formatText() + txt = self.formatText(**kwargs) # actually set the text self.lineEdit().setText(txt) @@ -460,7 +461,13 @@ def updateText(self): # re-enable the validation self.skipValidate = False - def formatText(self): + def formatText(self, **kwargs): + if 'prev' in kwargs: + warnings.warn( + "updateText and formatText no longer take prev argument. This will error after January 2025.", + DeprecationWarning, + stacklevel=2 + ) # TODO remove all kwargs handling here and updateText after January 2025 # get the number of decimal places to print decimals = self.opts['decimals'] suffix = self.opts['suffix'] diff --git a/tests/test_stability.py b/tests/test_stability.py index 31684fda64..ac9bafd4d6 100644 --- a/tests/test_stability.py +++ b/tests/test_stability.py @@ -16,12 +16,11 @@ from pyqtgraph.Qt import QtTest from pyqtgraph.util.garbage_collector import GarbageCollector - app = pg.mkQApp() def test_garbage_collector(): - gc = GarbageCollector(interval=0.1) + GarbageCollector(interval=0.1) time.sleep(1)