diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2020-01-01 15:26:32 +0100 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2020-01-01 15:28:16 +0100 |
commit | efa8d692e62b17c58ee40434fb2c126156bfec5a (patch) | |
tree | 703c23e1482fa3ead0c219c342aa88f7f81115c7 /Cython/Build/Tests/TestIpythonMagic.py | |
parent | ada8dbd865497ff4dd32a49d56a20cd74be498dc (diff) | |
download | cython-ipython711.tar.gz |
Remove legacy imports from IPython integration since the "py3compat" module changed in IPython 7.11.ipython711
Diffstat (limited to 'Cython/Build/Tests/TestIpythonMagic.py')
-rw-r--r-- | Cython/Build/Tests/TestIpythonMagic.py | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/Cython/Build/Tests/TestIpythonMagic.py b/Cython/Build/Tests/TestIpythonMagic.py index fc8a84af7..d9d8322a8 100644 --- a/Cython/Build/Tests/TestIpythonMagic.py +++ b/Cython/Build/Tests/TestIpythonMagic.py @@ -13,15 +13,8 @@ from Cython.TestUtils import CythonTest try: import IPython.testing.globalipapp - from IPython.utils import py3compat except ImportError: # Disable tests and fake helpers for initialisation below. - class _py3compat(object): - def str_to_unicode(self, s): - return s - - py3compat = _py3compat() - def skip_if_not_installed(_): return None else: @@ -35,24 +28,24 @@ try: except ImportError: pass -code = py3compat.str_to_unicode("""\ +code = u"""\ def f(x): return 2*x -""") +""" -cython3_code = py3compat.str_to_unicode("""\ +cython3_code = u"""\ def f(int x): return 2 / x def call(x): return f(*(x,)) -""") +""" -pgo_cython3_code = cython3_code + py3compat.str_to_unicode("""\ +pgo_cython3_code = cython3_code + u"""\ def main(): for _ in range(100): call(5) main() -""") +""" if sys.platform == 'win32': @@ -161,10 +154,10 @@ class TestIPythonMagic(CythonTest): @skip_win32('Skip on Windows') def test_extlibs(self): ip = self._ip - code = py3compat.str_to_unicode(""" + code = u""" from libc.math cimport sin x = sin(0.0) - """) + """ ip.user_ns['x'] = 1 ip.run_cell_magic('cython', '-l m', code) self.assertEqual(ip.user_ns['x'], 0) |