Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Enclosing quotes of sys.argv clearing instruction are now consistent #3997

Merged
merged 16 commits into from
Jan 22, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 9 additions & 14 deletions spyder/plugins/tests/test_ipythonconsole.py
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
# Qt Test Fixtures
#--------------------------------
@pytest.fixture
def botipython(qtbot):
def ipyconsole_bot(qtbot):
widget = IPythonConsole(None, testing=True)
widget.create_new_client()
qtbot.addWidget(widget)
@@ -23,17 +23,12 @@ def botipython(qtbot):

# Tests
#-------------------------------
def test_sys_argv_clear(botipython):
qtbot, ipy = botipython
shell = ipy.get_current_shellwidget()
client = ipy.get_current_client()
def test_sys_argv_clear(ipyconsole_bot):
qtbot, ipyconsole = ipyconsole_bot
shell = ipyconsole.get_current_shellwidget()
client = ipyconsole.get_current_client()

with qtbot.waitSignal(client.sig_shell_ready, timeout=6000) as blocker:
shell.silent_exec_method('import sys;A = len(sys.argv)')
len_argv = shell.get_value("A")
while len_argv is None:
shell.silent_exec_method('import sys;A = len(sys.argv)')
qtbot.keyClicks(client.get_control(), 'import sys;A = len(sys.argv)')
qtbot.keyPress(client.get_control(), Qt.Key_Return)
len_argv = shell.get_value("A")
assert len_argv == 1
qtbot.waitUntil(lambda: shell._prompt_html is not None, timeout=6000)
shell.execute('import sys; A = sys.argv')
argv = shell.get_value("A")
assert argv == ['']
3 changes: 0 additions & 3 deletions spyder/widgets/ipythonconsole/client.py
Original file line number Diff line number Diff line change
@@ -82,8 +82,6 @@ class ClientWidget(QWidget, SaveHistoryMixin):
SEPARATOR = '%s##---(%s)---' % (os.linesep*2, time.ctime())
append_to_history = Signal(str, str)

sig_shell_ready = Signal()

def __init__(self, plugin, name, history_filename, config_options,
additional_options, interpreter_versions,
connection_file=None, hostname=None,
@@ -433,4 +431,3 @@ def _hide_loading_page(self):

document = self.get_control().document()
document.contentsChange.disconnect(self._hide_loading_page)
self.sig_shell_ready.emit()