Skip to content

Commit

Permalink
Merge pull request #217 from abdullahkhalids/save-load-args
Browse files Browse the repository at this point in the history
Add functionality to save and load command-line args
  • Loading branch information
jitseniesen committed Nov 8, 2023
2 parents ac9ee16 + f97ca71 commit 7b614af
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions spyder_unittest/unittestplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ class UnitTestPlugin(SpyderDockablePlugin):
{'framework': '',
'wdir': '',
'coverage': False,
'args': [],
'abbrev_test_names': False}),
('shortcuts',
{'unittest/Run tests': 'Alt+Shift+F11'})]
CONF_NAMEMAP = {CONF_SECTION: [(CONF_SECTION,
['framework', 'wdir', 'coverage'])]}
CONF_NAMEMAP = {CONF_SECTION:
[(CONF_SECTION,
['framework', 'wdir', 'coverage', 'args'])]}
CONF_FILE = True
CONF_VERSION = '0.2.0'
CONF_WIDGET_CLASS = UnitTestConfigPage
Expand Down Expand Up @@ -318,7 +320,8 @@ def load_config(self):
new_config = Config(
framework=project.get_option('framework', self.CONF_SECTION),
wdir=project.get_option('wdir', self.CONF_SECTION),
coverage=project.get_option('coverage', self.CONF_SECTION))
coverage=project.get_option('coverage', self.CONF_SECTION),
args=project.get_option('args', self.CONF_SECTION))
if not widget.config_is_valid(new_config):
new_config = None
widget.set_config_without_emit(new_config)
Expand All @@ -339,6 +342,7 @@ def save_config(self, test_config):
self.CONF_SECTION)
project.set_option('wdir', test_config.wdir, self.CONF_SECTION)
project.set_option('coverage', test_config.coverage, self.CONF_SECTION)
project.set_option('args', test_config.args, self.CONF_SECTION)

def goto_in_editor(self, filename, lineno):
"""
Expand Down

0 comments on commit 7b614af

Please sign in to comment.