The try/except ValidatorError block was removed from generate_vumark_instance in both the requests mock server and Flask server because the branches were uncovered by tests.
Once tests exist that exercise invalid requests to POST /targets/{target_id}/instances, the error handling should be added back:
try:
run_services_validators(
request_headers=request.headers,
request_body=_body_bytes(request=request),
request_method=request.method or "",
request_path=request.path_url,
databases=self._target_manager.databases,
)
except ValidatorError as exc:
return exc.status_code, exc.headers, exc.response_text