How about using the srcref based approach in https://github.com/hadley/testthat/pull/85 ?