Skip to content

Commit

Permalink
Clean Code
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbautista committed Nov 5, 2024
1 parent 709ccc6 commit f0ad735
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions qtconsole/tests/test_qtconsoleapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from qtconsole.console_widget import ConsoleWidget
from qtconsole.qtconsoleapp import JupyterQtConsoleApp
from unittest.mock import patch

from . import no_display

Expand All @@ -21,7 +22,6 @@
def test_shortcut_traitlets():
""" Verify that the traitlets are initialized correctly.
"""

# Simulate startup
app = JupyterQtConsoleApp()
app.initialize()
Expand Down Expand Up @@ -62,9 +62,9 @@ def test_custom_shortcut_manager(shortcut):
"""
# Simulate startup with a command-line argument that changes shortcuts
test_args = ["test", f"--JupyterQtConsoleApp.shortcut_{shortcut}=Ctrl+O"]
sys.argv = test_args
# Initialize the application with the simulated arguments
app = JupyterQtConsoleApp()
app.initialize()
# Check if the shortcut traitlet has the expected value
assert getattr(app, f"shortcut_{shortcut}") == "Ctrl+O"
with patch("sys.argv", test_args):
# Initialize the application with the simulated arguments
app = JupyterQtConsoleApp()
app.initialize()
# Check if the shortcut traitlet has the expected value
assert getattr(app, f"shortcut_{shortcut}") == "Ctrl+O"

0 comments on commit f0ad735

Please sign in to comment.