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

Method test_not_

Lib/test/test_operator.py:573–583  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

571 operator.index(None)
572
573 def test_not_(self):
574 operator = self.module
575 class C:
576 def __bool__(self):
577 raise SyntaxError
578 self.assertRaises(TypeError, operator.not_)
579 self.assertRaises(SyntaxError, operator.not_, C())
580 self.assertFalse(operator.not_(5))
581 self.assertFalse(operator.not_([0]))
582 self.assertTrue(operator.not_(0))
583 self.assertTrue(operator.not_([]))
584
585 def test_length_hint(self):
586 operator = self.module

Callers

nothing calls this directly

Calls 4

assertFalseMethod · 0.80
assertTrueMethod · 0.80
CClass · 0.70
assertRaisesMethod · 0.45

Tested by

no test coverage detected