File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
src/codemodder/codemods/test Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -62,10 +62,8 @@ def run_and_assert(
6262 files : list [Path ] | None = None ,
6363 lines_to_exclude : list [int ] | None = None ,
6464 ):
65- root = root or tmpdir
66- tmp_file_path = (
67- files [0 ] if files else Path (tmpdir ) / f"code.{ self .file_extension } "
68- )
65+ root = root or Path (tmpdir )
66+ tmp_file_path = files [0 ] if files else root / f"code.{ self .file_extension } "
6967 tmp_file_path .write_text (dedent (input_code ))
7068
7169 files_to_check = files or [tmp_file_path ]
@@ -167,13 +165,11 @@ def run_and_assert(
167165 lines_to_exclude : list [int ] | None = None ,
168166 results : str = "" ,
169167 ):
170- root = root or tmpdir
171- tmp_file_path = (
172- files [0 ] if files else Path (tmpdir ) / f"code.{ self .file_extension } "
173- )
168+ root = root or Path (tmpdir )
169+ tmp_file_path = files [0 ] if files else root / f"code.{ self .file_extension } "
174170 tmp_file_path .write_text (dedent (input_code ))
175171
176- tmp_results_file_path = Path ( tmpdir ) / "sast_results"
172+ tmp_results_file_path = root / "sast_results"
177173 tmp_results_file_path .write_text (results )
178174
179175 files_to_check = files or [tmp_file_path ]
You can’t perform that action at this time.
0 commit comments