PyCollector.collect: use explicit cast to `str`
Ref: https://github.com/pytest-dev/pytest/pull/6521#pullrequestreview-347234792
This commit is contained in:
parent
9c7b3c57d7
commit
0b6258ab5b
|
@ -369,7 +369,12 @@ class PyCollector(PyobjMixin, nodes.Collector):
|
|||
if not isinstance(res, list):
|
||||
res = [res]
|
||||
values.extend(res)
|
||||
values.sort(key=lambda item: item.reportinfo()[:2])
|
||||
|
||||
def sort_key(item):
|
||||
fspath, lineno, _ = item.reportinfo()
|
||||
return (str(fspath), lineno)
|
||||
|
||||
values.sort(key=sort_key)
|
||||
return values
|
||||
|
||||
def _makeitem(self, name, obj):
|
||||
|
|
Loading…
Reference in New Issue