drop usage of py.path.local calls

Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
This commit is contained in:
Ronny Pfannschmidt
2021-02-22 09:43:52 +01:00
parent 22dad53a24
commit 77cb110258
20 changed files with 138 additions and 131 deletions

View File

@@ -1,11 +1,10 @@
from typing import Sequence
from typing import Union
import py.path
import pytest
from _pytest._code.code import ExceptionChainRepr
from _pytest._code.code import ExceptionRepr
from _pytest.compat import legacy_path
from _pytest.config import Config
from _pytest.pytester import Pytester
from _pytest.reports import CollectReport
@@ -237,7 +236,7 @@ class TestReportSerialization:
reports = reprec.getreports("pytest_runtest_logreport")
assert len(reports) == 3
test_a_call = reports[1]
test_a_call.path1 = py.path.local(pytester.path) # type: ignore[attr-defined]
test_a_call.path1 = legacy_path(pytester.path) # type: ignore[attr-defined]
test_a_call.path2 = pytester.path # type: ignore[attr-defined]
data = test_a_call._to_json()
assert data["path1"] == str(pytester.path)