code: use properties for derived attributes, use slots

Make the objects more light weight.

Remove unused properties.
This commit is contained in:
Ran Benita
2020-10-27 10:18:23 +02:00
parent a7e38c5c61
commit a1df458e85
2 changed files with 35 additions and 12 deletions

View File

@@ -747,7 +747,6 @@ raise ValueError()
from _pytest._code.code import Code
monkeypatch.setattr(Code, "path", "bogus")
excinfo.traceback[0].frame.code.path = "bogus" # type: ignore[misc]
p = FormattedExcinfo(style="short")
reprtb = p.repr_traceback_entry(excinfo.traceback[-2])
lines = reprtb.lines