I already understood what you want to do, what I am trying to understand is why you want to do that, which you don’t explain above.
@Rebse gave a possible guess.
I am not super convinced by the use case. If you want to be permissive on a branch to test something, then you should not care about failing the quality OR you should analyze the test code as a separate project (use a different sonar.projectKey), where you can use a different quality gate.
So in conclusion, what you want to doe @fhumera is current not possible and we could only consider changing that if we have a good use case demonstrating the relevance of that feature.