コード例 #1
0
ファイル: test_confpage.py プロジェクト: trollodel/spyder
def test_load_time(qtbot):
    from spyder.plugins.maininterpreter.confpage import (
        MainInterpreterConfigPage)

    # Create Preferences dialog
    dlg = ConfigDialog()
    dlg.main = MainWindowMock()
    dlg.show()
    qtbot.addWidget(dlg)

    # Create page and measure time to do it
    t0 = time.time()
    widget = MainInterpreterConfigPage(plugin=MainInterpreter(None),
                                       parent=dlg)
    widget.initialize()
    load_time = time.time() - t0

    # Add page to Preferences
    dlg.add_page(widget)

    # Assert the combobox is populated with the found envs
    assert widget.cus_exec_combo.combobox.count() > 0

    # Assert load time is smaller than the one required to get envs
    # directly. This means we're using the cached envs instead
    assert load_time < GET_ENVS_TIME

    # Load time should be small too because we perform simple validations
    # on the page.
    assert load_time < 0.5
コード例 #2
0
def test_config(mocker, plugin_no_server, qtbot):
    """Test that config page can be created and shown."""
    dlg = ConfigDialog()
    page = NotebookConfigPage(plugin_no_server, parent=plugin_no_server)
    page.initialize()
    dlg.add_page(page)
    dlg.show()
    qtbot.addWidget(dlg)
コード例 #3
0
ファイル: conftest.py プロジェクト: trollodel/spyder
def global_config_dialog(qtbot):
    """
    Fixture that includes the general preferences options.

    These options are the ones not tied to a specific plugin.
    """
    dlg = ConfigDialog()
    dlg.show()

    qtbot.addWidget(dlg)
    for widget_class in [MainConfigPage]:
        widget = widget_class(dlg, main=MainWindowMock())
        widget.initialize()
        dlg.add_page(widget)

    return dlg
コード例 #4
0
ファイル: conftest.py プロジェクト: zerocewl/spyder
def global_config_dialog(qtbot):
    """
    Fixture that includes the general preferences options.

    These options are the ones not tied to a specific plugin.
    """
    dlg = ConfigDialog()
    dlg.show()

    from spyder.preferences.maininterpreter import MainInterpreterConfigPage
    from spyder.preferences.runconfig import RunConfigPage

    qtbot.addWidget(dlg)
    for widget_class in [AppearanceConfigPage, MainConfigPage,
                         MainInterpreterConfigPage, ShortcutsConfigPage,
                         RunConfigPage]:
        widget = widget_class(dlg, main=MainWindowMock())
        widget.initialize()
        dlg.add_page(widget)
    return dlg