Skip to content

Use temporary output directory for test_function_replacement_modifier#484

Merged
rbs-jacob merged 2 commits into
redballoonsecurity:masterfrom
alchzh:test-function-replacement-tmp-path
Jul 17, 2024
Merged

Use temporary output directory for test_function_replacement_modifier#484
rbs-jacob merged 2 commits into
redballoonsecurity:masterfrom
alchzh:test-function-replacement-tmp-path

Conversation

@alchzh
Copy link
Copy Markdown
Contributor

@alchzh alchzh commented Jul 17, 2024

Currently running the test suite (specifically test_function_replacement_modifier) pollutes the current directory with these output files which the developer has to clean up to get a clean working tree. This changes it to use pytest's tmp_path fixture.

The output files from subsequent runs are saved in pytest's temporary directories like so instead of being overwritten:

ofrakdev@e9d35e42d66b:/workspaces/rbs-ofrak/ofrak$ cd /tmp/pytest-of-ofrakdev/pytest-
pytest-0/       pytest-1/       pytest-current/ 
ofrakdev@e9d35e42d66b:/workspaces/rbs-ofrak/ofrak$ cd /tmp/pytest-of-ofrakdev/pytest-1/
ofrakdev@e9d35e42d66b:/tmp/pytest-of-ofrakdev/pytest-1$ ls
test_function_replacement_modi0  test_function_replacement_modi2  test_function_replacement_modi4  test_function_replacement_modi6  test_function_replacement_modicurrent
test_function_replacement_modi1  test_function_replacement_modi3  test_function_replacement_modi5  test_function_replacement_modi7
ofrakdev@e9d35e42d66b:/tmp/pytest-of-ofrakdev/pytest-1$ ls test_function_replacement_modi0
replaced_hello.out  replaced_hello.out.lock

Comment thread ofrak_core/test_ofrak/components/test_patch_maker_component.py Outdated
@rbs-jacob rbs-jacob merged commit dc47b07 into redballoonsecurity:master Jul 17, 2024
ANogin pushed a commit to ANogin/ofrak that referenced this pull request Aug 20, 2024
…r` (redballoonsecurity#484)

* Use temporary output directory for function replacement test

* Use pathlib joining for file path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants