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

Method testMixingWithDecimal

Lib/test/test_fractions.py:999–1004  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

997 self.assertEqual(Symbolic('X') ** F(3, 2), Symbolic('X ** 1.5'))
998
999 def testMixingWithDecimal(self):
1000 # Decimal refuses mixed arithmetic (but not mixed comparisons)
1001 self.assertRaises(TypeError, operator.add,
1002 F(3,11), Decimal('3.1415926'))
1003 self.assertRaises(TypeError, operator.add,
1004 Decimal('3.1415926'), F(3,11))
1005
1006 def testComparisons(self):
1007 self.assertTrue(F(1, 2) < F(2, 3))

Callers

nothing calls this directly

Calls 3

DecimalClass · 0.90
FClass · 0.70
assertRaisesMethod · 0.45

Tested by

no test coverage detected