MCPcopy Index your code
hub / github.com/python/cpython / assertEqualSign

Method assertEqualSign

Lib/test/test_math.py:2469–2475  ·  view source on GitHub ↗

Similar to assertEqual(), but compare also the sign with copysign(). Function useful to compare signed zeros.

(self, x, y)

Source from the content-addressed store, hash-verified

2467 self.fail("Expected a NaN, got {!r}.".format(value))
2468
2469 def assertEqualSign(self, x, y):
2470 """Similar to assertEqual(), but compare also the sign with copysign().
2471
2472 Function useful to compare signed zeros.
2473 """
2474 self.assertEqual(x, y)
2475 self.assertEqual(math.copysign(1.0, x), math.copysign(1.0, y))
2476
2477
2478class IsCloseTests(unittest.TestCase):

Callers 1

test_nextafterMethod · 0.95

Calls 1

assertEqualMethod · 0.45

Tested by

no test coverage detected