Kyle Stanley <aeros...@gmail.com> added the comment:

> A key question here is why are you trying to avoid the AttributeError case so 
> much?

> but there's a reason that we don't have attribute existence tests before 
> every single attribute access throughout the test suite

Hmm, good point. I may have been fixating on avoiding exceptions within the 
tests a bit too much, perhaps the exception would be appropriate in this case.

> Basically unless the attribute is dynamic and thus you're explicitly testing 
> the attribute got set then don't worry about it.

Ah, that answers my earlier question, thanks. (:

With an initial glance, do you have any specific ideas as to how 
test_pkg_import.py should be changed to utilize importlib directly? I've been 
reading through the docs looking for ideas, but I'll admit that I'm not 
particularly experienced with using importlib.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37890>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to