You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to mock specific calls to subprocess but the command inputs are varying, e.g. cmake -S/path/to/generated_data -B/random/build_path. I would thus like to use regex match these arguments and make sure other commands like cmake --build are not called.
The text was updated successfully, but these errors were encountered:
I can partially use it, but I want to selectively mock these, i.e. ["cmake", "--build", fp.any(min=1)] (succeed), ["cmake", re.compile(r"-S\S*"), re.comiple(r"-B\S*"), fp.any()] (succeed), ["cmake", fp.any()] (everything else must fail)
My suggestion here is to allow to pass it re.compile if we want to check regex. It would be nice to pass it only r-string, but I don't think that would tell us if it's regex or not.
I agree that regex may be helpful here. I'll try to add support for it soon, but I can't promise anything. Feel free to submit a PR with your proposal.
I want to mock specific calls to subprocess but the command inputs are varying, e.g.
cmake -S/path/to/generated_data -B/random/build_path
. I would thus like to use regex match these arguments and make sure other commands likecmake --build
are not called.The text was updated successfully, but these errors were encountered: