pytest
1521849c - terminal: fix crash in header reporting when absolute testpaths is used

Commit
5 years ago
terminal: fix crash in header reporting when absolute testpaths is used Regressed in 6.1.0 in 62e249a1f934d1073c9a0167077e133c5e0f6270. The `x` is an `str` but is expected to be a `pathlib.Path`. Not caught by mypy because `config.getini()` returns `Any`. Fix by just removing the `bestrelpath` call: - testpaths are always relative to the rootdir, it thus would be very unusual to specify an absolute path there. - The code was wrong even before the regression: `py.path.local`'s `bestrelpath` function expects a `py.path.local`, not an `str`. But it had some weird `try ... except AttributeError` fallback which just returns the argument, i.e. it was a no-op. So there is no behavior change. - It seems reasonable to me to just print the full path if that's what the ini specifies. (cherry picked from commit 61f80a783a38441040c5999a4033af8004ee4c6b)
Author
Committer
Parents
Loading