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

Method testLog10

Lib/test/test_math.py:1285–1307  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1283 self.assertEqual(actual, expected)
1284
1285 def testLog10(self):
1286 self.assertRaises(TypeError, math.log10)
1287 self.ftest('log10(0.1)', math.log10(0.1), -1)
1288 self.ftest('log10(1)', math.log10(1), 0)
1289 self.ftest('log10(10)', math.log10(10), 1)
1290 self.ftest('log10(10**1000)', math.log10(10**1000), 1000.0)
1291 self.ftest('log10(MyIndexable(10))', math.log10(MyIndexable(10)), 1)
1292 self.ftest('log10(MyIndexable(10**1000))',
1293 math.log10(MyIndexable(10**1000)), 1000.0)
1294 self.assertRaises(ValueError, math.log10, 0.0)
1295 self.assertRaises(ValueError, math.log10, 0)
1296 self.assertRaises(ValueError, math.log10, MyIndexable(0))
1297 self.assertRaises(ValueError, math.log10, -1.5)
1298 self.assertRaises(ValueError, math.log10, -1)
1299 self.assertRaises(ValueError, math.log10, MyIndexable(-1))
1300 self.assertRaises(ValueError, math.log10, -10**1000)
1301 self.assertRaises(ValueError, math.log10, MyIndexable(-10**1000))
1302 self.assertRaises(ValueError, math.log10, NINF)
1303 self.assertEqual(math.log(INF), INF)
1304 self.assertTrue(math.isnan(math.log10(NAN)))
1305
1306 self.assertEqual(math.log10(IndexableFloatLike(100.0, 10**1000)), 2.0)
1307 self.assertEqual(math.log10(IndexableFloatLike(OverflowError(), 10**1000)), 1000.0)
1308
1309 @support.bigmemtest(2**32, memuse=0.2)
1310 def test_log_huge_integer(self, size):

Callers

nothing calls this directly

Calls 8

ftestMethod · 0.95
IndexableFloatLikeClass · 0.85
assertTrueMethod · 0.80
MyIndexableClass · 0.70
assertRaisesMethod · 0.45
log10Method · 0.45
assertEqualMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected