diff --git a/agbenchmark/conftest.py b/agbenchmark/conftest.py index 908d39e8..434f6dbd 100644 --- a/agbenchmark/conftest.py +++ b/agbenchmark/conftest.py @@ -17,7 +17,7 @@ def config(): return config -@pytest.fixture +@pytest.fixture(scope="module") def workspace(config): yield config["workspace"] # teardown after test function completes diff --git a/agbenchmark/mocks/tests/basic_mocks.py b/agbenchmark/mocks/tests/basic_mocks.py index eb7b9654..bbff6a9c 100644 --- a/agbenchmark/mocks/tests/basic_mocks.py +++ b/agbenchmark/mocks/tests/basic_mocks.py @@ -7,7 +7,7 @@ def basic_read_file_mock(task: str, workspace: str): This mock reads a file and returns its content. """ - Challenge.write_to_file(workspace, "file_to_check.txt", "this is how we're doing") + # Challenge.write_to_file(workspace, "file_to_check.txt", "this is how we're doing") file_contents = Challenge.open_file(workspace, "file_to_check.txt") diff --git a/agbenchmark/tests/basic_abilities/read_file/read_file_test.py b/agbenchmark/tests/basic_abilities/read_file/read_file_test.py index 610ccdab..35d1d80c 100644 --- a/agbenchmark/tests/basic_abilities/read_file/read_file_test.py +++ b/agbenchmark/tests/basic_abilities/read_file/read_file_test.py @@ -8,6 +8,14 @@ data = ChallengeData.deserialize( ) +@pytest.fixture(scope="module", autouse=True) +def setup_module(workspace): + if data.ground.should_contain: + Challenge.write_to_file( + workspace, data.ground.files[0], "this is how we're doing" + ) + + class TestReadFile(Challenge): """Testing if LLM can read a file""" diff --git a/agbenchmark/tests/regression/regression_tests.txt b/agbenchmark/tests/regression/regression_tests.txt index e69de29b..a5f8fbd1 100644 --- a/agbenchmark/tests/regression/regression_tests.txt +++ b/agbenchmark/tests/regression/regression_tests.txt @@ -0,0 +1,2 @@ +agbenchmark/tests/basic_abilities/write_file/write_file_test.py::TestWriteFile::test_retrieval[server_response0] +agbenchmark/tests/basic_abilities/read_file/read_file_test.py::TestReadFile::test_retrieval[server_response0]