diff --git a/pyqtgraph/graphicsItems/AxisItem.py b/pyqtgraph/graphicsItems/AxisItem.py index 3916e8dc..05ce3f94 100644 --- a/pyqtgraph/graphicsItems/AxisItem.py +++ b/pyqtgraph/graphicsItems/AxisItem.py @@ -359,7 +359,7 @@ class AxisItem(GraphicsWidget): if self.fixedHeight is None: if not self.style['showValues']: h = 0 - elif self.style['autoExpandTextSpace'] is True: + elif self.style['autoExpandTextSpace']: h = self.textHeight else: h = self.style['tickTextHeight'] @@ -390,7 +390,7 @@ class AxisItem(GraphicsWidget): if self.fixedWidth is None: if not self.style['showValues']: w = 0 - elif self.style['autoExpandTextSpace'] is True: + elif self.style['autoExpandTextSpace']: w = self.textWidth else: w = self.style['tickTextWidth'] diff --git a/pyqtgraph/graphicsItems/tests/test_ErrorBarItem.py b/pyqtgraph/graphicsItems/tests/test_ErrorBarItem.py index 2b922c1e..f28c681a 100644 --- a/pyqtgraph/graphicsItems/tests/test_ErrorBarItem.py +++ b/pyqtgraph/graphicsItems/tests/test_ErrorBarItem.py @@ -21,19 +21,19 @@ def test_ErrorBarItem_defer_data(): app.processEvents() r_empty_ebi = plot.viewRect() - assert r_no_ebi == r_empty_ebi + assert r_no_ebi.height() == r_empty_ebi.height() err.setData(x=x, y=x, bottom=x, top=x) app.processEvents() r_ebi = plot.viewRect() - assert r_empty_ebi != r_ebi + assert r_ebi.height() > r_empty_ebi.height() # unset data, ErrorBarItem disappears and view rect goes back to original err.setData(x=None, y=None) app.processEvents() r_clear_ebi = plot.viewRect() - assert r_clear_ebi == r_no_ebi + assert r_clear_ebi.height() == r_empty_ebi.height() plot.close()