from typing import Union
import unittest


def _has_any_tests(
    test_case_or_suite: Union[unittest.TestCase, unittest.TestSuite]) -> bool:
  """Returns true if the test suite has any test cases to run."""
  if isinstance(test_case_or_suite, unittest.TestCase):
    return True
  else:
    return any(_has_any_tests(sub_test_case_or_suite)
               for sub_test_case_or_suite in test_case_or_suite)