-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mutmut3] Forced fail does not fail. #337
Comments
Could you supply the project so I can test? |
I cannot as this is not an open-source library it's a proprietary one for work. I looked at the code for |
It sets the environment variable that makes all trampolines fail immediately. Think of it like turning on an exception being thrown in all functions in your code base. |
I tried again with the latest version of my codebase. Now I am getting an error on the stats collection:
I see a My pkg structure is:
|
Did you try with 3.1.0? I just released it with some fixes for stuff found by other users. |
Yes it ran on |
Ok. Turns out I left an empty However during stats I get:
Which I think might be due to the test itself mocking |
Ah, nice that you solved it.
That's an interesting situation yea. Hmm.. actually.. I don't think I need to use os.environ at all now that I think of it. I think that's a leftover from some earlier idea. |
I realized I do need to use os.environ for multiprocessing support later. Could you make your mock at least fall back to reading the real environ if there's a keyerror? |
I'm not sure how that would work? Would a patch rather than mock fall back to the real object except for the value i am patching? I probably can actually avoid mocking/patching it anyway. The method under test is simply checking an ENV var and returning some bool based on the value. I can probably just directly set the os.environ and call it good. |
You don't have to use Mock to do mocking :) But yea, just setting it seems more sane. |
Tried updating to
mutmut
3.0.5
but I theforced fail
test seems to pass and thus (ironically) fail.The text was updated successfully, but these errors were encountered: