From 9bb7142daa5e57fc0f455cf7163447df0a12d6ee Mon Sep 17 00:00:00 2001 From: Quentin Peter Date: Wed, 17 Aug 2022 16:28:31 +0200 Subject: [PATCH] remove test no stderr --- .../tests/test_ipythonconsole.py | 24 ------------------- .../ipythonconsole/widgets/main_widget.py | 10 +++----- 2 files changed, 3 insertions(+), 31 deletions(-) diff --git a/spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py b/spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py index dc52e00db5c..f3764fa0c68 100644 --- a/spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py +++ b/spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py @@ -155,13 +155,6 @@ def __getattr__(self, attr): else: test_dir = '' - # Instruct the console to not use a stderr file - no_stderr_file = request.node.get_closest_marker('no_stderr_file') - if no_stderr_file: - test_no_stderr = 'True' - else: - test_no_stderr = '' - # Use the automatic backend if requested auto_backend = request.node.get_closest_marker('auto_backend') if auto_backend: @@ -211,7 +204,6 @@ def __getattr__(self, attr): # Create the console and a new client and set environment os.environ['IPYCONSOLE_TESTING'] = 'True' stdfile.IPYCONSOLE_TEST_DIR = test_dir - os.environ['IPYCONSOLE_TEST_NO_STDERR'] = test_no_stderr window = MainWindowMock() console = IPythonConsole(parent=window, configuration=configuration) console._register() @@ -276,7 +268,6 @@ def __getattr__(self, attr): console.on_close() os.environ.pop('IPYCONSOLE_TESTING') stdfile.IPYCONSOLE_TEST_DIR = None - os.environ.pop('IPYCONSOLE_TEST_NO_STDERR') if os.name == 'nt' or known_leak: # Do not test for leaks @@ -611,21 +602,6 @@ def test_conf_env_vars(ipyconsole, qtbot): assert shell.get_value('a') == 'False' -@flaky(max_runs=3) -@pytest.mark.no_stderr_file -def test_no_stderr_file(ipyconsole, qtbot): - """Test that consoles can run without an stderr.""" - # Wait until the window is fully up - shell = ipyconsole.get_current_shellwidget() - - # Execute a simple assignment - with qtbot.waitSignal(shell.executed): - shell.execute('a = 1') - - # Assert we get the assigned value correctly - assert shell.get_value('a') == 1 - - @pytest.mark.non_ascii_dir @flaky(max_runs=3) @pytest.mark.skipif(os.name == 'nt', reason="It fails on Windows") diff --git a/spyder/plugins/ipythonconsole/widgets/main_widget.py b/spyder/plugins/ipythonconsole/widgets/main_widget.py index f49768515a8..d19726789f0 100644 --- a/spyder/plugins/ipythonconsole/widgets/main_widget.py +++ b/spyder/plugins/ipythonconsole/widgets/main_widget.py @@ -306,7 +306,6 @@ def __init__(self, name=None, plugin=None, parent=None): # Attrs for testing self._testing = bool(os.environ.get('IPYCONSOLE_TESTING')) - self._test_no_stderr = os.environ.get('IPYCONSOLE_TEST_NO_STDERR') layout = QVBoxLayout() layout.setSpacing(0) @@ -1674,12 +1673,9 @@ def create_new_kernel(self, kernel_spec): raise RuntimeError( self.PERMISSION_ERROR_MSG.format(jupyter_runtime_dir())) - stderr_obj = None - stdout_obj = None - if not self._test_no_stderr: - stderr_obj = StdFile(connection_file, '.stderr') - stdout_obj = StdFile(connection_file, '.stdout') - fault_obj = StdFile(connection_file, '.fault') + stderr_obj = StdFile(connection_file, '.stderr') + stdout_obj = StdFile(connection_file, '.stdout') + fault_obj = StdFile(connection_file, '.fault') # Kernel manager kernel_manager = SpyderKernelManager(