Skip to content

chore(testing): set base dir in op creation #399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions tests/integration/codegen/runner/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


@pytest.fixture(autouse=True)
def repo_config() -> RepoConfig:
def repo_config() -> Generator[RepoConfig, None, None]:
yield RepoConfig(
id=321,
name="Kevin-s-Adventure-Game",
Expand All @@ -34,20 +34,20 @@
)


@pytest.fixture(autouse=True)
def op(repo_config: RepoConfig) -> Generator[RemoteRepoOperator, None, None]:
yield RemoteRepoOperator(repo_config=repo_config, access_token=config.GITHUB_TOKEN)
@pytest.fixture
def op(repo_config: RepoConfig, tmpdir) -> Generator[RemoteRepoOperator, None, None]:
yield RemoteRepoOperator(repo_config=repo_config, access_token=config.GITHUB_TOKEN, base_dir=tmpdir)


@pytest.fixture(autouse=True)
def git_repo_client(repo_config: RepoConfig) -> GitRepoClient:
@pytest.fixture
def git_repo_client(repo_config: RepoConfig) -> Generator[GitRepoClient, None, None]:
yield GitRepoClient(repo_config=repo_config, access_token=config.GITHUB_TOKEN)

Check failure on line 44 in tests/integration/codegen/runner/conftest.py

View workflow job for this annotation

GitHub Actions / mypy

error: Argument "access_token" to "GitRepoClient" has incompatible type "str | None"; expected "str" [arg-type]


@pytest.fixture(autouse=True)
@pytest.fixture
def sandbox_client(repo_config: RepoConfig, get_free_port, tmpdir) -> Generator[SandboxClient, None, None]:
# Use the pre-determined free port and a temporary directory
repo_config.base_dir = str(tmpdir)
sb_client = SandboxClient(repo_config=repo_config, port=get_free_port, git_access_token=config.GITHUB_TOKEN)
sb_client.runner = Mock()

Check failure on line 52 in tests/integration/codegen/runner/conftest.py

View workflow job for this annotation

GitHub Actions / mypy

error: "SandboxClient" has no attribute "runner" [attr-defined]
yield sb_client
Loading