docstr: Test if correct reporter is returned from ``detect_reporter()``
docstr_tok: ["Test","if","correct","reporter","is","returned","from","``","detect_reporter","(",")","``"]
code: def testReporterDetection(self):
      """Test if correct reporter is returned from ``detect_reporter()``"""
      reporter = _detect_reporter()
      self.assertTrue(isinstance(reporter, CLIReporter))
      self.assertFalse(isinstance(reporter, JupyterNotebookReporter))
  
      with patch("ray.tune.progress_reporter.IS_NOTEBOOK", True):
          reporter = _detect_reporter()
          self.assertFalse(isinstance(reporter, CLIReporter))
          self.assertTrue(isinstance(reporter, JupyterNotebookReporter))
  
imports: import collections
  import os
  import regex
  import unittest
  from unittest.mock import MagicMock, Mock, patch
  import pytest
  import numpy
  from ray import train, tune
  from ray._private.test_utils import run_string_as_driver
  from ray.tune.progress_reporter import CLIReporter, JupyterNotebookReporter, ProgressReporter, _fair_filter_trials, _best_trial_str, _detect_reporter, _time_passed_str, _trial_progress_str, TuneReporterBase, _max_len
  from ray.tune.result import AUTO_RESULT_KEYS
  from ray.tune.experiment.trial import Trial
label_desc: Use image node_id 15 for calling the ProgressReporterTest obj's underlying member method code with example usage: obj.testReporterDetection() without return types