Mark optional sleeps with no coverage

Codecov frequently whinges about "unexpected coverage changes" on PRs;
this is because the sleep lines affected sometimes execute and sometimes
don't (they're only there to ensure something exists before we test it).
Hopefully codecov notices the pragmas...
This commit is contained in:
Dave Jones
2016-05-09 11:10:31 +01:00
parent 1b7dad5fa4
commit fd4075835e

View File

@@ -189,7 +189,7 @@ def test_led_board_blink_control():
board.blink(0.1, 0.1, n=2)
# make sure the blink thread's started
while not board._blink_leds:
sleep(0.00001)
sleep(0.00001) # pragma: no cover
board[1][0].off() # immediately take over the second LED
board._blink_thread.join() # naughty, but ensures no arbitrary waits in the test
test = [
@@ -236,7 +236,7 @@ def test_led_board_blink_control_all():
board.blink(0.1, 0.1, n=2)
# make sure the blink thread's started
while not board._blink_leds:
sleep(0.00001)
sleep(0.00001) # pragma: no cover
board[0].off() # immediately take over all LEDs
board[1][0].off()
board[1][1].off()