As this tools integrates with pytest, it would be great to have the following fixtures made available automatically:
import intentguard as ig
import pytest
@pytest.fixture
def guard_options() -> ig.IntentGuardOptions:
return ig.IntentGuardOptions(
num_evaluations=1,
temperature=0.4,
)
@pytest.fixture
def guard(guard_options: ig.IntentGuardOptions) -> ig.IntentGuard:
return ig.IntentGuard(guard_options)
This will allow to refactor tests from
import intentguard as ig
def test_intention() -> None:
guard = ig.IntentGuard()
guard.assert_code(intention, {"module": imported_module })
To:
import intentguard as ig
def test_intention(guard: ig.IntentGuard) -> None:
guard.assert_code(intention, {"module": imported_module })
The user could do this anyway for their codebase, but as other tools like VCR, request-mocks, pytest-subtest, syrupy do, I believe it is convient and enhances the developer experience.
As this tools integrates with pytest, it would be great to have the following fixtures made available automatically:
This will allow to refactor tests from
To:
The user could do this anyway for their codebase, but as other tools like VCR, request-mocks, pytest-subtest, syrupy do, I believe it is convient and enhances the developer experience.