We do this, too, if the candidate has something they can show us. As someone else mentioned, this isn't always possible.
For what it's worth, we had someone come in a few weeks ago. Their code sample was pretty good, but there were things I'd have done differently, and, I think, better. But when he explained the code to me, not only was it clear he'd thought carefully about how it was supposed to work, but he had a solid explanation for every design decision. Based on that interview, I thought he should get an offer right away, test be darned. Sadly, after driving down for that, he decided that he didn't want to take on the commute that working for us would require.
And even if he was willing, I'd still have had to give him a test, because that's what management demands.