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
julia>using Mocking:@patch
julia>f() =5
f (generic function with 1 method)
julia> f_patch =@patchf() =6
ERROR: UndefVarError: Mocking not defined
Stacktrace:
[1] top-level scope
@ REPL[3]:1
The @patch macro expects Mocking to be in scope, which does not need to be the case.
The Blue style guide recommends putting things into scope as is done in the code snippet above for example.
The text was updated successfully, but these errors were encountered:
Hmm, that's tricky. Since @patch is just generating code that uses the Mocking namespace it is in scope as far as Julia is concern, so the correct way to write that according to the Blue style guide is:
using Mocking: Mocking, @patch
...
Outside of getting rid of the macro altogether I don't think there's a good solution.
The @patch macro expects Mocking to be in scope, which does not need to be the case.
The Blue style guide recommends putting things into scope as is done in the code snippet above for example.
The text was updated successfully, but these errors were encountered: