diff --git a/qa/L0_python_api/test_kserve.py b/qa/L0_python_api/test_kserve.py index 29b7c0cf3f..b810a38125 100644 --- a/qa/L0_python_api/test_kserve.py +++ b/qa/L0_python_api/test_kserve.py @@ -43,8 +43,6 @@ RestrictedFeatures, ) -# To test a class individually, user pytest test_kserve.py -k "" - class TestHttpOptions: def test_correct_http_parameters(self): @@ -135,14 +133,11 @@ def test_correct_parameters(self): rf.remove_feature_group(correct_feature_group) - assert not rf.has_feature(Feature.HEALTH) and not rf.has_feature(Feature.METADATA) + assert not rf.has_feature(Feature.HEALTH) and not rf.has_feature( + Feature.METADATA + ) def test_wrong_rf_parameters(self): - with pytest.raises(AttributeError): - Feature.health # Needs to be HEALTH - with pytest.raises(AttributeError): - Feature.infer # Needs to be INFERENCE - rf = RestrictedFeatures() # Features List needs to be an element from tritonfrontend.Feature with pytest.raises(tritonserver.InvalidArgumentError): @@ -157,7 +152,11 @@ def test_wrong_rf_parameters(self): rf.create_feature_group(key="", value=123, features=[Feature.HEALTH]) # Test collision of Features among individual Feature Groups - with pytest.raises(tritonserver.InvalidArgumentError): + with pytest.raises( + tritonserver.InvalidArgumentError, + match="A given feature can only belong to one " + "group.Feature.HEALTH already belongs to an existing group.", + ): feature_group = FeatureGroup( key="key", value="val", features=[Feature.METADATA, Feature.HEALTH] ) @@ -165,13 +164,6 @@ def test_wrong_rf_parameters(self): rf = RestrictedFeatures(groups=[feature_group]) rf.create_feature_group(key="key2", value="val", features=[Feature.HEALTH]) - with pytest.raises(tritonserver.InvalidArgumentError): - rf = RestrictedFeatures(groups=[feature_group]) - rf.create_feature_group( - key="key", value="val", features=[Feature.METADATA, Feature.HEALTH] - ) - rf.create_feature_group(key="key2", value="val", features=[Feature.HEALTH]) - HTTP_ARGS = (KServeHttp, httpclient, "localhost:8000") # Default HTTP args GRPC_ARGS = (KServeGrpc, grpcclient, "localhost:8001") # Default GRPC args