Skip to content

Commit 02b1859

Browse files
authored
Remove unittest.main() calls (ansible-collections#11304)
Remove unittest.main() calls.
1 parent 2c6746f commit 02b1859

37 files changed

Lines changed: 0 additions & 171 deletions

tests/unit/plugins/modules/test_bitbucket_access_key.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from __future__ import annotations
66

7-
import unittest
87
from unittest.mock import patch
98

109
from ansible_collections.community.general.plugins.module_utils.source_control.bitbucket import BitbucketHelper
@@ -330,7 +329,3 @@ def test_delete_deploy_key_check_mode(self, *args):
330329

331330
self.assertEqual(delete_deploy_key_mock.call_count, 0)
332331
self.assertEqual(exec_info.exception.args[0]["changed"], True)
333-
334-
335-
if __name__ == "__main__":
336-
unittest.main()

tests/unit/plugins/modules/test_bitbucket_pipeline_key_pair.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from __future__ import annotations
66

7-
import unittest
87
from unittest.mock import patch
98

109
from ansible_collections.community.general.plugins.module_utils.source_control.bitbucket import BitbucketHelper
@@ -235,7 +234,3 @@ def test_delete_keys_check_mode(self, *args):
235234

236235
self.assertEqual(delete_ssh_key_pair_mock.call_count, 0)
237236
self.assertEqual(exec_info.exception.args[0]["changed"], True)
238-
239-
240-
if __name__ == "__main__":
241-
unittest.main()

tests/unit/plugins/modules/test_bitbucket_pipeline_known_host.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from __future__ import annotations
66

7-
import unittest
87
from unittest.mock import patch
98

109
import pytest
@@ -217,7 +216,3 @@ def test_delete_known_host_check_mode(self, *args):
217216

218217
self.assertEqual(delete_known_host_mock.call_count, 0)
219218
self.assertEqual(exec_info.exception.args[0]["changed"], True)
220-
221-
222-
if __name__ == "__main__":
223-
unittest.main()

tests/unit/plugins/modules/test_bitbucket_pipeline_variable.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from __future__ import annotations
66

7-
import unittest
87
from unittest.mock import patch
98

109
from ansible_collections.community.general.plugins.module_utils.source_control.bitbucket import BitbucketHelper
@@ -372,7 +371,3 @@ def test_delete_variable_check_mode(self, *args):
372371

373372
self.assertEqual(delete_pipeline_variable_mock.call_count, 0)
374373
self.assertEqual(exec_info.exception.args[0]["changed"], True)
375-
376-
377-
if __name__ == "__main__":
378-
unittest.main()

tests/unit/plugins/modules/test_github_repo.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,3 @@ def test_delete_org_repo_notfound(self):
325325
}
326326
)
327327
self.assertEqual(result["changed"], False)
328-
329-
330-
if __name__ == "__main__":
331-
unittest.main()

tests/unit/plugins/modules/test_ipa_otpconfig.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from __future__ import annotations
66

7-
import unittest
87
from contextlib import contextmanager
98
from unittest.mock import call, patch
109

@@ -296,7 +295,3 @@ def test_fail_post(self):
296295
self.module.main()
297296

298297
self.assertEqual(exec_info.exception.args[0]["msg"], "ERROR MESSAGE")
299-
300-
301-
if __name__ == "__main__":
302-
unittest.main()

tests/unit/plugins/modules/test_ipa_otptoken.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from __future__ import annotations
66

7-
import unittest
87
from contextlib import contextmanager
98
from unittest.mock import call, patch
109

@@ -445,7 +444,3 @@ def test_fail_post(self):
445444
self.module.main()
446445

447446
self.assertEqual(exec_info.exception.args[0]["msg"], "ERROR MESSAGE")
448-
449-
450-
if __name__ == "__main__":
451-
unittest.main()

tests/unit/plugins/modules/test_ipa_pwpolicy.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from __future__ import annotations
66

7-
import unittest
87
from contextlib import contextmanager
98
from unittest.mock import call, patch
109

@@ -600,7 +599,3 @@ def test_fail_post(self):
600599
self.module.main()
601600

602601
self.assertEqual(exec_info.exception.args[0]["msg"], "ERROR MESSAGE")
603-
604-
605-
if __name__ == "__main__":
606-
unittest.main()

tests/unit/plugins/modules/test_keycloak_authentication.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from contextlib import contextmanager
88

9-
import unittest
109
from unittest.mock import patch
1110
from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import (
1211
AnsibleExitJson,
@@ -660,7 +659,3 @@ def test_force_update_auth_flow(self):
660659

661660
# Verify that the module's changed status matches what is expected
662661
self.assertIs(exec_info.exception.args[0]["changed"], changed)
663-
664-
665-
if __name__ == "__main__":
666-
unittest.main()

tests/unit/plugins/modules/test_keycloak_authentication_required_actions.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from __future__ import annotations
66

7-
import unittest
87
from contextlib import contextmanager
98
from unittest.mock import patch
109

@@ -818,7 +817,3 @@ def test_delete_required_action_idempotency(self):
818817

819818
# Verify that the module's changed status matches what is expected
820819
self.assertIs(exec_info.exception.args[0]["changed"], changed)
821-
822-
823-
if __name__ == "__main__":
824-
unittest.main()

0 commit comments

Comments
 (0)