Fix handling import errors when loading tests from paths