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

Method assert_attr

Lib/test/test_decimal.py:4046–4053  ·  view source on GitHub ↗
(a, b, attr, context, signal=None)

Source from the content-addressed store, hash-verified

4044 localcontext = self.decimal.localcontext
4045
4046 def assert_attr(a, b, attr, context, signal=None):
4047 context.clear_flags()
4048 f = getattr(a, attr)
4049 if signal == FloatOperation:
4050 self.assertRaises(signal, f, b)
4051 else:
4052 self.assertIs(f(b), True)
4053 self.assertTrue(context.flags[FloatOperation])
4054
4055 small_d = Decimal('0.25')
4056 big_d = Decimal('3.0')

Callers

nothing calls this directly

Calls 5

clear_flagsMethod · 0.80
assertTrueMethod · 0.80
fFunction · 0.70
assertRaisesMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected