Пример #1
0
 def test_check_config_raises_warning_when_deprecated(
         self, arg_name, arg_value):
     notifier = NotifierBase()
     with assertProducesWarnings(DeprecatedApiWarning,
                                 message_pattern='have been deprecated'):
         kwargs = {arg_name: arg_value}
         notifier.checkConfig(**kwargs)
Пример #2
0
 def test_check_config_raises_error_when_deprecated_and_generator(
         self, arg_name, arg_value):
     notifier = NotifierBase()
     with assertProducesWarnings(DeprecatedApiWarning,
                                 message_pattern='have been deprecated'):
         with self.assertRaisesConfigError(
                 'can\'t specify generators and deprecated notifier'):
             kwargs = {arg_name: arg_value}
             notifier.checkConfig(generators=[mock.Mock()], **kwargs)