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

# A test file for HTML reporting by coverage. 

 

def one(x): 

    # This will be a branch that misses the else. 

8    if x < 2: 

        a = 3 

    else: 

        a = 4 

 

one(1) 

 

def two(x): 

    # A missed else that branches to "exit" 

exit    if x: 

        a = 5 

 

two(1) 

 

def three_way(): 

    # for-else can be a three-way branch. 

25   26    for i in range(10): 

        if i == 3: 

            break 

    else: 

        return 23 

    return 17 

 

three_way()