mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-19 12:58:07 +00:00
lint
This commit is contained in:
parent
a79d3d06f2
commit
50f5b50845
3 changed files with 12 additions and 12 deletions
|
|
@ -7,13 +7,13 @@ from reasoning_gym.algorithmic.string_insertion import StringInsertionConfig, St
|
|||
|
||||
def test_string_insertion_config_validation():
|
||||
"""Test that invalid configs raise appropriate errors"""
|
||||
|
||||
|
||||
for field in ["min_string_length", "max_string_length"]:
|
||||
for i in range(-1, 5):
|
||||
with pytest.raises(AssertionError):
|
||||
config = StringInsertionConfig(**{field: i}) # [-1, 4] is invalid
|
||||
config = StringInsertionConfig(**{field: i}) # [-1, 4] is invalid
|
||||
config.validate()
|
||||
|
||||
|
||||
|
||||
def test_string_insertion_dataset_deterministic():
|
||||
"""Test that dataset generates same items with same seed"""
|
||||
|
|
@ -67,7 +67,7 @@ def test_string_insertion_answer():
|
|||
config = StringInsertionConfig(seed=42)
|
||||
dataset = StringInsertionDataset(config)
|
||||
|
||||
# No pattern match
|
||||
# No pattern match
|
||||
assert dataset._get_answer("AAAAAAA") == "AAAAAAA"
|
||||
assert dataset._get_answer("ADBEEBEA") == "ADBEEBEA"
|
||||
assert dataset._get_answer("ADEACA") == "ADEACA"
|
||||
|
|
@ -91,4 +91,4 @@ def test_string_insertion_answer():
|
|||
assert dataset._get_answer("AABCDEEEEEEEBCDEAAAAA") == "AABCDAEEEEEEEBCDEBAAAAA"
|
||||
|
||||
# No reuse of newly inserted characters
|
||||
assert dataset._get_answer("ABCDBCD") == "ABCDABCD"
|
||||
assert dataset._get_answer("ABCDBCD") == "ABCDABCD"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue