def METHOD_NAME(spec):
    with warnings.catch_warnings(record=True) as caught_warnings:
        env = gym.make(spec.id)
        env.reset()
        env.step(env.action_space.sample())
        env.close()
    passive_check_pattern = re.compile("|".join(PASSIVE_CHECK_IGNORE_WARNING))
    for warning in caught_warnings:
        if not passive_check_pattern.search(str(warning.message)):
            print(f"Unexpected warning: {warning.message}")