Skip to content

Commit b2c7649

Browse files
authored
Merge pull request #652 from opsmill/pog-ruff-S108
Linting: Probable insecure usage of temporary file or directory
2 parents a7f3e6a + 6ad9907 commit b2c7649

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ ignore = [
201201
"PTH109", # `os.getcwd()` should be replaced by `Path.cwd()`
202202
"RUF005", # Consider `[*path, str(key)]` instead of concatenation
203203
"RUF029", # Function is declared `async`, but doesn't `await` or use `async` features.
204-
"S108", # Probable insecure usage of temporary file or directory
205204
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
206205
"S701", # By default, jinja2 sets `autoescape` to `False`. Consider using `autoescape=True`
207206
"SIM102", # Use a single `if` statement instead of nested `if` statements

tests/unit/sdk/checks/test_checks.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from pathlib import Path
2+
13
import pytest
24

35
from infrahub_sdk import InfrahubClient
@@ -6,7 +8,7 @@
68
pytestmark = pytest.mark.httpx_mock(can_send_already_matched_responses=True)
79

810

9-
async def test_class_init() -> None:
11+
async def test_class_init(tmp_path: Path) -> None:
1012
class IFCheckNoQuery(InfrahubCheck):
1113
pass
1214

@@ -29,9 +31,9 @@ class IFCheckNoName(InfrahubCheck):
2931
check = IFCheckNoName()
3032
assert check.name == "IFCheckNoName"
3133

32-
check = IFCheckWithName(root_directory="/tmp")
34+
check = IFCheckWithName(root_directory=str(tmp_path))
3335
assert check.name == "my_check"
34-
assert check.root_directory == "/tmp"
36+
assert check.root_directory == str(tmp_path)
3537

3638

3739
async def test_async_init(client) -> None:

0 commit comments

Comments
 (0)