New
- Support Python 3.12.
Changed
absl-pyno longer supports Python 3.6. It has reached end-of-life for more
than a year now.- (logging)
logging.exceptioncan now takeexc_infoas argument, with
default valueTrue. Prior to this change settingexc_infowould raise
KeyError, this change fixes this behaviour. - (testing) For Python 3.11+, the calls to
absltest.TestCase.enter_context
are forwarded tounittest.TestCase.enterContext(when called via instance)
orunittest.TestCase.enterClassContext(when called via class) now. As a
result, on Python 3.11+, the private_cls_exit_stackattribute is not
defined onabsltest.TestCaseand_exit_stackattribute is not defined on
its instances. - (testing)
absltest.TestCase.assertSameStructure()now uses the test case's
equality functions (registered withTestCase.addTypeEqualityFunc()) for
comparing leaves of the structure. - (testing)
abslTest.TestCase.fail()now names its arguments
(self, msg=None, user_msg=None), and not(self, msg=None, prefix=None),
better reflecting the behavior and usage of the two message arguments. DEFINE_enum,DEFINE_multi_enum, andEnumParsernow raise errors when
enum_valuesis provided as a single string value. Additionally,
EnumParser.enum_valuesis now stored as a list copy of the provided
enum_valuesparameter.- (testing) Updated
paramaterized.CoopTestCase()to use Python 3 metaclass
idioms. Most uses of this function continued working during the Python 3
migration still worked because a Python 2 compatibility__metaclass__
variables also existed. Now pure Python 3 base classes without backwards
compatibility will work as intended. - (testing)
absltest.TestCase.assertSequenceStartsWithnow explicitly fail
when passed aMappingorSetobject as thewholeargument.