Qitzur Shulchan Arukh – 181:22
Two witness where one knows about his fellow that he is evil and Torahitically disqualified from testifying but the judges do not know his evil, it is prohibited for him [the witness who knows this of the other] to testify with him — even if the testimony is true. For it says “Do not stretch out your hand with someone wicked to be a duplicitous witness”. And it is a decree of scripture that the entire testimony is void even if they are many, if [only] one of them is invalid.
Who is an evil person who is Torahitically disqualified from testifying? Anyone who violates something that [the knowledge] is spread across the Jewish People that it is a sin, and it is something that is a “thou shalt not” of the Torah, and he did it intentionally and didn’t [since] repent. However, if one can ascertain that he did it forgetfully or in error, that he didn’t know it was prohibited, he is not disqualified from testimony.