-
Notifications
You must be signed in to change notification settings - Fork 28
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
unit tests (documentation request) #62
Comments
A copy/pastable example would surely make this easier to address |
Thank you for the speedy reply. I made a minimum example project as follows. Edited multiple times due to a bug. Fixed now. src/Demo.jl: module Demo
using Requires
#using DataFrames
#Base.show(io::IO, mime::MIME"text/html", df::DataFrame) = print(io, "success")
function __init__()
@require DataFrames="a93c6f00-e57d-5684-b7b6-d8193f3e46c0" Base.show(io::IO, mime::MIME"text/html", df::DataFrames.DataFrame) = print(io, "success")
end # __init__
end # module test/runtests.jl: using Test
using DataFrames, Demo
@test begin
io = IOBuffer()
Base.show(io, "text/html", DataFrame())
String(take!(io))
end == "success" This works if I add Then I try removing the dependency on Project.toml then ends in
But the error message about |
Perhaps add |
@shipengcheng1230 has the right answer; this is a package-management issue, not a Requires issue. |
I fail at writing unit tests for methods overwritten by
@require
. There are two problems I'm grappling with:julia
complains if I don't add the optional dependency to the package, possibly causing the next issue.using
my package and the optional dependency, it fails to replace the method in question when executed via] test
from the filetest/runtests.jl
.Is there a chance that some documentation (or, better yet, a brief example) could be added to the documentation? Thanks alot!
The text was updated successfully, but these errors were encountered: