diff --git a/IPython/core/tests/test_interactiveshell.py b/IPython/core/tests/test_interactiveshell.py index f736936..ae4c596 100644 --- a/IPython/core/tests/test_interactiveshell.py +++ b/IPython/core/tests/test_interactiveshell.py @@ -219,4 +219,4 @@ class TestSafeExecfileNonAsciiPath(unittest.TestCase): def test_1(self): """Test safe_execfile with non-ascii path """ - _ip.shell.safe_execfile(self.fname, raise_exceptions=True) + _ip.shell.safe_execfile(self.fname, {}, raise_exceptions=True) diff --git a/IPython/core/tests/test_magic.py b/IPython/core/tests/test_magic.py index 0cf5d56..3e15f01 100644 --- a/IPython/core/tests/test_magic.py +++ b/IPython/core/tests/test_magic.py @@ -324,7 +324,10 @@ def check_cpaste(code, should_fail=False): _ip.user_ns['code_ran'] = False src = StringIO() - src.encoding = None # IPython expects stdin to have an encoding attribute + try: + src.encoding = None # IPython expects stdin to have an encoding attribute + except Exception: + pass # ...but it's a read-only attribute in Python 3 src.write('\n') src.write(code) src.write('\n--\n')