Add test cleanup fixtures and remove global state#42
Add test cleanup fixtures and remove global state#42bjarketol wants to merge 4 commits intoEUFLOW:mainfrom
Conversation
c1c7882 to
5e069dc
Compare
|
@SchmJo can you review this? or what is the process? |
|
I am not entirely sure why you are introducing conftest.py, which looks like a complication. Was the testing not running fine originally? Usually tests run as part of CI/CD , ie., github actions, and the leftover folders don't matter. That being said, I am of course happy with cleaning up after tests. I also don't understand your special treatment of foxes engines, they should not matter for tests. My feeling is that I am missing something. Also, I do not feel comfortable reviewing the pywake part, I guess you need to catch Julian for this. The foxes part I can do, once I understand the main idea! |
|
@SchmJo The main goals are:
I am happy to skip the foxes engine resetting, that was a minor thing. |
|
@SchmJo I removed the foxes engine resetting and the engine argument to the tests. Can you see if you are happy with the rest? |
|
@kilojoules can you review the pywake part? |
SchmJo
left a comment
There was a problem hiding this comment.
Thanks for your work on WIFA, I am still not sure why you are so interested in the tests - are they relevant for your own workflow?
|
@SchmJo @kilojoules can you take a look at this again? If you prefer the old style of having explicit folders, let me know, then perhaps I can just add a cleaning step to each test instead? |
SchmJo
left a comment
There was a problem hiding this comment.
The foxes part looks fine for me
|
I am fine with the modifications. Should we merge this branch? |
kilojoules
left a comment
There was a problem hiding this comment.
Looks good to me beyond the numpy 2 thing
69637af to
752168a
Compare
- Add test cleanup fixtures and output_dir management (conftest.py) - Simplify foxes engine handling and fix test compatibility - Split run_pywake into focused helper functions - Add foxes turbine-based data test with density support - Fix wayve test performance (510s to 6s) - Pin numpy<2.0 for wayve compatibility (np.trapz removal) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
752168a to
2b9c9cf
Compare
* Skip floris tests for unsupported python versions
33fe285 to
2cafe13
Compare
Summary
Closes #41
@pytest.mark.slowProblem
Tests were leaving behind output directories (
output_pywake_4wts/,output_test_foxes/, etc.) that accumulated over multiple runs.Solution
Created
tests/conftest.pywith:output_dirfixture - Provides unique temp directory per test, cleans up on success, preserves on failureChanges
tests/conftest.pytests/test_foxes.pytests/test_pywake.pytests/test_cs.pytests/test_wayve.pyTest plan
uv run python -m pytest tests/ -m "not slow"- all 33 tests passoutput_*directories remain after test run