I urge you not to put yourself to the test of the law — or you may end up in prison.
Tips
history
From 《汉书·王尊传》: 明慎所职,毋以身试法 — an admonition to officials: 'Be clear-eyed and careful in your duties; do not put yourself to the test of the law.' Originally an official warning, now a general cautionary phrase.
usage
Always negative — frames the person as knowingly, willfully breaking the law. Common in news reports on corruption, drug use, fraud.