From 59d939198cd2c51433fc3074b705c7489431d648 2019-06-18 17:36:39 From: Matthias Bussonnier Date: 2019-06-18 17:36:39 Subject: [PATCH] Remove assignment to ip in test files This is already added in globals by the test runner --- diff --git a/IPython/core/tests/test_async_helpers.py b/IPython/core/tests/test_async_helpers.py index a31c67b..f23eae0 100644 --- a/IPython/core/tests/test_async_helpers.py +++ b/IPython/core/tests/test_async_helpers.py @@ -3,7 +3,6 @@ Test for async helpers. Should only trigger on python 3.5+ or will have syntax errors. """ - import sys from itertools import chain, repeat import nose.tools as nt @@ -11,7 +10,7 @@ from textwrap import dedent, indent from unittest import TestCase from IPython.testing.decorators import skip_without -ip = get_ipython() + iprc = lambda x: ip.run_cell(dedent(x)).raise_error() iprc_nr = lambda x: ip.run_cell(dedent(x)) diff --git a/IPython/core/tests/test_autocall.py b/IPython/core/tests/test_autocall.py index a8a3761..10a4e0d 100644 --- a/IPython/core/tests/test_autocall.py +++ b/IPython/core/tests/test_autocall.py @@ -8,11 +8,6 @@ with better-isolated tests that don't rely on the global instance in iptest. from IPython.core.splitinput import LineInfo from IPython.core.prefilter import AutocallChecker from IPython.utils import py3compat -from IPython.testing.globalipapp import get_ipython - - -ip = get_ipython() - def doctest_autocall(): """ diff --git a/IPython/core/tests/test_displayhook.py b/IPython/core/tests/test_displayhook.py index 12f4a8d..7c1a9de 100644 --- a/IPython/core/tests/test_displayhook.py +++ b/IPython/core/tests/test_displayhook.py @@ -3,8 +3,6 @@ from IPython.testing.tools import AssertPrints, AssertNotPrints from IPython.core.displayhook import CapturingDisplayHook from IPython.utils.capture import CapturedIO -ip = get_ipython() - def test_output_displayed(): """Checking to make sure that output is displayed""" diff --git a/IPython/core/tests/test_handlers.py b/IPython/core/tests/test_handlers.py index 45409d9..e87e29d 100644 --- a/IPython/core/tests/test_handlers.py +++ b/IPython/core/tests/test_handlers.py @@ -10,7 +10,6 @@ import nose.tools as nt # our own packages from IPython.core import autocall from IPython.testing import tools as tt -from IPython.testing.globalipapp import get_ipython from IPython.utils import py3compat #----------------------------------------------------------------------------- @@ -18,7 +17,6 @@ from IPython.utils import py3compat #----------------------------------------------------------------------------- # Get the public instance of IPython -ip = get_ipython() failures = [] num_tests = 0 diff --git a/IPython/core/tests/test_iplib.py b/IPython/core/tests/test_iplib.py index b5305d4..adadae5 100644 --- a/IPython/core/tests/test_iplib.py +++ b/IPython/core/tests/test_iplib.py @@ -8,14 +8,6 @@ import nose.tools as nt # our own packages -from IPython.testing.globalipapp import get_ipython - -#----------------------------------------------------------------------------- -# Globals -#----------------------------------------------------------------------------- - -# Get the public instance of IPython -ip = get_ipython() #----------------------------------------------------------------------------- # Test functions diff --git a/IPython/core/tests/test_logger.py b/IPython/core/tests/test_logger.py index 4d61ff2..ebebac1 100644 --- a/IPython/core/tests/test_logger.py +++ b/IPython/core/tests/test_logger.py @@ -6,8 +6,6 @@ import os.path import nose.tools as nt from IPython.utils.tempdir import TemporaryDirectory -_ip = get_ipython() - def test_logstart_inaccessible_file(): try: _ip.logger.logstart(logfname="/") # Opening that filename will fail. diff --git a/IPython/core/tests/test_prefilter.py b/IPython/core/tests/test_prefilter.py index 83d8e90..0e61b46 100644 --- a/IPython/core/tests/test_prefilter.py +++ b/IPython/core/tests/test_prefilter.py @@ -6,12 +6,10 @@ import nose.tools as nt from IPython.core.prefilter import AutocallChecker -from IPython.testing.globalipapp import get_ipython #----------------------------------------------------------------------------- # Tests #----------------------------------------------------------------------------- -ip = get_ipython() def test_prefilter(): """Test user input conversions""" diff --git a/IPython/core/tests/test_prompts.py b/IPython/core/tests/test_prompts.py index 4082b14..95e6163 100644 --- a/IPython/core/tests/test_prompts.py +++ b/IPython/core/tests/test_prompts.py @@ -4,10 +4,6 @@ import unittest from IPython.core.prompts import LazyEvaluate -from IPython.testing.globalipapp import get_ipython - -ip = get_ipython() - class PromptTests(unittest.TestCase): def test_lazy_eval_unicode(self):