code: def testPerformRewriteStopsOnFailedPostRewriteValidation(self):
      rw = self.MyRewriter(
          False, False, True, self._source_model, self._dest_model
      )
      with self.assertRaisesRegex(
          ValueError, ".*post-rewrite-validate-error"
      ):
          rw.perform_rewrite(self._source_model, self._dest_model)
      self.assertTrue(rw.pre_rewrite_validate_called)
      self.assertTrue(rw.rewrite_called)
      self.assertTrue(rw.post_rewrite_validate_called)
  
file_path: tfx/tfx/components/trainer/rewriting/rewriter_test.py
imports: from absl.testing import absltest
  from tfx.components.trainer.rewriting import rewriter
label_desc: Use image node_id 5 for calling the PerformRewriteTest obj's underlying member method code with example usage: obj.testPerformRewriteStopsOnFailedPostRewriteValidation() without return types