@@ -349,15 +349,15 @@ def test_single_exception_stacktrace(self):
349
349
if PY2 :
350
350
def test_chained_exceptions_stacktrace (self ):
351
351
expected = '''Traceback (most recent call last):
352
- File "/opt/python-future/tests/test_future/test_utils.py", line 354 , in test_chained_exceptions_stacktrace
352
+ File "/opt/python-future/tests/test_future/test_utils.py", line 1 , in test_chained_exceptions_stacktrace
353
353
raise_from(CustomException('ERROR'), val_err)
354
- File "/opt/python-future/src/future/utils/__init__.py", line 456 , in raise_from
354
+ File "/opt/python-future/src/future/utils/__init__.py", line 1 , in raise_from
355
355
raise e
356
356
CustomException: ERROR
357
357
358
358
The above exception was the direct cause of the following exception:
359
359
360
- File "/opt/python-future/tests/test_future/test_utils.py", line 352 , in test_chained_exceptions_stacktrace
360
+ File "/opt/python-future/tests/test_future/test_utils.py", line 1 , in test_chained_exceptions_stacktrace
361
361
raise ValueError('Wooops')
362
362
ValueError: Wooops
363
363
'''
@@ -368,7 +368,10 @@ def test_chained_exceptions_stacktrace(self):
368
368
except ValueError as val_err :
369
369
raise_from (CustomException ('ERROR' ), val_err )
370
370
except Exception as err :
371
- self .assertEqual (expected .splitlines (), traceback .format_exc ().splitlines ())
371
+ ret = re .sub (r'"[^"]*tests/test_future' , '"/opt/python-future/tests/test_future' , traceback .format_exc ())
372
+ ret = re .sub (r'"[^"]*future/utils/__init__.py' , '"/opt/python-future/src/future/utils/__init__.py' , ret )
373
+ ret = re .sub (r', line \d+,' , ', line 1,' , ret )
374
+ self .assertEqual (expected .splitlines (), ret .splitlines ())
372
375
else :
373
376
self .fail ('No exception raised' )
374
377
0 commit comments