Repository navigation
Add compatibility with Pytest 5.4.0+ - #32
Conversation
'getfslineno' has been removed from 'compat' in Pytest [0]. However, that function was just the wrapper of '_pytest._code.source.getfslineno'. The latter exists in Pytest since, at least, 3.0.0. [0]: pytest-dev/pytest@9c7f1d9b3. Fixes: pytest-dev#30 Signed-off-by: Stanislav Levin <slev@altlinux.org>
https://build.opensuse.org/request/show/803983 by user mcepl + maxlin_factory - Add pytest5-compat.patch to make the test suite compatible with pytest 5.4.0+ (gh#pytest-dev/pytest-forked#32)
|
@RonnyPfannschmidt looks like I hit it too while trying to debug #33. It seems mergeable. |
|
merged, someone has to step up to do a release |
| else: | ||
| path, lineno = getfslineno(item) | ||
| from _pytest._code.source import getfslineno | ||
| path, lineno = getfslineno(item) |
There was a problem hiding this comment.
FTR this returns path = '' and lineno = -1 in my setup. Dunno if it's generally broken in pytest 5.4. It may need some extra investigation.
| path, lineno = item._getfslineno() | ||
| else: | ||
| path, lineno = getfslineno(item) | ||
| from _pytest._code.source import getfslineno |
There was a problem hiding this comment.
It's been relocated to .code 27 days ago: https://github.com/pytest-dev/pytest/pull/7171/files#diff-ef66cddae564a1d8faabcab1bc4dccb4L282
But it's also accessible via __init__ so just removing .source would "fix" it.
There was a problem hiding this comment.
its entirely possible this has been incorrect for years and was just missed
There was a problem hiding this comment.
No, before the mentioned relocation, it was correct.
'getfslineno' has been removed from 'compat' in Pytest [0].
However, that function was just the wrapper of
'_pytest._code.source.getfslineno'. The latter exists in Pytest
since, at least, 3.0.0.
[0]: pytest-dev/pytest@9c7f1d9b3.
Fixes: #30