MCPcopy Index your code
hub / github.com/RustPython/RustPython / assert_attr

Method assert_attr

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected