def METHOD_NAME() -> str:
  """Returns the path to the test data directory to be used for testing."""
  # List of pairs <Env. variable, Path>.
  testdata_paths = []
  if 'TINK_PYTHON_ROOT_PATH' in os.environ:
    testdata_paths.append(('TINK_PYTHON_ROOT_PATH',
                           os.path.join(os.environ['TINK_PYTHON_ROOT_PATH'],
                                        'testdata')))
  if 'TEST_SRCDIR' in os.environ:
    testdata_paths.append(('TEST_SRCDIR',
                           os.path.join(os.environ['TEST_SRCDIR'],
                                        _RELATIVE_TESTDATA_PATH)))
  for env_variable, testdata_path in testdata_paths:
    # Return the first path that is encountered.
    if not os.path.exists(testdata_path):
      raise FileNotFoundError(f'Variable {env_variable} is set but has an ' +
                              f'invalid path {testdata_path}')
    return testdata_path
  raise ValueError('No path environment variable set among ' +
                   'TINK_PYTHON_ROOT_PATH, TEST_SRCDIR')