diff options
-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) |