diff --git a/tests/test_config_util.py b/tests/test_config_util.py index b2f5749..7486b15 100644 --- a/tests/test_config_util.py +++ b/tests/test_config_util.py @@ -97,7 +97,10 @@ def test_custom_url_logged(self, caplog): # Check that the URL is mentioned in log messages log_messages = [record.message for record in caplog.records] - assert any("https://test.api.com" in msg for msg in log_messages) + from urllib.parse import urlparse + parsed_url = urlparse("https://test.api.com") + expected_hostname = parsed_url.hostname + assert any(expected_hostname in urlparse(msg).hostname for msg in log_messages if urlparse(msg).hostname) def test_default_url_logged(self, caplog): """Test that default API URL is logged in debug messages."""