Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 

# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt 

 

# A test file for HTML reporting by coverage.py. 

 

def one(x): 

# This will be a branch that misses the else. 

8 ↛ 11line 8 didn't jump to line 11, because the condition on line 8 was never false if x < 2: 

a = 3 

else: 

a = 4 

 

one(1) 

 

def two(x): 

# A missed else that branches to "exit" 

17 ↛ exitline 17 didn't return from function 'two', because the condition on line 17 was never false if x: 

a = 5 

 

two(1) 

 

def three(): 

try: 

# This if has two branches, *neither* one taken. 

25 ↛ 26,   25 ↛ 282 missed branches: 1) line 25 didn't jump to line 26, because the condition on line 25 was never true, 2) line 25 didn't jump to line 28, because the condition on line 25 was never false if name_error_this_variable_doesnt_exist: 

a = 1 

else: 

a = 2 

except: 

pass 

 

three()