Why can't I use `subtypes` in a test?

I tried to use the subtypes function in a test, e.g.:

using Test

@test subtypes(Real) != 0

This works in the REPL, but in a package test this fails with:

UndefVarError: `subtypes` not defined

Can someone explain why and what to do about it?

subtypes I believe is defined in interactiveutils which is loaded automatically by the repl, but needs to be loaded manually in scripts

3 Likes