From f1b90ce1e21826a9fcb9529adb677f3cb92e2b13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 19 Nov 2019 14:32:57 +0100 Subject: [PATCH] tests: make test_finish_failed_request work standalone (#36515) --- tests/test_publisher.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_publisher.py b/tests/test_publisher.py index 78ab8529f..023de2633 100644 --- a/tests/test_publisher.py +++ b/tests/test_publisher.py @@ -62,10 +62,16 @@ def test_plaintext_error(): assert not re.findall('^>.*\d+.*s = pub._generate_plaintext_error', s, re.MULTILINE) def test_finish_failed_request(): + pub.USE_LONG_TRACES = False + try: + raise Exception('foo') + except: + exc_type, exc_value, tb = sys.exc_info() + req = get_request() pub._set_request(req) body = pub.finish_failed_request() - assert '

Internal Server Error

' in body + assert '

Internal Server Error

' in str(body) req = get_request() pub._set_request(req)