Skip to content

Commit 0e97758

Browse files
Replace hardcoded temp file path with tempfile in tests/test_config.py (#1316)
* Initial plan * Replace hardcoded temp file with tempfile.NamedTemporaryFile Co-authored-by: JacobCallahan <6618303+JacobCallahan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: JacobCallahan <6618303+JacobCallahan@users.noreply.github.com>
1 parent b31009f commit 0e97758

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/test_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import builtins
44
import json
5+
import tempfile
56
from unittest import TestCase
67
from unittest.mock import call, mock_open, patch
78

@@ -14,7 +15,7 @@
1415
_get_config_file_path,
1516
)
1617

17-
FILE_PATH = '/tmp/bogus.json' # noqa: S108
18+
FILE_PATH = tempfile.NamedTemporaryFile(suffix='.json', delete=False).name
1819
CONFIGS = {
1920
'default': {'url': 'http://example.com'},
2021
'Ask Aak': {'url': 'bogus value', 'auth': ['username', 'password']},

0 commit comments

Comments
 (0)