Skip to content

Remove flakiness in test_single_exception #483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions tests/test_future/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

from __future__ import absolute_import, unicode_literals, print_function
import sys, traceback
import re, sys, traceback
from future.builtins import *
from future.utils import (old_div, istext, isbytes, native, PY2, PY3,
native_str, raise_, as_native_str, ensure_new_type,
Expand Down Expand Up @@ -335,12 +335,14 @@ def test_single_exception_stacktrace(self):
if PY2:
expected += 'CustomException: ERROR\n'
else:
expected += 'tests.test_future.test_utils.CustomException: ERROR\n'
expected += 'test_future.test_utils.CustomException: ERROR\n'

try:
raise CustomException('ERROR')
except:
self.assertEqual(expected, traceback.format_exc())
ret = re.sub(r'"[^"]*tests/test_future', '"/opt/python-future/tests/test_future', traceback.format_exc())
ret = re.sub(r', line \d+,', ', line 328,', ret)
self.assertEqual(expected, ret)
else:
self.fail('No exception raised')

Expand Down