Thanks to visit codestin.com
Credit goes to github.com

Skip to content

refactor(resolve_exe): also fix tests#2464

Merged
wpbonelli merged 1 commit into
modflowpy:developfrom
mwtoews:ref-resolve-exe
Mar 3, 2025
Merged

refactor(resolve_exe): also fix tests#2464
wpbonelli merged 1 commit into
modflowpy:developfrom
mwtoews:ref-resolve-exe

Conversation

@mwtoews

@mwtoews mwtoews commented Mar 3, 2025

Copy link
Copy Markdown
Contributor

This extends a bit further than #2457 to resolve #2455 to use the str and PathLib versions of exe paths in the method. It also improves the docstring and return typing info.

But it also fixes autotest/test_mbase.py which was broken on Linux for paths that have mixed case to the repo. Paths don't need to be converted to lower() for equality comparisons, as this breaks mixed-case paths. The tests are written to compare pathlib objects, which works for the host path, e.g. Windows paths:

>>> from pathlib import PureWindowsPath
>>> PureWindowsPath(r"C:\dir\program.EXE") == PureWindowsPath(r"c:\Dir\program.exe")
True

This also catches a missing warning thrown in autotest/test_modflow.py.

@codecov

codecov Bot commented Mar 3, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.8%. Comparing base (bb9824e) to head (9641828).
Report is 64 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff            @@
##           develop   #2464     +/-   ##
=========================================
+ Coverage     68.4%   75.8%   +7.4%     
=========================================
  Files          294     293      -1     
  Lines        59390   61906   +2516     
=========================================
+ Hits         40652   46957   +6305     
+ Misses       18738   14949   -3789     
Files with missing lines Coverage Δ
flopy/mbase.py 72.7% <100.0%> (+2.8%) ⬆️

... and 255 files with indirect coverage changes

@wpbonelli wpbonelli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @mwtoews

@wpbonelli wpbonelli merged commit c61643f into modflowpy:develop Mar 3, 2025
@mwtoews mwtoews deleted the ref-resolve-exe branch March 3, 2025 16:59
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.

AttributeError: 'WindowsPath' object has no attribute 'lower'.

2 participants