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

Method test_comparisons

testing/test_assertrewrite.py:837–867  ·  testing/test_assertrewrite.py::TestAssertionRewrite.test_comparisons
(self)

Source from the content-addressed store, hash-verified

835 )
836
837 def test_comparisons(self) -> None:
838 def f1() -> None:
839 a, b = range(2)
840 assert b < a
841
842 assert getmsg(f1) == class="st">""class="st">"assert 1 < 0"class="st">""
843
844 def f2() -> None:
845 a, b, c = range(3)
846 assert a > b > c
847
848 assert getmsg(f2) == class="st">""class="st">"assert 0 > 1"class="st">""
849
850 def f3() -> None:
851 a, b, c = range(3)
852 assert a < b > c
853
854 assert getmsg(f3) == class="st">""class="st">"assert 1 > 2"class="st">""
855
856 def f4() -> None:
857 a, b, c = range(3)
858 assert a < b <= c
859
860 getmsg(f4, must_pass=True)
861
862 def f5() -> None:
863 a, b, c = range(3)
864 assert a < b
865 assert b < c
866
867 getmsg(f5, must_pass=True)
868
869 def test_len(self, request) -> None:
870 def f():

Callers

nothing calls this directly

Calls 1

getmsgFunction · 0.85

Tested by

no test coverage detected