MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_attribute

Method test_attribute

testing/test_assertrewrite.py:601–624  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

599 )
600
601 def test_attribute(self) -> None:
602 class X:
603 g = 3
604
605 ns = {"x": X}
606
607 def f1() -> None:
608 assert not x.g # type: ignore[name-defined] # noqa: F821
609
610 assert (
611 getmsg(f1, ns)
612 == """assert not 3
613 + where 3 = x.g"""
614 )
615
616 def f2() -> None:
617 x.a = False # type: ignore[name-defined] # noqa: F821
618 assert x.a # type: ignore[name-defined] # noqa: F821
619
620 assert (
621 getmsg(f2, ns)
622 == """assert False
623 + where False = x.a"""
624 )
625
626 def test_comparisons(self) -> None:
627 def f1() -> None:

Callers

nothing calls this directly

Calls 1

getmsgFunction · 0.85

Tested by

no test coverage detected