Only import "testing" in test packages

This replaces the previous PR fixing the import issues for test only packages.  These packages are ok to compile as a regular package as they are never imported from anywhere else.  

Closes #7323