mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-01-08 08:44:23 +01:00
finally figured out right way to do dependencies
This commit is contained in:
@@ -2,6 +2,7 @@ import pytest
|
||||
from agbenchmark.Challenge import Challenge
|
||||
|
||||
|
||||
@pytest.mark.run(order=1)
|
||||
@pytest.mark.basic
|
||||
class BasicChallenge(Challenge):
|
||||
pass
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
{
|
||||
"category": ["basic"],
|
||||
"task": "Write the string 'random string' before any existing text to the file called file_to_check.txt",
|
||||
"dependencies": ["test_write_file"],
|
||||
"dependencies": [
|
||||
"agbenchmark/tests/basic_abilities/write_file/write_file_test.py::TestWriteFile::test_write_file"
|
||||
],
|
||||
"ground": {
|
||||
"answer": "random string: this is how we're doing",
|
||||
"should_contain": ["random string: this is how we're doing"],
|
||||
|
||||
@@ -3,7 +3,6 @@ from agbenchmark.challenges.define_task_types import ChallengeData
|
||||
from agbenchmark.Challenge import Challenge
|
||||
from agbenchmark.tests.basic_abilities.BasicChallenge import BasicChallenge
|
||||
import os
|
||||
from pytest_dependency import depends
|
||||
|
||||
data = ChallengeData.deserialize(
|
||||
os.path.join(os.path.dirname(__file__), "r_file_data.json")
|
||||
@@ -26,9 +25,8 @@ class TestReadFile(BasicChallenge):
|
||||
[(data.task, data.mock_func)],
|
||||
indirect=True,
|
||||
)
|
||||
def test_read_file(self, request, workspace):
|
||||
depends(request, data.dependencies)
|
||||
|
||||
@pytest.mark.order(after=data.dependencies)
|
||||
def test_read_file(self, workspace):
|
||||
file = self.open_file(workspace, data.ground.files[0])
|
||||
|
||||
score = self.scoring(file, data.ground)
|
||||
|
||||
@@ -16,7 +16,6 @@ class TestWriteFile(BasicChallenge):
|
||||
[(data.task, data.mock_func)],
|
||||
indirect=True,
|
||||
)
|
||||
@pytest.mark.dependency()
|
||||
def test_write_file(self, workspace):
|
||||
file = self.open_file(workspace, data.ground.files[0])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user