diff --git a/atlassian/confluence/cloud/cloud.py b/atlassian/confluence/cloud/cloud.py index 860f82806..19c7edfb9 100644 --- a/atlassian/confluence/cloud/cloud.py +++ b/atlassian/confluence/cloud/cloud.py @@ -63,11 +63,8 @@ def __init__(self, url: str, *args, **kwargs): # self._compatibility_method_mapping = { # "old_method_name": "new_method_name" # } - - # Warn about V1 method usage - warnings.warn( - "V1 methods are deprecated in ConfluenceCloud. Use V2 methods instead.", DeprecationWarning, stacklevel=2 - ) + # V1 method names emit their own DeprecationWarning when they are + # called, so creating the client itself does not warn. def __getattr__(self, name): """ diff --git a/tests/test_confluence_v2_compatibility.py b/tests/test_confluence_v2_compatibility.py index f087eb721..1e3a69a69 100644 --- a/tests/test_confluence_v2_compatibility.py +++ b/tests/test_confluence_v2_compatibility.py @@ -19,6 +19,15 @@ def setUp(self): password="password", ) + def test_init_does_not_warn(self): + """Creating a client must not emit a DeprecationWarning by itself.""" + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter("always") + + ConfluenceV2(url="https://example.atlassian.net/wiki", username="username", password="password") + + self.assertEqual([str(warning.message) for warning in w if warning.category is DeprecationWarning], []) + def test_method_mapping_exists(self): """Test that compatibility method mapping exists.""" self.assertTrue(hasattr(self.confluence_v2, "_compatibility_method_mapping"))