
from mamba import settings, formatters, reporter, runners, example_collector


class ApplicationFactory(object):

    def __init__(self, arguments):
        self._instances = {}
        self.arguments = arguments

    def create_settings(self):
        settings_ = settings.Settings()
        settings_.slow_test_threshold = self.arguments.slow
        settings_.enable_coverage = self.arguments.enable_coverage

        return settings_

    def create_formatter(self):
        return formatters.DocumentationFormatter(self.create_settings())

    def create_example_collector(self):
        return example_collector.ExampleCollector(self.arguments.specs)

    def create_reporter(self):
        return reporter.Reporter(self.create_formatter())

    def create_runner(self):
        settings = self.create_settings()
        if settings.enable_coverage:
            return runners.CodeCoverageRunner(self.create_example_collector(), self.create_reporter())

        return runners.Runner(self.create_example_collector(), self.create_reporter())



from mamba import settings, formatters, reporter, runners, example_collector


class ApplicationFactory(object):

    def __init__(self, arguments):
        self._instances = {}
        self.arguments = arguments

    def create_settings(self):
        settings_ = settings.Settings()
        settings_.slow_test_threshold = self.arguments.slow
        settings_.enable_code_coverage = self.arguments.enable_coverage

        return settings_

    def create_formatter(self):
        return formatters.DocumentationFormatter(self.create_settings())

    def create_example_collector(self):
        return example_collector.ExampleCollector(self.arguments.specs)

    def create_reporter(self):
        return reporter.Reporter(self.create_formatter())

    def create_runner(self):
        settings = self.create_settings()
        if settings.enable_code_coverage:
            return runners.CodeCoverageRunner(self.create_example_collector(), self.create_reporter())

        return runners.Runner(self.create_example_collector(), self.create_reporter())


Fix the enable coverage issue
Fix the enable coverage issue

  
  from mamba import settings, formatters, reporter, runners, example_collector
  
  
  class ApplicationFactory(object):
  
      def __init__(self, arguments):
          self._instances = {}
          self.arguments = arguments
  
      def create_settings(self):
          settings_ = settings.Settings()
          settings_.slow_test_threshold = self.arguments.slow
-         settings_.enable_coverage = self.arguments.enable_coverage
+         settings_.enable_code_coverage = self.arguments.enable_coverage
  
          return settings_
  
      def create_formatter(self):
          return formatters.DocumentationFormatter(self.create_settings())
  
      def create_example_collector(self):
          return example_collector.ExampleCollector(self.arguments.specs)
  
      def create_reporter(self):
          return reporter.Reporter(self.create_formatter())
  
      def create_runner(self):
          settings = self.create_settings()
-         if settings.enable_coverage:
+         if settings.enable_code_coverage:
              return runners.CodeCoverageRunner(self.create_example_collector(), self.create_reporter())
  
          return runners.Runner(self.create_example_collector(), self.create_reporter())
  
  
Fix the enable coverage issue
## Code Before:

from mamba import settings, formatters, reporter, runners, example_collector


class ApplicationFactory(object):

    def __init__(self, arguments):
        self._instances = {}
        self.arguments = arguments

    def create_settings(self):
        settings_ = settings.Settings()
        settings_.slow_test_threshold = self.arguments.slow
        settings_.enable_coverage = self.arguments.enable_coverage

        return settings_

    def create_formatter(self):
        return formatters.DocumentationFormatter(self.create_settings())

    def create_example_collector(self):
        return example_collector.ExampleCollector(self.arguments.specs)

    def create_reporter(self):
        return reporter.Reporter(self.create_formatter())

    def create_runner(self):
        settings = self.create_settings()
        if settings.enable_coverage:
            return runners.CodeCoverageRunner(self.create_example_collector(), self.create_reporter())

        return runners.Runner(self.create_example_collector(), self.create_reporter())


## Instruction:
Fix the enable coverage issue
## Code After:

from mamba import settings, formatters, reporter, runners, example_collector


class ApplicationFactory(object):

    def __init__(self, arguments):
        self._instances = {}
        self.arguments = arguments

    def create_settings(self):
        settings_ = settings.Settings()
        settings_.slow_test_threshold = self.arguments.slow
        settings_.enable_code_coverage = self.arguments.enable_coverage

        return settings_

    def create_formatter(self):
        return formatters.DocumentationFormatter(self.create_settings())

    def create_example_collector(self):
        return example_collector.ExampleCollector(self.arguments.specs)

    def create_reporter(self):
        return reporter.Reporter(self.create_formatter())

    def create_runner(self):
        settings = self.create_settings()
        if settings.enable_code_coverage:
            return runners.CodeCoverageRunner(self.create_example_collector(), self.create_reporter())

        return runners.Runner(self.create_example_collector(), self.create_reporter())

