From 5977604d86c289725a2d8a46bfc1cf20b95857fd Mon Sep 17 00:00:00 2001 From: Christine Wang Date: Mon, 10 Feb 2025 14:18:19 -0800 Subject: [PATCH 1/3] remove test auto use --- ruff.toml | 1 + tests/integration/codegen/runner/conftest.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ruff.toml b/ruff.toml index f30d38974..42d35bf4d 100644 --- a/ruff.toml +++ b/ruff.toml @@ -51,6 +51,7 @@ exclude = [ convention = "google" [lint.pyflakes] extend-generics = [ + "codegen.git.models.pr_options.PROptions", "codegen.sdk.codebase.flagging.enums.MessageType", "codegen.sdk.codebase.flagging.enums.FlagKwargs", "codegen.sdk.codebase.span.Span", diff --git a/tests/integration/codegen/runner/conftest.py b/tests/integration/codegen/runner/conftest.py index 42b0116e3..30843922f 100644 --- a/tests/integration/codegen/runner/conftest.py +++ b/tests/integration/codegen/runner/conftest.py @@ -23,7 +23,7 @@ def get_free_port(): @pytest.fixture(autouse=True) -def repo_config() -> RepoConfig: +def repo_config() -> Generator[RepoConfig, None, None]: yield RepoConfig( id=321, name="Kevin-s-Adventure-Game", @@ -34,17 +34,17 @@ def repo_config() -> RepoConfig: ) -@pytest.fixture(autouse=True) +@pytest.fixture def op(repo_config: RepoConfig) -> Generator[RemoteRepoOperator, None, None]: yield RemoteRepoOperator(repo_config=repo_config, access_token=config.GITHUB_TOKEN) -@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) -@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) From d7f3db9a98a9fdb1b5a905b47f5a8368057d693c Mon Sep 17 00:00:00 2001 From: christinewangcw <146775704+christinewangcw@users.noreply.github.com> Date: Mon, 10 Feb 2025 22:19:48 +0000 Subject: [PATCH 2/3] Automated pre-commit update --- ruff.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/ruff.toml b/ruff.toml index 42d35bf4d..f30d38974 100644 --- a/ruff.toml +++ b/ruff.toml @@ -51,7 +51,6 @@ exclude = [ convention = "google" [lint.pyflakes] extend-generics = [ - "codegen.git.models.pr_options.PROptions", "codegen.sdk.codebase.flagging.enums.MessageType", "codegen.sdk.codebase.flagging.enums.FlagKwargs", "codegen.sdk.codebase.span.Span", From 17e9e9fd7ce36df67435c63c3dfd4bde8452a880 Mon Sep 17 00:00:00 2001 From: Christine Wang Date: Mon, 10 Feb 2025 14:23:57 -0800 Subject: [PATCH 3/3] use basedir --- tests/integration/codegen/runner/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/codegen/runner/conftest.py b/tests/integration/codegen/runner/conftest.py index 30843922f..36998258f 100644 --- a/tests/integration/codegen/runner/conftest.py +++ b/tests/integration/codegen/runner/conftest.py @@ -35,8 +35,8 @@ def repo_config() -> Generator[RepoConfig, None, None]: @pytest.fixture -def op(repo_config: RepoConfig) -> Generator[RemoteRepoOperator, None, None]: - yield RemoteRepoOperator(repo_config=repo_config, access_token=config.GITHUB_TOKEN) +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