You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constERROR:&str = "Traceback (most recent call last):\n File \"/temp_folder/script.py\", line 47, in main\n result = process(input)\n File \"/temp_folder/script.py\", line 19, in process\n raise Exception('This is a test')\nException: This is a test\n";
294
+
constERROR:&str = "Traceback (most recent call last):\n File \"/temp_folder/script.py\", line 46, in main\n result = process(input)\n File \"/temp_folder/script.py\", line 10, in process\n raise Exception('This is a test')\nException: This is a test\n";
// assert_eq!(stderr, b"Installed 5 packages in 3ms\n");
441
448
assert!(
@@ -458,8 +465,8 @@ mod tests {
458
465
mod exception_tests {
459
466
usesuper::*;
460
467
461
-
constSTDOUT:&str = "{\"value\":null,\"error\":\"Traceback (most recent call last):\\n File \\\"/temp_folder/script.py\\\", line 47, in main\\n result = process(input)\\n File \\\"/temp_folder/script.py\\\", line 19, in process\\n raise Exception('This is a test')\\nException: This is a test\\n\",\"stdout\":\"hello\\n\",\"stderr\":\"\"}\n";
462
-
constERROR:&str = "Traceback (most recent call last):\n File \"/temp_folder/script.py\", line 47, in main\n result = process(input)\n File \"/temp_folder/script.py\", line 19, in process\n raise Exception('This is a test')\nException: This is a test\n";
468
+
constSTDOUT:&str = "{\"value\":null,\"error\":\"Traceback (most recent call last):\\n File \\\"/temp_folder/script.py\\\", line 46, in main\\n result = process(input)\\n File \\\"/temp_folder/script.py\\\", line 10, in process\\n raise Exception('This is a test')\\nException: This is a test\\n\",\"stdout\":\"hello\\n\",\"stderr\":\"\"}\n";
469
+
constERROR:&str = "Traceback (most recent call last):\n File \"/temp_folder/script.py\", line 46, in main\n result = process(input)\n File \"/temp_folder/script.py\", line 10, in process\n raise Exception('This is a test')\nException: This is a test\n";
463
470
464
471
#[tokio::test]
465
472
asyncfntest_run_function_exception(){
@@ -472,7 +479,12 @@ mod exception_tests {
472
479
stderr,
473
480
} = &output;
474
481
assert!(status.success());
475
-
assert_eq!(stdout,STDOUT.as_bytes(),);
482
+
assert_eq!(
483
+
stdout,
484
+
STDOUT.as_bytes(),
485
+
"{:?}",
486
+
String::from_utf8_lossy(stdout)
487
+
);
476
488
// assert_eq!(stderr, b"Installed 5 packages in 3ms\n");
477
489
assert!(
478
490
stderr
@@ -499,7 +511,12 @@ mod exception_tests {
499
511
stderr,
500
512
} = &output;
501
513
assert!(status.success());
502
-
assert_eq!(stdout,STDOUT.as_bytes());
514
+
assert_eq!(
515
+
stdout,
516
+
STDOUT.as_bytes(),
517
+
"{:?}",
518
+
String::from_utf8_lossy(stdout)
519
+
);
503
520
// assert_eq!(stderr, b"Installed 5 packages in 3ms\n");
0 commit comments