Alrighty, I’ve got a question involving mocking!
I have a function to test for M1 mac laptops, as {greta} currently doesn’t work on M1 and we want to stop the users, to signal that we know about the problem and we are working on it.
The checking for M1 code is here: greta/utils.R at master · greta-dev/greta · GitHub and
implemented here: greta/checkers.R at master · greta-dev/greta · GitHub .
Notably, this means that this error will appear whenever someone uses the main features of the R package.
We have written tests for it here: greta/test-check_m1.R at master · greta-dev/greta · GitHub using mockery.
Alas, we were getting an issue with mockery stubs,
(see this GH action error Merge pull request #488 from njtierney/notify-m1-not-working-487 · greta-dev/greta@b20a446 · GitHub)
This seemed to be related to depth not working? cannot change value of locked binding for '.onLoad' · Issue #30 · r-lib/mockery · GitHub,
So we decided to use the developer version on github.
However, once we changed this over, we started getting even more issues with it leaking out into other parts of testing.
Ideally, this shouldn't be happening, since my understanding of mocking is that it just mocks that function just that one time in the test. It seems that other users are having similar problems: Mockery not cleaning up after itself properly · Issue #57 · r-lib/mockery · GitHub
Does anyone have any thoughts on how to address this?