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

Method test_state_is_not_None

Lib/test/test_fileinput.py:640–647  ·  view source on GitHub ↗

Tests that fileinput.close() invokes close() on fileinput._state and sets _state=None

(self)

Source from the content-addressed store, hash-verified

638 self.assertIsNone(fileinput._state)
639
640 def test_state_is_not_None(self):
641 """Tests that fileinput.close() invokes close() on fileinput._state
642 and sets _state=None"""
643 instance = MockFileInput()
644 fileinput._state = instance
645 fileinput.close()
646 self.assertExactlyOneInvocation(instance, "close")
647 self.assertIsNone(fileinput._state)
648
649class Test_fileinput_nextfile(BaseFileInputGlobalMethodsTest):
650 """Unit tests for fileinput.nextfile()"""

Callers

nothing calls this directly

Calls 4

MockFileInputClass · 0.85
assertIsNoneMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected