MCPcopy
hub / github.com/pytest-dev/pytest / test_attribute

Method test_attribute

testing/test_assertrewrite.py:812–835  ·  testing/test_assertrewrite.py::TestAssertionRewrite.test_attribute
(self)

Source from the content-addressed store, hash-verified

810 )
811
812 def test_attribute(self) -> None:
813 class X:
814 g = 3
815
816 ns = {class="st">"x": X}
817
818 def f1() -> None:
819 assert not x.g class="cm"># type: ignore[name-defined] # noqa: F821
820
821 assert (
822 getmsg(f1, ns)
823 == class="st">"""assert not 3
824 + where 3 = x.gclass="st">"""
825 )
826
827 def f2() -> None:
828 x.a = False class="cm"># type: ignore[name-defined] # noqa: F821
829 assert x.a class="cm"># type: ignore[name-defined] # noqa: F821
830
831 assert (
832 getmsg(f2, ns)
833 == class="st">"""assert False
834 + where False = x.aclass="st">"""
835 )
836
837 def test_comparisons(self) -> None:
838 def f1() -> None:

Callers

nothing calls this directly

Calls 1

getmsgFunction · 0.85

Tested by

no test coverage detected