John 8:6peirazō
This they said, tempting him, that they might have to accuse him. But Jesus stooped down, and with his finger wrote on the ground, as though he heard them not.
States the purpose plainly: testing Jesus to find grounds to accuse him.
Matthew 22:35peirazō
Then one of them, which was a lawyer, asked him a question, tempting him, and saying,
A lawyer tests Jesus with a question about the law.