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

Method binary_op_zero_division

Lib/test/test_opcache.py:1426–1442  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1424 self.assert_no_opcode(binary_op_add_extend, "BINARY_OP")
1425
1426 def binary_op_zero_division():
1427 def compactlong_lhs(arg):
1428 42 / arg
1429 def float_lhs(arg):
1430 42.0 / arg
1431
1432 with self.assertRaises(ZeroDivisionError):
1433 compactlong_lhs(0)
1434 with self.assertRaises(ZeroDivisionError):
1435 compactlong_lhs(0.0)
1436 with self.assertRaises(ZeroDivisionError):
1437 float_lhs(0.0)
1438 with self.assertRaises(ZeroDivisionError):
1439 float_lhs(0)
1440
1441 self.assert_no_opcode(compactlong_lhs, "BINARY_OP_EXTEND")
1442 self.assert_no_opcode(float_lhs, "BINARY_OP_EXTEND")
1443
1444 binary_op_zero_division()
1445

Callers

nothing calls this directly

Calls 2

assert_no_opcodeMethod · 0.80
assertRaisesMethod · 0.45

Tested by

no test coverage detected