def test_calling_without_ipython(self):
        """Test calling embed_interactive when no IPython is around
        """
        try:
            import builtins
        except ImportError:
            import __builtin__ as builtins

        realimport = builtins.__import__

        def myimport(*args):
            """Monkey patch import"""
            if 'IPython' in args[0]:
                raise ImportError
            return realimport(*args)

        my_python = mock.MagicMock()

        if six.PY2:
            builtins_name = '__builtin__.__import__'
        elif six.PY3:
            builtins_name = 'builtins.__import__'
        else:
            raise RuntimeError("Python version not supported")

        with mock.patch(builtins_name, myimport):
            with mock.patch('code.InteractiveConsole', my_python):
                embed_interactive()

        self.assertTrue(my_python.called)
dataset/ETHPy150Open duerrp/pyexperiment/tests/test_interactive.py/TestInteractive.test_calling_without_ipython/swapped operands of `in`