':type SettingProvider: unittest.mock.Mock'

@patch('Orange.widgets.settings.SettingProvider', create=True)
def test_initialize_with_no_provider(self, SettingProvider):

    handler = SettingsHandler()
    handler.provider = Mock(get_provider=Mock(return_value=None))
    handler.widget_class = SimpleWidget
    provider = Mock()
    SettingProvider.return_value = provider
    widget = SimpleWidget()
    with warnings.catch_warnings(record=True) as w:
        handler.initialize(widget)
        self.assertEqual(1, len(w))
    SettingProvider.assert_called_once_with(SimpleWidget)
    provider.initialize.assert_called_once_with(widget, None)
