Skip to content

Commit

Permalink
Import error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolay Kondratyev committed Feb 6, 2019
1 parent dd5ae6b commit 80cfaec
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/pytest/pytestTestRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@ import sys
import json
import py
from _pytest.compat import getfslineno
def get_line_number(item):
location = getattr(item, 'location', None)
if location is not None:
return location[1]
obj = getattr(item, 'obj', None)
if obj is not None:
return getfslineno(obj)[1]
try:
from _pytest.compat import getfslineno
return getfslineno(obj)[1]
except:
pass
return None
Expand Down

0 comments on commit 80cfaec

Please sign in to comment.