Skip to content

Commit 18c99aa

Browse files
committed
CR: remove dead code
1 parent ad7aec9 commit 18c99aa

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

tests/test_usb.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ async def test_node_relay_and_power(self, monkeypatch: pytest.MonkeyPatch) -> No
843843

844844
# Test non-support relay configuration
845845
with pytest.raises(pw_exceptions.FeatureError):
846-
assert stick.nodes["0098765432101234"].relay_config is not None
846+
assert stick.nodes["0098765432101234"].relay_config
847847
with pytest.raises(pw_exceptions.FeatureError):
848848
await stick.nodes["0098765432101234"].set_relay_init(True)
849849
with pytest.raises(pw_exceptions.FeatureError):
@@ -1816,28 +1816,28 @@ async def load_callback(event: pw_api.NodeEvent, mac: str) -> None: # type: ign
18161816

18171817
# Validate to raise exception when node is not yet loaded
18181818
with pytest.raises(pw_exceptions.NodeError):
1819-
await test_node.set_awake_duration(5) is not None
1819+
await test_node.set_awake_duration(5)
18201820

18211821
with pytest.raises(pw_exceptions.NodeError):
1822-
test_node.battery_config is not None
1822+
test_node.battery_config
18231823

18241824
with pytest.raises(pw_exceptions.NodeError):
1825-
await test_node.set_clock_interval(5) is not None
1825+
await test_node.set_clock_interval(5)
18261826

18271827
with pytest.raises(pw_exceptions.NodeError):
1828-
await test_node.set_clock_sync(False) is not None
1828+
await test_node.set_clock_sync(False)
18291829

18301830
with pytest.raises(pw_exceptions.NodeError):
1831-
await test_node.set_sleep_duration(5) is not None
1831+
await test_node.set_sleep_duration(5)
18321832

18331833
with pytest.raises(pw_exceptions.NodeError):
1834-
await test_node.set_motion_daylight_mode(True) is not None
1834+
await test_node.set_motion_daylight_mode(True)
18351835

18361836
with pytest.raises(pw_exceptions.NodeError):
1837-
test_node.set_motion_sensitivity_level(20) is not None
1837+
test_node.set_motion_sensitivity_level(20)
18381838

18391839
with pytest.raises(pw_exceptions.NodeError):
1840-
await test_node.set_motion_reset_timer(5) is not None
1840+
await test_node.set_motion_reset_timer(5)
18411841

18421842
# Validate to raise NotImplementedError calling load() at basenode
18431843
with pytest.raises(NotImplementedError):
@@ -1847,54 +1847,54 @@ async def load_callback(event: pw_api.NodeEvent, mac: str) -> None: # type: ign
18471847

18481848
# Validate to raise exception when feature is not supported
18491849
with pytest.raises(pw_exceptions.FeatureError):
1850-
await test_node.set_awake_duration(5) is not None
1850+
await test_node.set_awake_duration(5)
18511851

18521852
with pytest.raises(pw_exceptions.FeatureError):
1853-
test_node.battery_config is not None
1853+
test_node.battery_config
18541854

18551855
with pytest.raises(pw_exceptions.FeatureError):
1856-
await test_node.set_clock_interval(5) is not None
1856+
await test_node.set_clock_interval(5)
18571857

18581858
with pytest.raises(pw_exceptions.FeatureError):
1859-
await test_node.set_clock_sync(False) is not None
1859+
await test_node.set_clock_sync(False)
18601860

18611861
with pytest.raises(pw_exceptions.FeatureError):
1862-
await test_node.set_sleep_duration(5) is not None
1862+
await test_node.set_sleep_duration(5)
18631863

18641864
with pytest.raises(pw_exceptions.FeatureError):
1865-
await test_node.set_motion_daylight_mode(True) is not None
1865+
await test_node.set_motion_daylight_mode(True)
18661866

18671867
with pytest.raises(pw_exceptions.FeatureError):
1868-
await test_node.set_motion_sensitivity_level(20) is not None
1868+
await test_node.set_motion_sensitivity_level(20)
18691869

18701870
with pytest.raises(pw_exceptions.FeatureError):
1871-
await test_node.set_motion_reset_timer(5) is not None
1871+
await test_node.set_motion_reset_timer(5)
18721872

18731873
# Add battery feature to test raising not implemented
18741874
# for battery related properties
18751875
test_node._features += (pw_api.NodeFeature.BATTERY,) # pylint: disable=protected-access
18761876
with pytest.raises(NotImplementedError):
1877-
await test_node.set_awake_duration(5) is not None
1877+
await test_node.set_awake_duration(5)
18781878

18791879
with pytest.raises(NotImplementedError):
1880-
test_node.battery_config is not None
1880+
test_node.battery_config
18811881

18821882
with pytest.raises(NotImplementedError):
1883-
await test_node.set_clock_interval(5) is not None
1883+
await test_node.set_clock_interval(5)
18841884

18851885
with pytest.raises(NotImplementedError):
1886-
await test_node.set_clock_sync(False) is not None
1886+
await test_node.set_clock_sync(False)
18871887

18881888
with pytest.raises(NotImplementedError):
1889-
await test_node.set_sleep_duration(5) is not None
1889+
await test_node.set_sleep_duration(5)
18901890

18911891
test_node._features += (pw_api.NodeFeature.MOTION,) # pylint: disable=protected-access
18921892
with pytest.raises(NotImplementedError):
1893-
await test_node.set_motion_daylight_mode(True) is not None
1893+
await test_node.set_motion_daylight_mode(True)
18941894
with pytest.raises(NotImplementedError):
1895-
await test_node.set_motion_sensitivity_level(20) is not None
1895+
await test_node.set_motion_sensitivity_level(20)
18961896
with pytest.raises(NotImplementedError):
1897-
await test_node.set_motion_reset_timer(5) is not None
1897+
await test_node.set_motion_reset_timer(5)
18981898

18991899
assert not test_node.cache_enabled
19001900
assert test_node.mac == "1298347650AFBECD"

0 commit comments

Comments
 (0)