[issue21112] 3.4 regression: unittest.expectedFailure no longer works on TestCase subclasses

Berker Peksag report at bugs.python.org
Sun May 18 03:37:10 CEST 2014


Berker Peksag added the comment:

> Berker: do you consider your diff ready to go in, or is it an "early"
> diff (like a work-in-progress)?

I tested my patch with test_expectedFailure.py again. The patch is not really fixes the problem described in msg215240. So, I consider it a WIP patch for now. Sorry for the noise.

Here is the output on Python 3.3:

$ python3.3 -m unittest discover -v
test_fails (test_expectedFailure.TestControl) ... FAIL
test_passes (test_expectedFailure.TestControl) ... ok

======================================================================
FAIL: test_fails (test_expectedFailure.TestControl)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/berker/projects/cpython-default/playground/test_expectedFailure.py", line 9, in test_fails
    self.assertFalse(True)
AssertionError: True is not false

----------------------------------------------------------------------
Ran 2 tests in 0.001s

FAILED (failures=1)


And here is the output on Python 3.5 (with issue21112.diff patch):

$ ./../python -m unittest discover -v
test_fails (test_expectedFailure.TestControl) ... FAIL
test_passes (test_expectedFailure.TestControl) ... ok
test_fails (test_expectedFailure.TestTreatment) ... expected failure
test_passes (test_expectedFailure.TestTreatment) ... unexpected success

======================================================================
FAIL: test_fails (test_expectedFailure.TestControl)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/berker/projects/cpython-default/playground/test_expectedFailure.py", line 9, in test_fails
    self.assertFalse(True)
AssertionError: True is not false

----------------------------------------------------------------------
Ran 4 tests in 0.002s

FAILED (failures=1, expected failures=1, unexpected successes=1)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21112>
_______________________________________


More information about the Python-bugs-list mailing list