other was non solution, solution is pytest-depends

This commit is contained in:
Silen Naihin
2023-06-25 08:48:16 -04:00
parent 06a6f08054
commit a2f79760ce
9 changed files with 59 additions and 59 deletions

View File

@@ -2,7 +2,6 @@ import pytest
from agbenchmark.Challenge import Challenge
@pytest.mark.run(order=1)
@pytest.mark.basic
class BasicChallenge(Challenge):
pass

View File

@@ -1,9 +1,7 @@
{
"category": ["basic"],
"task": "Write the string 'random string' before any existing text to the file called file_to_check.txt",
"dependencies": [
"agbenchmark/tests/basic_abilities/write_file/write_file_test.py::TestWriteFile::test_write_file"
],
"dependencies": ["test_write_file"],
"ground": {
"answer": "random string: this is how we're doing",
"should_contain": ["random string: this is how we're doing"],

View File

@@ -25,7 +25,7 @@ class TestReadFile(BasicChallenge):
[(data.task, data.mock_func)],
indirect=True,
)
@pytest.mark.order(after=data.dependencies)
@pytest.mark.depends(on=data.dependencies)
def test_read_file(self, workspace):
file = self.open_file(workspace, data.ground.files[0])

View File

@@ -16,6 +16,7 @@ class TestWriteFile(BasicChallenge):
[(data.task, data.mock_func)],
indirect=True,
)
@pytest.mark.depends(name="test_write_file")
def test_write_file(self, workspace):
file = self.open_file(workspace, data.ground.files[0])