def test_nearly_failure_without_message(self): try: Assert.nearly(34, 42, 3) except AssertionError as e: Assert.equal(e.msg, "34 is not within 3 of 42. ")
def test_nearly_float(self): Assert.nearly(3.14, 3.14379, 0.005)
def test_nearly_failure_with_message(self): try: Assert.nearly(3.15, 3.14159265, "pi rounded improperly") except AssertionError as e: Assert.equal(e.msg, "3.15 is not within 0.005 of 3.14159256. pi rounded improperly")
def test_nearly_integer(self): Assert.nearly(2345, 2346, 1)