def test_multi_instance(self):
    """Validates that two instances of the env can run in the same thread."""

    def run_episode():
      if 'UNITTEST_IN_DOCKER' in os.environ:
        return 0
      cfg = config.Config({
          'level': 'tests.11_vs_11_hard_deterministic'
      })
      env = football_env.FootballEnv(cfg)
      actions = len(football_action_set.get_action_set(cfg))
      hash_value = compute_hash(env, actions)
      env.close()
      return hash_value

    tpool = pool.ThreadPool(processes=2)
    atexit.register(tpool.close)
    run1 = tpool.apply_async(run_episode)
    run2 = tpool.apply_async(run_episode)
    self.assertEqual(run1.get(), run2.get())
Validates that two instances of the env can run in the same thread.
gfootball/env/football_env_test.py