def test_state_is_None(self): """Tests that fileinput.close() does nothing if fileinput._state is None""" fileinput._state = None fileinput.close() self.assertIsNone(fileinput._state)