mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
add typing for tmp dir fixture
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import json
|
||||
|
||||
import pytest
|
||||
from pytest import TempPathFactory
|
||||
|
||||
from opendevin.events import EventSource, EventStream
|
||||
from opendevin.events.action import (
|
||||
@@ -11,8 +12,8 @@ from opendevin.storage import get_file_store
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def temp_dir(tmp_path_factory):
|
||||
return tmp_path_factory.mktemp('test_event_stream')
|
||||
def temp_dir(tmp_path_factory: TempPathFactory) -> str:
|
||||
return str(tmp_path_factory.mktemp('test_event_stream'))
|
||||
|
||||
|
||||
def collect_events(stream):
|
||||
|
||||
@@ -2,6 +2,7 @@ import logging
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
import pytest
|
||||
from pytest import TempPathFactory
|
||||
|
||||
from opendevin.controller.agent_controller import AgentController
|
||||
from opendevin.controller.state.state import State
|
||||
@@ -28,8 +29,8 @@ logging.basicConfig(level=logging.DEBUG)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def temp_dir(tmp_path_factory):
|
||||
return tmp_path_factory.mktemp('test_is_stuck')
|
||||
def temp_dir(tmp_path_factory: TempPathFactory) -> str:
|
||||
return str(tmp_path_factory.mktemp('test_is_stuck'))
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -4,6 +4,7 @@ from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
import yaml
|
||||
from pytest import TempPathFactory
|
||||
|
||||
from agenthub.micro.registry import all_microagents
|
||||
from opendevin.controller.agent import Agent
|
||||
@@ -16,8 +17,8 @@ from opendevin.storage import get_file_store
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def temp_dir(tmp_path_factory):
|
||||
return tmp_path_factory.mktemp('test_micro_agents')
|
||||
def temp_dir(tmp_path_factory: TempPathFactory) -> str:
|
||||
return str(tmp_path_factory.mktemp('test_micro_agents'))
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -6,6 +6,7 @@ import time
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
from pytest import TempPathFactory
|
||||
|
||||
from opendevin.core.config import AppConfig, SandboxConfig, load_from_env
|
||||
from opendevin.core.logger import opendevin_logger as logger
|
||||
@@ -39,8 +40,8 @@ def print_method_name(request):
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def temp_dir(tmp_path_factory):
|
||||
return tmp_path_factory.mktemp('test_runtime')
|
||||
def temp_dir(tmp_path_factory: TempPathFactory) -> str:
|
||||
return str(tmp_path_factory.mktemp('test_runtime'))
|
||||
|
||||
|
||||
TEST_RUNTIME = os.getenv('TEST_RUNTIME', 'both')
|
||||
|
||||
@@ -5,6 +5,7 @@ from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
import toml
|
||||
from pytest import TempPathFactory
|
||||
|
||||
from opendevin.runtime.utils.runtime_build import (
|
||||
_generate_dockerfile,
|
||||
@@ -19,8 +20,8 @@ RUNTIME_IMAGE_PREFIX = 'od_runtime'
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def temp_dir(tmp_path_factory):
|
||||
return tmp_path_factory.mktemp('test_runtime_build')
|
||||
def temp_dir(tmp_path_factory: TempPathFactory) -> str:
|
||||
return str(tmp_path_factory.mktemp('test_runtime_build'))
|
||||
|
||||
|
||||
def test_put_source_code_to_dir(temp_dir):
|
||||
|
||||
Reference in New Issue
Block a user