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

Method test_decimal_complex_comparison

Lib/test/test_decimal.py:1839–1857  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1837 self.assertNotEqual(0.1, Decimal('0.1'))
1838
1839 def test_decimal_complex_comparison(self):
1840 Decimal = self.decimal.Decimal
1841
1842 da = Decimal('0.25')
1843 db = Decimal('3.0')
1844 self.assertNotEqual(da, (1.5+0j))
1845 self.assertNotEqual((1.5+0j), da)
1846 self.assertEqual(da, (0.25+0j))
1847 self.assertEqual((0.25+0j), da)
1848 self.assertEqual((3.0+0j), db)
1849 self.assertEqual(db, (3.0+0j))
1850
1851 self.assertNotEqual(db, (3.0+1j))
1852 self.assertNotEqual((3.0+1j), db)
1853
1854 self.assertIs(db.__lt__(3.0+0j), NotImplemented)
1855 self.assertIs(db.__le__(3.0+0j), NotImplemented)
1856 self.assertIs(db.__gt__(3.0+0j), NotImplemented)
1857 self.assertIs(db.__le__(3.0+0j), NotImplemented)
1858
1859 def test_decimal_fraction_comparison(self):
1860 D = self.decimal.Decimal

Callers

nothing calls this directly

Calls 7

__lt__Method · 0.95
__le__Method · 0.95
__gt__Method · 0.95
DecimalClass · 0.85
assertNotEqualMethod · 0.80
assertEqualMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected