currently, unittest() uses getNamespace() which will return the installed package.
When the package is loaded via devtools, that version should be tested:
hySpc.testthat::unittest() should first check whether ns %in% devtools::dev_packages(). If so, it's a package loaded by devtools.
In that case, look recursively through parent.env(.GlobalEnv) for paste0("package:", ns).
Otherwise, getNamespace() is the way to go.