Skip to content

Commit f16be01

Browse files
committed
refactor(tests): get_random_filename returns a simple str
1 parent 8ba515b commit f16be01

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

tests/tools/go/conftest.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33

44
import pytest
55

6-
from dda.utils.fs import Path
7-
86

97
@pytest.fixture
108
def get_random_filename():
11-
def _get_random_filename(k: int = 10, root: Path | None = None) -> Path:
12-
return (root or Path()).joinpath(urlsafe_b64encode(urandom(k)).decode("utf-8"))
9+
def _get_random_filename(k: int = 10) -> str:
10+
return urlsafe_b64encode(urandom(k)).decode("utf-8")
1311

1412
return _get_random_filename

tests/tools/go/test_go.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test_command_formation(self, app, mocker, call_args, get_random_filename):
5252

5353
# Generate dummy package and output paths
5454
n_packages = call_args.pop("n_packages", 0)
55-
packages: tuple[Path, ...] = tuple(get_random_filename() for _ in range(n_packages))
55+
packages: tuple[str, ...] = tuple(get_random_filename() for _ in range(n_packages))
5656
output: Path = get_random_filename()
5757
app.tools.go.build(
5858
*packages,

0 commit comments

Comments
 (0)