def setup_findinfiles(qtbot, *args, **kwargs): """Set up find in files widget.""" widget = FindInFilesWidget(None, *args, **kwargs) widget.resize(640, 480) qtbot.addWidget(widget) widget.show() return widget
def setup_findinfiles(qtbot, *args, **kwargs): """Set up find in files widget.""" widget = FindInFilesWidget(None, *args, **kwargs) widget.resize(640, 480) qtbot.addWidget(widget) widget.show() return widget
def findinfiles(qtbot, request): """Set up find in files widget.""" if getattr(request, 'param', False): param = request.param else: param = None plugin_mock = MagicMock() plugin_mock.CONF_SECTION = 'find_in_files' if param: prev_values = {} for param_name in param: value = param[param_name] prev_values[param_name] = CONF.get('find_in_files', param_name) CONF.set('find_in_files', param_name, value) widget = FindInFilesWidget('find_in_files', plugin=plugin_mock) widget._setup() widget.setup() def teardown(): for param_name in prev_values: value = prev_values[param_name] CONF.set('find_in_files', param_name, value) request.addfinalizer(teardown) else: widget = FindInFilesWidget('find_in_files', plugin=plugin_mock) widget._setup() widget.setup() widget.resize(640, 480) qtbot.addWidget(widget) widget.show() return widget
def findinfiles(qtbot, request): """Set up find in files widget.""" if getattr(request, 'param', False): param = request.param else: param = None if param: widget = FindInFilesWidget(None, **param) else: widget = FindInFilesWidget(None) widget.resize(640, 480) qtbot.addWidget(widget) widget.show() return widget
def findinfiles(qtbot, request): """Set up find in files widget.""" if getattr(request, 'param', False): param = request.param else: param = None if param: widget = FindInFilesWidget(None, **param) else: widget = FindInFilesWidget(None) widget.resize(640, 480) qtbot.addWidget(widget) widget.show() return widget
def findinfiles(qtbot, request): """Set up find in files widget.""" if getattr(request, 'param', False): param = request.param else: param = None if param: options = FindInFilesWidget.DEFAULT_OPTIONS.copy() options.update(param) widget = FindInFilesWidget('find_in_files', options=options) widget._setup(options=options) widget.setup(options=options) else: widget = FindInFilesWidget('find_in_files') widget._setup() widget.setup() widget.resize(640, 480) qtbot.addWidget(widget) widget.show() return widget