Skip to content

Commit bf8bc43

Browse files
committed
testing: reimpl default values CITs
- Update and reimplement default values tests.
1 parent ee47eb3 commit bf8bc43

File tree

9 files changed

+832
-501
lines changed

9 files changed

+832
-501
lines changed

src/rust/rust_kvs/tests/cit_default_values.rs

Lines changed: 0 additions & 498 deletions
This file was deleted.

tests/python_test_cases/tests/common_scenario.py renamed to tests/python_test_cases/tests/common.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
from pathlib import Path
2+
import shutil
3+
from typing import Generator
24
import pytest
35
from testing_utils import Scenario, LogContainer, BuildTools, BazelTools
46

@@ -14,6 +16,33 @@ class ResultCode:
1416
SIGABRT = -6
1517

1618

19+
def temp_dir_common(
20+
tmp_path_factory: pytest.TempPathFactory, base_name: str, *args: str
21+
) -> Generator[Path, None, None]:
22+
"""
23+
Create temporary directory and remove it after test.
24+
Common implementation to be reused by fixtures.
25+
26+
Returns generator providing numbered path to temporary directory.
27+
E.g., '<TMP_PATH>/<BASE_NAME>-<ARG1>-<ARG2><NUMBER>/'.
28+
29+
Parameters
30+
----------
31+
tmp_path_factory : pytest.TempPathFactory
32+
Factory for temporary directories.
33+
base_name : str
34+
Base directory name.
35+
'self.__class__.__name__' use is recommended.
36+
*args : Any
37+
Other parameters to be included in directory name.
38+
"""
39+
parts = [base_name, *args]
40+
dir_name = "-".join(parts)
41+
dir_path = tmp_path_factory.mktemp(dir_name, numbered=True)
42+
yield dir_path
43+
shutil.rmtree(dir_path)
44+
45+
1746
class CommonScenario(Scenario):
1847
@pytest.fixture(scope="class")
1948
def build_tools(self, version: str) -> BuildTools:

tests/python_test_cases/tests/test_basic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import Any
66
import pytest
77
from testing_utils import LogContainer, ScenarioResult
8-
from common_scenario import CommonScenario, ResultCode
8+
from common import CommonScenario, ResultCode
99

1010

1111
@pytest.mark.parametrize("version", ["cpp", "rust"], scope="class")

0 commit comments

Comments
 (0)