1818
1919from newrelic .api .application import application_instance as application
2020from newrelic .api .background_task import background_task
21- from newrelic .api .time_trace import record_exception
21+ from newrelic .api .time_trace import notice_error
2222
2323from testing_support .fixtures import (validate_transaction_exception_message ,
2424 set_default_encoding , validate_application_exception_message ,
@@ -44,7 +44,7 @@ def test_py2_transaction_exception_message_unicode():
4444 try :
4545 raise ValueError (UNICODE_MESSAGE )
4646 except ValueError :
47- record_exception ()
47+ notice_error ()
4848
4949@pytest .mark .skipif (six .PY3 , reason = "Testing Python 2 string behavior" )
5050@set_default_encoding ('ascii' )
@@ -56,7 +56,7 @@ def test_py2_transaction_exception_message_unicode_english():
5656 try :
5757 raise ValueError (UNICODE_ENGLISH )
5858 except ValueError :
59- record_exception ()
59+ notice_error ()
6060
6161@pytest .mark .skipif (six .PY3 , reason = "Testing Python 2 string behavior" )
6262@set_default_encoding ('ascii' )
@@ -67,7 +67,7 @@ def test_py2_transaction_exception_message_bytes_english():
6767 try :
6868 raise ValueError (BYTES_ENGLISH )
6969 except ValueError :
70- record_exception ()
70+ notice_error ()
7171
7272@pytest .mark .skipif (six .PY3 , reason = "Testing Python 2 string behavior" )
7373@set_default_encoding ('ascii' )
@@ -81,7 +81,7 @@ def test_py2_transaction_exception_message_bytes_non_english():
8181 try :
8282 raise ValueError (BYTES_UTF8_ENCODED )
8383 except ValueError :
84- record_exception ()
84+ notice_error ()
8585
8686@pytest .mark .skipif (six .PY3 , reason = "Testing Python 2 string behavior" )
8787@set_default_encoding ('ascii' )
@@ -99,7 +99,7 @@ def test_py2_transaction_exception_message_bytes_implicit_encoding_non_english()
9999
100100 raise ValueError ('I💜🐍' )
101101 except ValueError :
102- record_exception ()
102+ notice_error ()
103103
104104@pytest .mark .skipif (six .PY3 , reason = "Testing Python 2 string behavior" )
105105@set_default_encoding ('utf-8' )
@@ -112,7 +112,7 @@ def test_py2_transaction_exception_message_unicode_utf8_encoding():
112112 try :
113113 raise ValueError (UNICODE_MESSAGE )
114114 except ValueError :
115- record_exception ()
115+ notice_error ()
116116
117117@pytest .mark .skipif (six .PY3 , reason = "Testing Python 2 string behavior" )
118118@set_default_encoding ('utf-8' )
@@ -129,7 +129,7 @@ def test_py2_transaction_exception_message_bytes_utf8_encoding_non_english():
129129
130130 raise ValueError ('I💜🐍' )
131131 except ValueError :
132- record_exception ()
132+ notice_error ()
133133
134134# ---------------- Python 3
135135
@@ -142,7 +142,7 @@ def test_py3_transaction_exception_message_bytes_non_english_unicode():
142142 try :
143143 raise ValueError (UNICODE_MESSAGE )
144144 except ValueError :
145- record_exception ()
145+ notice_error ()
146146
147147@pytest .mark .skipif (six .PY2 , reason = "Testing Python 3 string behavior" )
148148@validate_transaction_exception_message (UNICODE_ENGLISH )
@@ -153,7 +153,7 @@ def test_py3_transaction_exception_message_unicode_english():
153153 try :
154154 raise ValueError (UNICODE_ENGLISH )
155155 except ValueError :
156- record_exception ()
156+ notice_error ()
157157
158158@pytest .mark .skipif (six .PY2 , reason = "Testing Python 3 string behavior" )
159159@validate_transaction_exception_message (INCORRECTLY_DECODED_BYTES_PY3 )
@@ -169,7 +169,7 @@ def test_py3_transaction_exception_message_bytes_non_english():
169169 try :
170170 raise ValueError (BYTES_UTF8_ENCODED )
171171 except ValueError :
172- record_exception ()
172+ notice_error ()
173173
174174# =================== Exception messages outside transaction ====================
175175
@@ -186,7 +186,7 @@ def test_py2_application_exception_message_unicode():
186186 raise ValueError (UNICODE_MESSAGE )
187187 except ValueError :
188188 app = application ()
189- record_exception (application = app )
189+ notice_error (application = app )
190190
191191@pytest .mark .skipif (six .PY3 , reason = "Testing Python 2 string behavior" )
192192@reset_core_stats_engine ()
@@ -199,7 +199,7 @@ def test_py2_application_exception_message_unicode_english():
199199 raise ValueError (UNICODE_ENGLISH )
200200 except ValueError :
201201 app = application ()
202- record_exception (application = app )
202+ notice_error (application = app )
203203
204204@pytest .mark .skipif (six .PY3 , reason = "Testing Python 2 string behavior" )
205205@reset_core_stats_engine ()
@@ -211,7 +211,7 @@ def test_py2_application_exception_message_bytes_english():
211211 raise ValueError (BYTES_ENGLISH )
212212 except ValueError :
213213 app = application ()
214- record_exception (application = app )
214+ notice_error (application = app )
215215
216216@pytest .mark .skipif (six .PY3 , reason = "Testing Python 2 string behavior" )
217217@reset_core_stats_engine ()
@@ -226,7 +226,7 @@ def test_py2_application_exception_message_bytes_non_english():
226226 raise ValueError (BYTES_UTF8_ENCODED )
227227 except ValueError :
228228 app = application ()
229- record_exception (application = app )
229+ notice_error (application = app )
230230
231231@pytest .mark .skipif (six .PY3 , reason = "Testing Python 2 string behavior" )
232232@reset_core_stats_engine ()
@@ -245,7 +245,7 @@ def test_py2_application_exception_message_bytes_implicit_encoding_non_english()
245245 raise ValueError ('I💜🐍' )
246246 except ValueError :
247247 app = application ()
248- record_exception (application = app )
248+ notice_error (application = app )
249249
250250@pytest .mark .skipif (six .PY3 , reason = "Testing Python 2 string behavior" )
251251@reset_core_stats_engine ()
@@ -259,7 +259,7 @@ def test_py2_application_exception_message_unicode_utf8_encoding():
259259 raise ValueError (UNICODE_MESSAGE )
260260 except ValueError :
261261 app = application ()
262- record_exception (application = app )
262+ notice_error (application = app )
263263
264264@pytest .mark .skipif (six .PY3 , reason = "Testing Python 2 string behavior" )
265265@reset_core_stats_engine ()
@@ -277,7 +277,7 @@ def test_py2_application_exception_message_bytes_utf8_encoding_non_english():
277277 raise ValueError ('I💜🐍' )
278278 except ValueError :
279279 app = application ()
280- record_exception (application = app )
280+ notice_error (application = app )
281281
282282# ---------------- Python 3
283283
@@ -291,7 +291,7 @@ def test_py3_application_exception_message_bytes_non_english_unicode():
291291 raise ValueError (UNICODE_MESSAGE )
292292 except ValueError :
293293 app = application ()
294- record_exception (application = app )
294+ notice_error (application = app )
295295
296296@pytest .mark .skipif (six .PY2 , reason = "Testing Python 3 string behavior" )
297297@reset_core_stats_engine ()
@@ -303,7 +303,7 @@ def test_py3_application_exception_message_unicode_english():
303303 raise ValueError (UNICODE_ENGLISH )
304304 except ValueError :
305305 app = application ()
306- record_exception (application = app )
306+ notice_error (application = app )
307307
308308@pytest .mark .skipif (six .PY2 , reason = "Testing Python 3 string behavior" )
309309@reset_core_stats_engine ()
@@ -320,4 +320,4 @@ def test_py3_application_exception_message_bytes_non_english():
320320 raise ValueError (BYTES_UTF8_ENCODED )
321321 except ValueError :
322322 app = application ()
323- record_exception (application = app )
323+ notice_error (application = app )
0 commit comments