Skip to content

Commit

Permalink
Add expected warning in test_wrapped_set_benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
sogartar committed Mar 26, 2022
1 parent 4715691 commit 64f3ef2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/wrappers/core_wrappers_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/wrappers."""
import pytest
from pytest import warns

from compiler_gym.datasets import Datasets
from compiler_gym.envs.llvm import LlvmEnv
Expand Down Expand Up @@ -182,7 +183,11 @@ def convert_observation(self, observation):
assert env.benchmark == "benchmark://cbench-v1/dijkstra"

# Repeat again for a different benchmark.
env.benchmark = "benchmark://cbench-v1/crc32"
with warns(
UserWarning,
match=r"Changing the benchmark has no effect until reset\(\) is called",
):
env.benchmark = "benchmark://cbench-v1/crc32"
env.reset()
assert env.benchmark == "benchmark://cbench-v1/crc32"

Expand Down

0 comments on commit 64f3ef2

Please sign in to comment.