BF: deal with test crash from non-source files

When loading tests from a compiled extension, the result of
``getpackage(filename)`` can be None, causing an error in
DocTestCase.id when it tries to use the result as a string.

I believe this closes gh-447