'Tests invoking fileinput.input() when fileinput._state is not None
and its _file attribute is also not None.  Expect RuntimeError to
be raised with a meaningful error message and for fileinput._state
to *not* be modified.'

def test_state_is_not_None_and_state_file_is_not_None(self):

    instance = MockFileInput()
    instance._file = object()
    fileinput._state = instance
    with self.assertRaises(RuntimeError) as cm:
        fileinput.input()
    self.assertEqual(('input()    already    active',), cm.exception.args)
    self.assertIs(instance, fileinput._state, 'fileinput._state')
