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

Method testUnaryOps

Lib/test/test_class.py:346–369  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

344 24, 100)))])
345
346 def testUnaryOps(self):
347 testme = AllTests()
348
349 callLst[:] = []
350 -testme
351 self.assertCallStack([('__neg__', (testme,))])
352 callLst[:] = []
353 +testme
354 self.assertCallStack([('__pos__', (testme,))])
355 callLst[:] = []
356 abs(testme)
357 self.assertCallStack([('__abs__', (testme,))])
358 callLst[:] = []
359 int(testme)
360 self.assertCallStack([('__int__', (testme,))])
361 callLst[:] = []
362 float(testme)
363 self.assertCallStack([('__float__', (testme,))])
364 callLst[:] = []
365 oct(testme)
366 self.assertCallStack([('__index__', (testme,))])
367 callLst[:] = []
368 hex(testme)
369 self.assertCallStack([('__index__', (testme,))])
370
371
372 def testMisc(self):

Callers

nothing calls this directly

Calls 5

assertCallStackMethod · 0.95
AllTestsClass · 0.85
octFunction · 0.85
hexFunction · 0.85
absFunction · 0.50

Tested by

no test coverage detected