New submission from Serhiy Storchaka <storchaka+cpyt...@gmail.com>:

$ ./python -OO -m test -vuall test_unittest
...
======================================================================
FAIL: testShortDescriptionWhitespaceTrimming 
(unittest.test.test_case.Test_TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/unittest/test/test_case.py", line 639, in 
testShortDescriptionWhitespaceTrimming
    self.assertEqual(
    ^^^^^^^^^^^^^^^^^
AssertionError: None != 'Tests shortDescription() whitespace is trimmed, so 
that the first'

======================================================================
FAIL: test_Exit (unittest.test.test_program.Test_TestProgram)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/unittest/test/test_program.py", line 127, 
in test_Exit
    self.assertIn('\nFAIL: testFail ', stream.getvalue())
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: '\nFAIL: testFail ' not found in 
'..\n----------------------------------------------------------------------\nRan
 2 tests in 0.000s\n\nOK\n'

======================================================================
FAIL: test_ExitAsDefault (unittest.test.test_program.Test_TestProgram)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/unittest/test/test_program.py", line 139, 
in test_ExitAsDefault
    self.assertIn('\nFAIL: testFail ', stream.getvalue())
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: '\nFAIL: testFail ' not found in 
'..\n----------------------------------------------------------------------\nRan
 2 tests in 0.000s\n\nOK\n'

======================================================================
FAIL: test_NonExit (unittest.test.test_program.Test_TestProgram)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/unittest/test/test_program.py", line 114, 
in test_NonExit
    self.assertIn('\nFAIL: testFail ', stream.getvalue())
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: '\nFAIL: testFail ' not found in 
'..\n----------------------------------------------------------------------\nRan
 2 tests in 0.000s\n\nOK\n'

======================================================================
FAIL: test_special_attrs (unittest.test.testmock.testpatch.PatchTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/unittest/test/testmock/testpatch.py", line 
1880, in test_special_attrs
    self.assertEqual(foo.__doc__, "TEST")
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: None != 'TEST'

----------------------------------------------------------------------

----------
assignee: serhiy.storchaka
components: Tests
messages: 408755
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: test_unittest fails in optimized mode
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46111>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to