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

Method number_operators

Lib/test/test_descr.py:231–246  ·  view source on GitHub ↗
(self, a, b, skip=[])

Source from the content-addressed store, hash-verified

229
230 # Tests for unary and binary operators
231 def number_operators(self, a, b, skip=[]):
232 dict = {'a': a, 'b': b}
233
234 for name, expr in self.binops.items():
235 if name not in skip:
236 name = "__%s__" % name
237 if hasattr(a, name):
238 res = eval(expr, dict)
239 self.binop_test(a, b, res, expr, name)
240
241 for name, expr in list(self.unops.items()):
242 if name not in skip:
243 name = "__%s__" % name
244 if hasattr(a, name):
245 res = eval(expr, dict)
246 self.unop_test(a, res, expr, name)
247
248 def test_ints(self):
249 # Testing int operations...

Callers 3

test_intsMethod · 0.95
test_floatsMethod · 0.95
test_complexesMethod · 0.95

Calls 4

binop_testMethod · 0.95
unop_testMethod · 0.95
listClass · 0.85
itemsMethod · 0.45

Tested by

no test coverage detected