Skip to content

Commit

Permalink
remove test no stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Peter committed Aug 17, 2022
1 parent 2264f2b commit 9bb7142
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 31 deletions.
24 changes: 0 additions & 24 deletions spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
10 changes: 3 additions & 7 deletions spyder/plugins/ipythonconsole/widgets/main_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 9bb7142

Please sign in to comment.