[docs] Code, test, and doc review for PEP-0435 Enum (issue 17947)

zachary.ware at gmail.com zachary.ware at gmail.com
Fri May 10 22:43:10 CEST 2013

File Lib/test/test_enum.py (right):

Lib/test/test_enum.py:64: self.assertFalse(_errors)
This is better, but now any exceptions that are raised are masked.  How
about instead of assertFalse, do (untested):
for e in _errors:
    with self.subTest():
        raise e

This is also going to cause a lot of NameErrors in the tests that use
these Enums, so it would be nice to set dummy values in the except
clauses and skip the tests that don't have the necessary Enum available.

On the other hand, I still think it would be just a whole lot simpler to
lose the try/excepts.  If actually creating the Enum is broken, I'd be
more concerned with getting that fixed than running the tests that can
be run on non-broken Enums.


More information about the docs mailing list