Message333299
* Correction
```python
import difflib
def bugged_diff(expected, actual):
expected = expected.splitlines( 1 )
actual = actual.splitlines( 1 )
# diff = difflib.ndiff( expected, actual )
if expected != actual:
diff = difflib.context_diff( expected, actual, fromfile='expected input', tofile='actual output', lineterm='\n' )
return '\n' + ''.join( diff )
if __name__ == '__main__':
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'}"
print( bugged_diff( expected, actual ) )
```
Outputs:
```
*** expected input
--- actual output
***************
*** 1,2 ****
! testing.main_unit_tests.test_dictionaryBasicLogging:416 - dictionary
! testing.main_unit_tests.test_dictionaryBasicLogging:417 - dictionary {1: 'defined_chunk'}--- 1,2 ----
! 15:49:35:912.348986 - testing.main_unit_tests - dictionary
! 15:49:35:918.879986 - testing.main_unit_tests - dictionary {1: 'defined_chunk'}
```
May be it should be:
```
*** expected input
--- actual output
***************
*** 1,2 ****
! testing.main_unit_tests.test_dictionaryBasicLogging:416 - dictionary
! testing.main_unit_tests.test_dictionaryBasicLogging:417 - dictionary {1: 'defined_chunk'}
--- 1,2 ----
! 15:49:35:912.348986 - testing.main_unit_tests - dictionary
! 15:49:35:918.879986 - testing.main_unit_tests - dictionary {1: 'defined_chunk'}
``` |
|
Date |
User |
Action |
Args |
2019-01-09 10:56:10 | addons_zz | set | recipients:
+ addons_zz, paul.moore, rbcollins, tim.golden, ned.deily, ezio.melotti, michael.foord, zach.ware, xtreak |
2019-01-09 10:56:08 | addons_zz | set | messageid: <1547031368.68.0.364902152295.issue35687@roundup.psfhosted.org> |
2019-01-09 10:56:08 | addons_zz | link | issue35687 messages |
2019-01-09 10:56:08 | addons_zz | create | |
|