File tree Expand file tree Collapse file tree 2 files changed +2
-10
lines changed Expand file tree Collapse file tree 2 files changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ Floris Bruynooghe
47
47
Gabriel Reis
48
48
Georgy Dyuldin
49
49
Graham Horler
50
+ Greg Price
50
51
Grig Gheorghiu
51
52
Guido Wesdorp
52
53
Harald Armin Massa
Original file line number Diff line number Diff line change @@ -136,17 +136,8 @@ def pytest_runtestloop(session):
136
136
if session .config .option .collectonly :
137
137
return True
138
138
139
- def getnextitem (i ):
140
- # this is a function to avoid python2
141
- # keeping sys.exc_info set when calling into a test
142
- # python2 keeps sys.exc_info till the frame is left
143
- try :
144
- return session .items [i + 1 ]
145
- except IndexError :
146
- return None
147
-
148
139
for i , item in enumerate (session .items ):
149
- nextitem = getnextitem ( i )
140
+ nextitem = session . items [ i + 1 ] if i + 1 < len ( session . items ) else None
150
141
item .config .hook .pytest_runtest_protocol (item = item , nextitem = nextitem )
151
142
if session .shouldstop :
152
143
raise session .Interrupted (session .shouldstop )
You can’t perform that action at this time.
0 commit comments