class_docstr: Tests for verifying ProgressHooks.
      
class_docstr_tok: ["Tests","for","verifying","ProgressHooks","."]
code: def test_error_handling(self, chunked):
      publisher = TestingProgressPublisher()
      hooks = [ProgressHooks.with_static_publisher(publisher)]
  
      class SomeError(Exception):
          pass
  
      class ExplodingFactor(CustomFactor):
          inputs = [TestingDataSet.float_col]
          window_length = 1
  
          def compute(self, *args, **kwargs):
              raise SomeError()
  
      pipeline = Pipeline(
          {"boom": ExplodingFactor()}, domain=US_EQUITIES
      )
      start_date, end_date = self.trading_days[[-10, -1]]
  
      with self.assertRaises(SomeError):
          if chunked:
              self.run_chunked_pipeline(
                  pipeline=pipeline,
                  start_date=start_date,
                  end_date=end_date,
                  chunksize=5,
                  hooks=hooks,
              )
          else:
              self.run_pipeline(
                  pipeline=pipeline,
                  start_date=start_date,
                  end_date=end_date,
                  hooks=hooks,
              )
  
      final_update = publisher.trace[-1]
      self.assertEqual(final_update.state, "error")
  
imports: import itertools
  from operator import attrgetter
  import numpy
  import pandas
  import toolz
  from zipline.pipeline import Pipeline
  from zipline.pipeline.classifiers import Everything
  from zipline.pipeline.domain import US_EQUITIES
  from zipline.pipeline.factors import CustomFactor
  from zipline.pipeline.data import Column, DataSet
  from zipline.pipeline.data.testing import TestingDataSet
  from zipline.pipeline.hooks.testing import TestingHooks
  from zipline.pipeline.hooks.progress import ProgressHooks, repr_htmlsafe, TestingProgressPublisher
  from zipline.pipeline.term import AssetExists, ComputableTerm, LoadableTerm
  from zipline.testing import parameter_space
  from zipline.testing.fixtures import ZiplineTestCase, WithSeededRandomPipelineEngine
  from zipline.testing.predicates import assert_almost_equal, instance_of
label_desc: Use image node_id 6 for calling the ProgressHooksTestCase obj's underlying member method code with example usage: obj.test_error_handling(chunked) without return types