[issue37890] Modernize several tests in test_importlib

Brett Cannon report at bugs.python.org
Wed Aug 21 12:45:40 EDT 2019


Brett Cannon <brett at python.org> added the comment:

A key question here is why are you trying to avoid the AttributeError case so much? If something has a bug and an attribute doesn't exist that should then that's a bug and the test needs to catch that. Now whether that's via an error from AttributeError being raise or an explicit failure case you still get notified, but there's a reason that we don't have attribute existence tests before every single attribute access throughout the test suite. ;) Basically unless the attribute is dynamic and thus you're explicitly testing the attribute got set then don't worry about it.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37890>
_______________________________________


More information about the Python-bugs-list mailing list