mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 08:05:31 +02:00
Enable strict typing in certbot-dns-digitalocean (#10158)
If we do `type: ignore` but don't set `--strict`, mypy gets mad. Flake8 doesn't like this but luckily we don't use that here (yet?). The other option is to add `# type: ignore [method-assign, unused-ignore]`; I can change it to that if that's preferred. ``` $ mypy --strict certbot-dns-digitalocean/certbot_dns_digitalocean Success: no issues found in 5 source files ```
This commit is contained in:
+4
-1
@@ -34,7 +34,10 @@ class AuthenticatorTest(test_util.TempDirTestCase, dns_test_common.BaseAuthentic
|
||||
|
||||
self.mock_client = mock.MagicMock()
|
||||
# _get_digitalocean_client | pylint: disable=protected-access
|
||||
self.auth._get_digitalocean_client = mock.MagicMock(return_value=self.mock_client)
|
||||
# workaround for wont-fix https://github.com/python/mypy/issues/2427 that works with
|
||||
# both strict and non-strict mypy
|
||||
setattr(self.auth, '_get_digitalocean_client',
|
||||
mock.MagicMock(return_value=self.mock_client))
|
||||
|
||||
@test_util.patch_display_util()
|
||||
def test_perform(self, unused_mock_get_utility):
|
||||
|
||||
Reference in New Issue
Block a user