diff options
author | John Szakmeister <john@szakmeister.net> | 2013-01-20 06:44:46 -0800 |
---|---|---|
committer | John Szakmeister <john@szakmeister.net> | 2013-01-20 06:44:46 -0800 |
commit | f5790a16d292271155d6f8552e3b52b21487ce2b (patch) | |
tree | 44990c9f014dc7de9fd049c59685d7b75aab119d | |
parent | f21db436427a089ef9466a2a386d0ceafcf7129d (diff) | |
parent | fbb2378a737ef91ea4777fcf45a7b28b994884ef (diff) | |
download | nose-f5790a16d292271155d6f8552e3b52b21487ce2b.tar.gz |
Merge pull request #528 from andrea-corbellini/master
Suppress tracebacks caused by ConfigErrors
-rw-r--r-- | functional_tests/doc_tests/test_restricted_plugin_options/restricted_plugin_options.rst | 4 | ||||
-rw-r--r-- | nose/config.py | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/functional_tests/doc_tests/test_restricted_plugin_options/restricted_plugin_options.rst b/functional_tests/doc_tests/test_restricted_plugin_options/restricted_plugin_options.rst index 9513fdf..6a08eaf 100644 --- a/functional_tests/doc_tests/test_restricted_plugin_options/restricted_plugin_options.rst +++ b/functional_tests/doc_tests/test_restricted_plugin_options/restricted_plugin_options.rst @@ -50,7 +50,7 @@ plugins implementing `startTest`, an exception is raised and nose exits. >>> run(argv=argv, plugins=restricted) #doctest: +REPORT_NDIFF +ELLIPSIS Traceback (most recent call last): ... - SystemExit: ... + SystemExit: 2 Errors are only raised when options defined by excluded plugins are used. @@ -86,4 +86,4 @@ error is raised. >>> run(argv=argv, plugins=restricted) # doctest: +ELLIPSIS Traceback (most recent call last): ... - ConfigError: Error reading config file '...bad.cfg': no such option 'with-meltedcheese' + SystemExit: 2 diff --git a/nose/config.py b/nose/config.py index fd39250..bf530be 100644 --- a/nose/config.py +++ b/nose/config.py @@ -129,7 +129,10 @@ class ConfiguredDefaultsOptionParser(object): except ConfigError, exc: self._error(str(exc)) else: - self._applyConfigurationToValues(self._parser, config, values) + try: + self._applyConfigurationToValues(self._parser, config, values) + except ConfigError, exc: + self._error(str(exc)) return self._parser.parse_args(args, values) |