Skip to content

Commit

Permalink
Use temporary output directory for `test_function_replacement_modifie…
Browse files Browse the repository at this point in the history
…r` (#484)

* Use temporary output directory for function replacement test

* Use pathlib joining for file path
  • Loading branch information
alchzh committed Jul 17, 2024
1 parent 56aeb67 commit dc47b07
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class FunctionReplacementTestCaseConfig:


@pytest.mark.parametrize("config", TEST_CASE_CONFIGS)
async def test_function_replacement_modifier(ofrak_context: OFRAKContext, config):
async def test_function_replacement_modifier(ofrak_context: OFRAKContext, config, tmp_path):
root_resource = await ofrak_context.create_root_resource_from_file(config.program.path)
await root_resource.unpack_recursively()
target_program = await root_resource.view_as(Program)
Expand Down Expand Up @@ -230,7 +230,7 @@ async def test_function_replacement_modifier(ofrak_context: OFRAKContext, config
)

await target_program.resource.run(FunctionReplacementModifier, function_replacement_config)
new_program_path = f"replaced_{Path(config.program.path).name}"
new_program_path = str(tmp_path / f"replaced_{Path(config.program.path).name}")

# When running tests in parallel, do this one at a time
lock = filelock.FileLock(new_program_path + ".lock")
Expand Down

0 comments on commit dc47b07

Please sign in to comment.