Standalone version of pytest's assertion introspection rewrite