HomePhabricator

[tests] Use allowed_failure with Python 2 behaviour

Description

[tests] Use allowed_failure with Python 2 behaviour

With Python 3 unittest.expectedFailure fails tests if they passes unexpectedly.
In some circumstances tests fail or pass if the test parameters aren't
deterministic. In such cases the test suite should be able to pass like
it does with Python 2.

  • Don't care about exceptions other than AssertionError; they should always fail.
  • Unfortunately this decorator does not work with subtests
  • Remove deprecation warnings and allow this decorator to be used in such cases described above
  • Additional documentation

Bug: T223030
Bug: T233484
Change-Id: Iab611d29c655b49ad442384e3c8c1edcfeccca9c

Details

Provenance
XqtAuthored on Nov 5 2019, 11:25 AM
Parents
rPWBC5b01c750a323: [IMPR] Use functools.wraps to fix wrapper name
Branches
Unknown
Tags
Unknown
ChangeId
Iab611d29c655b49ad442384e3c8c1edcfeccca9c