@@ -102,11 +102,9 @@ def test_dotnet_signals_inproc(cmake):
102102 dotnet_run_stdout , dotnet_run_stderr = dotnet_run .communicate ()
103103
104104 # the program handles the `NullReferenceException`, so the Native SDK won't register a crash.
105- assert (
106- dotnet_run .returncode == 0
107- ), f"Managed exception run failed.\n stdout:\n { dotnet_run_stdout } \n stderr:\n { dotnet_run_stderr } "
108- assert (
109- "NullReferenceException" not in dotnet_run_stderr
105+ assert dotnet_run .returncode == 0
106+ assert not (
107+ "NullReferenceException" in dotnet_run_stderr
110108 ), f"Managed exception run failed.\n stdout:\n { dotnet_run_stdout } \n stderr:\n { dotnet_run_stderr } "
111109 database_path = project_fixture_path / ".sentry-native"
112110 assert database_path .exists (), "No database-path exists"
@@ -223,11 +221,9 @@ def test_aot_signals_inproc(cmake):
223221 dotnet_run_stdout , dotnet_run_stderr = dotnet_run .communicate ()
224222
225223 # the program handles the `NullReferenceException`, so the Native SDK won't register a crash.
226- assert (
227- dotnet_run .returncode == 0
228- ), f"Managed exception run failed.\n stdout:\n { dotnet_run_stdout } \n stderr:\n { dotnet_run_stderr } "
229- assert (
230- "NullReferenceException" not in dotnet_run_stderr
224+ assert dotnet_run .returncode == 0
225+ assert not (
226+ "NullReferenceException" in dotnet_run_stderr
231227 ), f"Managed exception run failed.\n stdout:\n { dotnet_run_stdout } \n stderr:\n { dotnet_run_stderr } "
232228 database_path = tmp_path / ".sentry-native"
233229 assert database_path .exists (), "No database-path exists"
@@ -425,36 +421,27 @@ def has_envelope():
425421
426422 # managed exception: handled, no crash
427423 logcat = run_android_managed_exception ()
428- print ("=== managed exception logcat ===\n " , logcat )
429- assert (
430- "NullReferenceException" not in logcat
431- ), "Managed exception leaked.\n logcat:\n {}" .format (logcat )
432- assert wait_for (
433- lambda : dir_exists (db )
434- ), "No database-path exists.\n logcat:\n {}" .format (logcat )
424+ assert not (
425+ "NullReferenceException" in logcat
426+ ), f"Managed exception leaked.\n logcat:\n { logcat } "
427+ assert wait_for (lambda : dir_exists (db )), "No database-path exists"
435428 assert not file_exists (db + "/last_crash" ), "A crash was registered"
436429 assert not has_envelope (), "Unexpected envelope found"
437430
438431 # unhandled managed exception: Mono calls exit(1), the native SDK
439432 # should not register a crash (sentry-dotnet handles this at the
440433 # managed layer via UnhandledExceptionRaiser)
441434 logcat = run_android_unhandled_managed_exception ()
442- print ("=== unhandled managed exception logcat ===\n " , logcat )
443435 assert (
444436 "NullReferenceException" in logcat
445- ), "Expected NullReferenceException.\n logcat:\n {}" .format (logcat )
446- assert wait_for (
447- lambda : dir_exists (db )
448- ), "No database-path exists.\n logcat:\n {}" .format (logcat )
437+ ), f"Expected NullReferenceException.\n logcat:\n { logcat } "
438+ assert wait_for (lambda : dir_exists (db )), "No database-path exists"
449439 assert not file_exists (db + "/last_crash" ), "A crash was registered"
450440 assert not has_envelope (), "Unexpected envelope found"
451441
452442 # native crash
453- logcat = run_android_native_crash ()
454- print ("=== native crash logcat ===\n " , logcat )
455- assert wait_for (
456- lambda : file_exists (db + "/last_crash" )
457- ), "Crash marker missing.\n logcat:\n {}" .format (logcat )
443+ run_android_native_crash ()
444+ assert wait_for (lambda : file_exists (db + "/last_crash" )), "Crash marker missing"
458445 assert wait_for (has_envelope ), "Crash envelope is missing"
459446
460447 finally :
0 commit comments