diff --git a/examples/test/test_simpleperf.py b/examples/test/test_simpleperf.py
index 7d44c9c7961da57bfe0b2e123f915fc5083a71f1..0c57cef7bef6e206abf28c406d44dc45dd643f91 100755
--- a/examples/test/test_simpleperf.py
+++ b/examples/test/test_simpleperf.py
@@ -24,7 +24,7 @@ def testE2E( self ):
         # check ping results
         p.expect( "Results: (\d+)% dropped", timeout=120 )
         loss = int( p.match.group( 1 ) )
-        self.assertTrue( loss > 0 and loss < 100 )
+        self.assertTrue(0 < loss < 100)
         # check iperf results
         p.expect( "Results: \['([\d\.]+) .bits/sec", timeout=480 )
         bw = float( p.match.group( 1 ) )
@@ -46,7 +46,7 @@ def testTopo( self ):
         m = re.search( expectStr, output )
         loss = int( m.group( 3 ) )
         net.stop()
-        self.assertTrue( loss > 0 and loss < 100 )
+        self.assertTrue(0 < loss < 100)
 
 if __name__ == '__main__':
     setLogLevel( 'warning' )