test_ok2/testing/python
Ran Benita 7eee5c1634 Change `Node.reportinfo()` return value from `py.path` to `str|os.PathLike[str]`
`reportinfo()` is the last remaining py.path-only code path in pytest,
i.e. the last piece holding back py.path deprecation. The problem with
it is that plugins/users use it from both sides -- implementing it
(returning the value) and using it (using the return value). Dealing
with implementers is easy enough -- allow to return `os.PathLike[str]`.
But for callers who expect strictly `py.path` this will break and
there's not really a good way to provide backward compat for this.

From analyzing a corpus of 680 pytest plugins, the vast majority of
`reportinfo` appearances are implementations, and the few callers don't
actually access the path part of the return tuple.

As for test suites that might access `reportinfo` (e.g. using
`request.node.reportinfo()` or other ways), that is much harder to
survey, but from the ones I searched, I only found case
(`pytest_teamcity`, but even then it uses `str(fspath)` so is unlikely
to be affected in practice). They are better served with using
`node.location` or `node.path` directly.

Therefore, just break it and change the return type to
`str|os.PathLike[str]`.

Refs #7259.
2021-10-09 15:02:03 +03:00
..
approx.py Prevent approx from being used without a comparison (#9061) 2021-08-30 18:19:31 +00:00
collect.py Change `Node.reportinfo()` return value from `py.path` to `str|os.PathLike[str]` 2021-10-09 15:02:03 +03:00
fixtures.py Fix non-sensical error message (#9077) 2021-09-24 06:15:53 +02:00
integration.py Change `Node.reportinfo()` return value from `py.path` to `str|os.PathLike[str]` 2021-10-09 15:02:03 +03:00
metafunc.py Refactor internal scope handling by introducing Scope enum 2021-08-01 06:11:56 -03:00
raises.py [pre-commit.ci] pre-commit autoupdate (#8547) 2021-04-14 12:49:09 +03:00
show_fixtures_per_test.py add feature to view fixture source location in invocations with --fixtures-per-test option (#8626) 2021-05-14 14:38:55 +02:00