Message333258
Create this program and run with `Python 3.6.3`:
```python
import unittest
class StdErrUnitTests(unittest.TestCase):
def test_function_name(self):
expected = "testing.main_unit_tests.test_dictionaryBasicLogging:416 - dictionary\n" \
"testing.main_unit_tests.test_dictionaryBasicLogging:417 - dictionary {1: 'defined_chunk'}"
actual = "15:49:35:912.348986 - testing.main_unit_tests - dictionary\n" \
"15:49:35:918.879986 - testing.main_unit_tests - dictionary {1: 'defined_chunk'}"
self.assertEqual(expected, actual)
if __name__ == '__main__':
unittest.main()
```
### Actual output
```diff
F
======================================================================
FAIL: test_function_name (__main__.StdErrUnitTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "D:\bug_assert_unittests.py", line 13, in test_function_name
self.assertEqual(expected, actual)
AssertionError: "testing.main_unit_tests.test_dictionaryBa[114 chars]nk'}" != "15:49:35:912.348986 - testing.main_unit_t[94 chars]nk'}"
- testing.main_unit_tests.test_dictionaryBasicLogging:416 - dictionary
- testing.main_unit_tests.test_dictionaryBasicLogging:417 - dictionary {1: 'defined_chunk'}+ 15:49:35:912.348986 - testing.main_unit_tests - dictionary
+ 15:49:35:918.879986 - testing.main_unit_tests - dictionary {1: 'defined_chunk'}
----------------------------------------------------------------------
Ran 1 test in 0.001s
FAILED (failures=1)
```
### Expected output
```diff
F
======================================================================
FAIL: test_function_name (__main__.StdErrUnitTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "D:\bug_assert_unittests.py", line 13, in test_function_name
self.assertEqual(expected, actual)
AssertionError: "testing.main_unit_tests.test_dictionaryBa[114 chars]nk'}" != "15:49:35:912.348986 - testing.main_unit_t[94 chars]nk'}"
- testing.main_unit_tests.test_dictionaryBasicLogging:416 - dictionary
- testing.main_unit_tests.test_dictionaryBasicLogging:417 - dictionary {1: 'defined_chunk'}
+ 15:49:35:912.348986 - testing.main_unit_tests - dictionary
+ 15:49:35:918.879986 - testing.main_unit_tests - dictionary {1: 'defined_chunk'}
----------------------------------------------------------------------
Ran 1 test in 0.001s
FAILED (failures=1)
```
### Differences between actual and expected output
```diff
@@ -7,7 +7,8 @@
self.assertEqual(expected, actual)
AssertionError: "testing.main_unit_tests.test_dictionaryBa[114 chars]nk'}" != "15:49:35:912.348986 - testing.main_unit_t[94 chars]nk'}"
- testing.main_unit_tests.test_dictionaryBasicLogging:416 - dictionary
-- testing.main_unit_tests.test_dictionaryBasicLogging:417 - dictionary {1: 'defined_chunk'}+ 15:49:35:912.348986 - testing.main_unit_tests - dictionary
+- testing.main_unit_tests.test_dictionaryBasicLogging:417 - dictionary {1: 'defined_chunk'}
++ 15:49:35:912.348986 - testing.main_unit_tests - dictionary
+ 15:49:35:918.879986 - testing.main_unit_tests - dictionary {1: 'defined_chunk'}
```
This kind of bug frequently happens. On this case, it is not putting a new line before the `+`. Other cases, it is not putting a new line before the `?`. |
|
Date |
User |
Action |
Args |
2019-01-08 21:57:51 | addons_zz | set | recipients:
+ addons_zz, paul.moore, tim.golden, zach.ware, steve.dower |
2019-01-08 21:57:48 | addons_zz | set | messageid: <1546984668.06.0.145226274602.issue35687@roundup.psfhosted.org> |
2019-01-08 21:57:48 | addons_zz | link | issue35687 messages |
2019-01-08 21:57:47 | addons_zz | create | |
|