Skip to content

Commit 74b3e8b

Browse files
Merge pull request #32 from stanislavlevin/pytest_getfslineno
Add compatibility with Pytest 5.4.0+
2 parents bedbc83 + 1eb5791 commit 74b3e8b

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

src/pytest_forked/__init__.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,8 @@ def runforked():
7171

7272

7373
def report_process_crash(item, result):
74-
try:
75-
from _pytest.compat import getfslineno
76-
except ImportError:
77-
# pytest<4.2
78-
path, lineno = item._getfslineno()
79-
else:
80-
path, lineno = getfslineno(item)
74+
from _pytest._code.source import getfslineno
75+
path, lineno = getfslineno(item)
8176
info = ("%s:%s: running the test CRASHED with signal %d" %
8277
(path, lineno, result.signal))
8378
from _pytest import runner

0 commit comments

Comments
 (0)