Mocking.jl icon indicating copy to clipboard operation
Mocking.jl copied to clipboard

uses ScopedValues to fix async issue

Open oxinabox opened this issue 1 year ago • 1 comments

In julia 1.11 we get a proper way to do what ContextVariablesX did with an hack.

This is a rebasing of #91 with that switch over it should not run into the issues that required #93

julia> f() = "original"
f (generic function with 1 method)

julia> p = @patch f() = "mocked"
Patch{typeof(f)}(f, var"##f_patch#233")

julia> apply(p) do
       @show Mocking.PATCH_ENV[]
       end;
Mocking.PATCH_ENV[] = Mocking.PatchEnv(Dict{Any, Vector{Function}}(f => [var"##f_patch#233"]), false)

oxinabox avatar Feb 26 '24 11:02 oxinabox

Going to kick start the CI workflow

omus avatar Mar 12 '24 21:03 omus

The change here broke the test case on Julia 1.11+ which was testing for issue #108. I'll roll this change back temporarily and include it in a breaking release.

omus avatar Jul 16 '24 15:07 omus