Skip to content

Commit b617c53

Browse files
committed
Refactor test for proxy conflict to use pytest.raises match exp
1 parent 85965ca commit b617c53

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/test_resources.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ def test_proxy_conflict_raises_value_error(self, monkeypatch):
112112
client_configuration = kubernetes.client.Configuration()
113113
client_configuration.proxy = "http://not-env-proxy.com"
114114

115-
with pytest.raises(ValueError) as exc_info:
115+
with pytest.raises(
116+
ValueError,
117+
match="Conflicting proxy settings: client_configuration.proxy=http://not-env-proxy.com, "
118+
"but the environment variable 'OPENSHIFT_PYTHON_WRAPPER_CLIENT_USE_PROXY' defines proxy as http://env-proxy.com.",
119+
):
116120
get_client(client_configuration=client_configuration)
117-
118-
assert "Conflicting proxy settings" in str(exc_info.value)
119-
assert "http://not-env-proxy.com" in str(exc_info.value)
120-
assert "http://env-proxy.com" in str(exc_info.value)

0 commit comments

Comments
 (0)