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

Method test_complex

testing/python/approx.py:536–547  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

534 assert approx(x, rel=5e-7, abs=0) != a
535
536 def test_complex(self):
537 within_1e6 = [
538 (1.000001 + 1.0j, 1.0 + 1.0j),
539 (1.0 + 1.000001j, 1.0 + 1.0j),
540 (-1.000001 + 1.0j, -1.0 + 1.0j),
541 (1.0 - 1.000001j, 1.0 - 1.0j),
542 ]
543 for a, x in within_1e6:
544 assert a == approx(x, rel=5e-6, abs=0)
545 assert a != approx(x, rel=5e-7, abs=0)
546 assert approx(x, rel=5e-6, abs=0) == a
547 assert approx(x, rel=5e-7, abs=0) != a
548
549 def test_list(self):
550 actual = [1 + 1e-7, 2 + 1e-8]

Callers

nothing calls this directly

Calls 1

approxFunction · 0.90

Tested by

no test coverage detected