File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed
Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -145,11 +145,13 @@ def desc(self):
145145 def update (self , status : str ):
146146 self .status = status
147147
148- try :
149- self .bar .postfix [1 ] = self .status
150- except AttributeError :
151- # If the bar is disabled, attempting to access self.bar.postfix
152- # will result in an error. In this case, just skip it.
153- pass
154-
155- self .bar .refresh ()
148+ if self .bar is not None :
149+ try :
150+ self .bar .postfix [1 ] = self .status
151+ except AttributeError :
152+ # If the bar is disabled, attempting to access self.bar.postfix
153+ # will result in an error. In this case, just skip it.
154+ pass
155+
156+ if self .bar is not None :
157+ self .bar .refresh ()
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ def test_AssetStatusBar_disabled():
7272
7373
7474def test_AssetStatusBar_update ():
75+ """Status is changed with update"""
7576 with reporting .AssetStatusBar ('item-type' , 'item_id' , 'asset_type' ) as bar :
7677 assert ('status: init' ) not in str (bar )
7778
You can’t perform that action at this time.
0 commit comments