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'm using DocTestSetup in LLVM.jl to set-up the resource context needed to execute doctests in:
```@meta
DocTestSetup = quote
using LLVM
ctx = Context()
end
```
However, that context is supposed to get cleaned up (not only to avoid memory leaks, but also to detect situations where accidentally using resources from a different context). It would be nice if there were a DocTestTeardown where I could put the clean-up:
```@meta
DocTestTeardown = quote
dispose(ctx)
end
```
Right now, I'm using the following workaround:
```@meta
DocTestSetup = quote
using LLVM
# XXX; clean-up previous contexts
while context(; throw_error=false) !== nothing
dispose(context())
end
ctx = Context()
end
```
I'm using
DocTestSetup
in LLVM.jl to set-up the resource context needed to execute doctests in:However, that context is supposed to get cleaned up (not only to avoid memory leaks, but also to detect situations where accidentally using resources from a different context). It would be nice if there were a
DocTestTeardown
where I could put the clean-up:Right now, I'm using the following workaround:
Also requested on Discourse, https://discourse.julialang.org/t/is-it-possible-to-run-a-cleanup-code-after-a-jldoctest-block-has-been-evaluated/44999, by @jishnub
The text was updated successfully, but these errors were encountered: