@@ -249,7 +249,7 @@ def test_none_states(self):
249249 raw = dict (RAW_DEVICES )
250250 del raw ["states" ]
251251 device = _make_device (raw )
252- assert not device .states .get (STATE )
252+ assert device .states .get (STATE ) is None
253253
254254 def test_select_first_command (self ):
255255 """Device.select_first_command() returns first supported command from list."""
@@ -379,19 +379,19 @@ def test_empty_states(self):
379379 """An empty list yields an empty States object with no state found."""
380380 states = self ._make_states ([])
381381 assert not states
382- assert not states .get (STATE )
382+ assert states .get (STATE ) is None
383383
384384 def test_none_states (self ):
385385 """A None value for states should behave as empty."""
386386 states = self ._make_states (None )
387387 assert not states
388- assert not states .get (STATE )
388+ assert states .get (STATE ) is None
389389
390390 def test_getter (self ):
391391 """Retrieve a known state and validate its properties."""
392392 states = self ._make_states (RAW_STATES )
393393 state = states .get (STATE )
394- assert state
394+ assert state is not None
395395 assert state .name == STATE
396396 assert state .type == DataType .STRING
397397 assert state .value == "alarm name"
@@ -400,7 +400,7 @@ def test_getter_missing(self):
400400 """Requesting a missing state returns falsy (None)."""
401401 states = self ._make_states (RAW_STATES )
402402 state = states .get ("FooState" )
403- assert not state
403+ assert state is None
404404
405405 def test_select_returns_first_match (self ):
406406 """select() returns the first state with a non-None value."""
@@ -627,7 +627,7 @@ def test_bad_int_value(self):
627627 """Accessor raises TypeError if the state type mismatches expected int."""
628628 state = State (name = "state" , type = DataType .BOOLEAN , value = False )
629629 with pytest .raises (TypeError ):
630- assert state .value_as_int
630+ _ = state .value_as_int
631631
632632 def test_float_value (self ):
633633 """Float typed state returns proper float accessor."""
@@ -638,7 +638,7 @@ def test_bad_float_value(self):
638638 """Accessor raises TypeError if the state type mismatches expected float."""
639639 state = State (name = "state" , type = DataType .BOOLEAN , value = False )
640640 with pytest .raises (TypeError ):
641- assert state .value_as_float
641+ _ = state .value_as_float
642642
643643 def test_bool_value (self ):
644644 """Boolean typed state returns proper boolean accessor."""
@@ -649,7 +649,7 @@ def test_bad_bool_value(self):
649649 """Accessor raises TypeError if the state type mismatches expected bool."""
650650 state = State (name = "state" , type = DataType .INTEGER , value = 1 )
651651 with pytest .raises (TypeError ):
652- assert state .value_as_bool
652+ _ = state .value_as_bool
653653
654654 def test_str_value (self ):
655655 """String typed state returns proper string accessor."""
@@ -660,7 +660,7 @@ def test_bad_str_value(self):
660660 """Accessor raises TypeError if the state type mismatches expected string."""
661661 state = State (name = "state" , type = DataType .BOOLEAN , value = False )
662662 with pytest .raises (TypeError ):
663- assert state .value_as_str
663+ _ = state .value_as_str
664664
665665 def test_dict_value (self ):
666666 """JSON object typed state returns proper dict accessor."""
@@ -671,7 +671,7 @@ def test_bad_dict_value(self):
671671 """Accessor raises TypeError if the state type mismatches expected dict."""
672672 state = State (name = "state" , type = DataType .BOOLEAN , value = False )
673673 with pytest .raises (TypeError ):
674- assert state .value_as_dict
674+ _ = state .value_as_dict
675675
676676 def test_list_value (self ):
677677 """JSON array typed state returns proper list accessor."""
@@ -682,7 +682,7 @@ def test_bad_list_value(self):
682682 """Accessor raises TypeError if the state type mismatches expected list."""
683683 state = State (name = "state" , type = DataType .BOOLEAN , value = False )
684684 with pytest .raises (TypeError ):
685- assert state .value_as_list
685+ _ = state .value_as_list
686686
687687
688688class TestEventState :
0 commit comments